<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="cid:filelist.xml@01C47003.9170FB50">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7,8 pt</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:ApplyBreakingRules/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-alt:\5B8B\4F53;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        mso-pagination:none;
        font-size:10.5pt;
        mso-bidi-font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:SimSun;
        mso-font-kerning:1.0pt;
        mso-ansi-language:EN-GB;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;
        text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;
        text-underline:single;}
span.EmailFormatvorlage17
        {mso-style-type:personal-compose;
        mso-style-noshow:yes;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-fareast-font-family:SimSun;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:windowtext;}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
 /* Page Definitions */
 @page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:42.55pt;
        mso-footer-margin:49.6pt;
        mso-paper-source:0;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */ 
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=ZH-CN link=blue vlink=purple style='tab-interval:21.0pt;text-justify-trim:
punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Hi, all,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>By some filters of <span
class=SpellE>itk</span>, I get one closed contour as one image. This image is
one binary image that<o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=1 face=Arial><span lang=EN-GB
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>the</span></font></span><font
size=1 face=Arial><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:
10.0pt;font-family:Arial'> pixel value is 100 when is pixel is in the contour,
otherwise it is 0.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Now I want to convert this
contour to <span class=SpellE>ChainCode</span>. My <span class=SpellE>pseudocode</span>
is as follow:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp; </span>Search the image from the first pixel to
find the first point in the contour;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp; </span>Add this point to <span class=SpellE>ChainCode</span>
list, and set its value to 0;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp; </span>Search the immediate <span class=SpellE>neighbors</span>
of <span class=SpellE>of</span> this point to check if it is on contour;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>If this point&#8217;s
value==100;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Add
it to <span class=SpellE>ChainCode</span>, and set its value to 0;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Loop
searching<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class=GramE>else</span><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Stop
searching;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:
2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Finish
the <span class=SpellE>ChainCode</span>;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=DE style='font-size:9.0pt;
mso-bidi-font-size:10.0pt;font-family:Arial;mso-ansi-language:DE'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>// <span class=GramE>The</span>
order of checking <span class=SpellE>neighbors</span>. Assume the current <span
class=GramE>points is</span> at &#8220;0&#8221;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp; </span>------------------------<span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp; </span><span class=GramE>| <span
style='mso-spacerun:yes'>&nbsp;</span>5</span> <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>3 <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>8 <span
style='mso-spacerun:yes'>&nbsp;</span>|<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp; </span>|-------------------------|<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp; </span><span class=GramE>| <span
style='mso-spacerun:yes'>&nbsp;</span>1</span> <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>0 <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>2 <span
style='mso-spacerun:yes'>&nbsp;</span>|<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp; </span>|-------------------------|<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp; </span><span class=GramE>| <span
style='mso-spacerun:yes'>&nbsp;</span>7</span> <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>4 <span
style='mso-spacerun:yes'>&nbsp;</span>| <span
style='mso-spacerun:yes'>&nbsp;</span>6 <span
style='mso-spacerun:yes'>&nbsp;</span>|<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>//<span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp; </span>-----------------------<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=DE style='font-size:9.0pt;
mso-bidi-font-size:10.0pt;font-family:Arial;mso-ansi-language:DE'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>This searching method works,
but not always. Sometime, it stops at somewhere, but the contour is<o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=1 face=Arial><span lang=EN-GB
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>not</span></font></span><font
size=1 face=Arial><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:
10.0pt;font-family:Arial'> completed. And the stopped point is not different as
other found points. I even enlarge the <o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=1 face=Arial><span lang=EN-GB
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>neighbourhood</span></font></span><font
size=1 face=Arial><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:
10.0pt;font-family:Arial'> to a bigger circle. But it is still not stable. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Maybe my question is beyond
the range of this <span class=SpellE>itk</span> <span class=SpellE>maillist</span>.
I&#8217;m really upset with this problem.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Who can give me some
suggestions?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Thanks a lot!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'>Jiang<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-GB style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>