<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Zhang-Suen on Yu-Cheng's Notes</title><link>https://linkingmon.github.io/blog/tags/zhang-suen/</link><description>Recent content in Zhang-Suen on Yu-Cheng's Notes</description><generator>Hugo -- 0.166.0</generator><language>en-us</language><lastBuildDate>Wed, 29 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://linkingmon.github.io/blog/tags/zhang-suen/index.xml" rel="self" type="application/rss+xml"/><item><title>Image processing - Zhang-Suen Thinning</title><link>https://linkingmon.github.io/blog/note/rdp3/</link><pubDate>Wed, 29 Jul 2026 00:00:00 +0000</pubDate><guid>https://linkingmon.github.io/blog/note/rdp3/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;The next step is to implement the thinning algorithm, where we use the zhang-suen thinning algorithm. This method aims to remove all the points until becoming a single line (skeleton).&lt;/p&gt;
&lt;p&gt;The algoritmh check all colored points (will call black), then see if the neighbor&amp;rsquo;s black and white is under some condition, if the condition mets the black point would be removed (that is become white).&lt;/p&gt;
&lt;h1 id="implementation"&gt;Implementation&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;CountNonZero8&lt;/code&gt; (result as &lt;code&gt;A&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;count how many &lt;code&gt;1&lt;/code&gt;&amp;rsquo;s in the 8 neighbors.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="2"&gt;
&lt;li&gt;&lt;code&gt;Transitions01&lt;/code&gt; (results as &lt;code&gt;B&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;count how many &lt;code&gt;0&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt; for 8 neighbors.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Two pass checking (slightly differnet)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;A&lt;/code&gt; should be &lt;code&gt;2~6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;B&lt;/code&gt; should be &lt;code&gt;1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p2&lt;/code&gt; or &lt;code&gt;p4&lt;/code&gt; or &lt;code&gt;p6&lt;/code&gt; should be &lt;code&gt;0&lt;/code&gt; (&lt;code&gt;p2&lt;/code&gt;, &lt;code&gt;p4&lt;/code&gt;, &lt;code&gt;p8&lt;/code&gt; in second pass)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p4&lt;/code&gt; or &lt;code&gt;p6&lt;/code&gt; or &lt;code&gt;p8&lt;/code&gt; should be &lt;code&gt;0&lt;/code&gt; (&lt;code&gt;p2&lt;/code&gt;, &lt;code&gt;p6&lt;/code&gt;, &lt;code&gt;p8&lt;/code&gt; in second pass)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;denoting as:&lt;/p&gt;</description></item></channel></rss>