<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Fast Contour Tracing Algorithm Based on a Backward Contour Tracing Method</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yuriy Batko</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vitalii Dyminskyi</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>1</fpage>
      <lpage>3</lpage>
      <abstract>
        <p>The article contains algorithm for detecting a connected objects contour. The algorithm was teste on digital biomedical images. The contours are use to separate objects from their backgrounds, to calculate the sizes of objects, to classify shapes and to find the feature points of objects).</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        Analysis form of objects plays a significant role in the
course of many researches. In particular, changing the shape
of the object can signal its transition from one state to another
(for example, in the medical process of the course of the
disease) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In nature, the shape of an object is determine by
its contours (cell walls, outside layer etc.).
      </p>
      <p>Contour tracing is the stage of receiving a discrete signal
describing the boundaries of the digital object.</p>
      <p>The requirements for contour tracing algorithms are:
reduction of storage space; reducing the time and complexity
of further processing; obtaining informative features of the
object.</p>
      <p>The separate contour can take place in two ways:
underlining the boundaries of an object by filtering the input
image or by passing the inner contour of a homogeneous
region.</p>
      <p>The main algorithms for selecting the boundaries of the
object are snake algorithm, Canny algorithm, filtration based
on Sobel, Laplace, Prewitt and others. They are base on
underscoring sharp drops of brightness, which are
characteristic of the boundaries of objects. The result of their
work is a set of unconnected areas. To obtain connected
contour, it is necessary to carry out additional processing.</p>
      <p>
        Algorithms for selection of areas: threshold segmentation,
clustering, region-growing, watershed algorithm, block
segmentation, etc. They are base on a union pixels in
homogeneous regions based on a certain homogeneity
criterion [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The result of their work is a set of homogeneous
areas. To get the description of the contour of object, it is
necessary to use contour tracing algorithms.
      </p>
      <p>The following algorithms for passing the contour are
know:</p>
      <p>
        1) Square Tracing Algorithm [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] algorithm, the main
advantage of which is simplicity. Contour tracing is base on
two simple rules: if the value of the active pixel is equal to
one (the active pixel is at the point belonging the object), then
the left turn, otherwise, when the active pixel value is zero
(the active pixel is at a point, which does not belong the
object), then right turn). The algorithm stops its work if it
returns to the starting point.
      </p>
      <p>
        2) Moore-Neighbor Tracing [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] - The algorithm is based on
step-by-step verification of all adjacent points in order to find
the next contour point. Stopping the algorithm occurs when it
returns to the starting point.
      </p>
      <p>
        3) "Radial Sweep" [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] - this algorithm is a modification of
the previous one. Its main difference lies in the point of
beginning of the bypass of the active pixel. In this algorithm,
this is a point that was recognize as contour in the previous
step of the algorithm, and not the point from which the
transition to the active pixel occurred.
      </p>
      <p>
        4) Theo Pavlidi's Algorithm [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] - The main idea of the
algorithm is to use a group of three pixels to determine the
next contour pixel. Verification is carry out by successive
verification of adjacent points with a strictly defined
sequence.
      </p>
      <p>
        5) Snakes algorithm (active contour) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and Amoeba
algorithm [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] are a group of algorithms base on finding
contours by sequencing the image pixels to find the set of
extreme (boundary) pixels. The algorithms stop their work if
all possible pixels are searches or if there are no pixels that
satisfy a certain condition.
      </p>
      <p>
        6) Topological-hierarchical algorithms [
        <xref ref-type="bibr" rid="ref10 ref9">9, 10</xref>
        ] - a group of
algorithms associated with tracking contours based on
hierarchical relations between points. Algorithms of this
group instead of markers use morphometric operations of
finding points of overlap of several circuits for the purpose of
their further separation.
      </p>
      <p>These algorithms are used for analysis and describing the
contour. Almost every programming language has libraries
with implemented algorithms, for example, for Mathlab,
OpenCV etc.</p>
      <p>Their main disadvantage is dependence on the complexity
of the circuit and the stopping criterion. The algorithms are
sensitive to microscopic objects, the contour of which
contains a branch in one pixel thickness. This can lead both
to the false end of the algorithms, and to the incorrect
selection of the contour. A similar problem may occur if the
micro-object consists of two or more parts that are connect
only by single pixels. Another drawback of the algorithms is
the imperfect criteria for stopping (returning to the starting
point, passing a certain point several times), leading to
incorrect work results.</p>
      <p>II. FAST СONTOUR TRACING ALGORITHM</p>
      <p>A binary image with the selected objects is forming as
result of the selection of objects in the images and the
subsequent binarization procedure. These objects are
represent in the form of homogeneous areas. The geometric
characteristics of these areas are important features for the
analysis and perception of the image as a whole. Biological
systems of visual perception, as shown by the research, use
mainly the boundary of the border, rather than the separation
of objects in brightness. In many cases, the most informative
are the characteristics of the boundaries of the regions. To
obtain the coordinates of the contour points, you must
perform the path detection procedure by passing the
boundary of the region.</p>
      <p>
        We introduce the following definitions [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]:
      </p>
      <p>Let Im be a binary digital image with NxM pixels, where
the coordinate of the top-leftmost pixel is (0,0) and that of the
bottom-rightmost pixel is (N - 1, M - 1) . If Im( x, y) = 1 ,
then this point belongs to the object, otherwise - the
background.</p>
      <p>Start pixel Ims ( x, y) is the pixel from which the object
boundary begins to go. The choice of the starting point is
arbitrary, for example, the extreme left-top pixel belonging to
the object. The final pixel Ime ( x, y) is the pixel, upon which
the algorithm ends its operation. Active pixel Ima ( x, y)
pixel located in the middle of the marking grid. Neighboring
pixel Imn ( x, y) is a pixel that borders on the active pixel.
Contour Pixel Imk ( x, y) is a pixel belonging to the object's
contour. Background pixel Im f ( x, y) is a pixel that belongs
to the background image. The neighboring contour
Imkn ( x, y) pixel is a pixel that belongs to the contour of the
object and borders on the active pixel.</p>
      <p>After analyzing the advantages and disadvantages of
existing methods, the following algorithm for contour tracing
has been, develop with the ability to cut off the informational
branches of the object's path, which is represent by a
sequence of steps:</p>
      <p>Start pixel is searching Ims ( x, y) .</p>
      <p>Finding
a
neighboring
contour
pixel
clockwise and a neighboring contour pixel Imkn ( x′, y′)
counterclockwise.</p>
      <p>If the
adjacent
contour
Imkn ( x, y) = Imkn ( x′, y′) , then the
recognize as background Im f ( x, y) and exclude from
further processing and the transition to p. 8 is carried out.</p>
      <p>If the resulting contour pixels do not match
Imkn ( x, y) ≠ Imkn ( x′, y′) , then the start pixel is also
recognize as the endpoint Ims ( x, y) = Ime ( x, y) . The
neighboring contour pixel obtained in step 2 is entered into
an array of contour pixels and assigned to it an active pixel
label Imkn ( x, y) = Ima ( x, y) .</p>
      <p>Imkn ( x, y)
pixels
active</p>
      <p>match
pixel is</p>
      <p>The
next
neighboring
contour
pixel
is
searching Imkn ( x, y) . The sequence of checks of adjacent
contour points is base on a marking grid. Pixels are clockwise
checked. The starting checking position d is determined by
(d '+2) mod 8 , where d ' is the position from which the
active pixel was found Ima ( x, y) . Contour tracing illustrate
on the Fig. 1. The search ends when you find the next contour
pixel or to check all neighboring contour pixels.</p>
      <p>If the neighboring pixel is a contour and does not match
the end pixel, then it is enter into an array of contour pixels
Imkn ( x, y) = Ima ( x, y) and assigned an active pixel tag.</p>
      <p>If an adjacent pixel is found in the previous search steps,
but does not match the end pixel Imkn ( x, y) ≠ Ime ( x, y) ,
then the active pixel is considered to be non-informative,
removed from the array of outline points, indexed as the pixel
of the background. The active pixel status is assign to the
previous contour pixel.</p>
      <p>If the resulting contour pixel coincides with the end pixel
Imkn ( x, y) = Ime ( x, y) and the number of points in the
contour is greater than one, then complete.</p>
      <p>The time of algorithm work can be reduce by the parallel
tracing both clockwise and opposite. In step 3, a parallelism
of verification was perform. The starting point for validation
is calculated as, (d ' '−2) mod 8 , where d ' ' is the position
from which the counterclockwise active pixel was found
Imac ( x, y) .</p>
      <p>When Ima ( x, y) or Imac ( x, y) is found already markup
contour pixel, then a label type check is performed. If the
contour label was, install by them in the previous step, and
then such a pixel is considered to be non-informative. If the
contour mark was, install by the other side, then the contour
is consider to be found.</p>
      <p>To obtain a connected path, the points obtained by moving
against the clock are successively add to the set of contour
points obtained by direct motion.</p>
      <p>In order to evaluate the operation of the contour tracing
algorithm, classify the complexity of the contours of objects
Table I. Simple contours are contours that can be describe
(approximated) using 3 to 10 straight lines. Normal contours
are contours that are approximated by more than 10 straight
lines. Complex contours are described by a array of more
than 10 straight lines, between which there are both sharp and
dull angles. The approximating maximum error value is 2
pixels.</p>
      <p>- The process of the algorithm's operation can be simply
parsed into several streams, which reduces the processing
time of the image. The accuracy of the algorithm results does
not decrease in parallel processing;</p>
      <p>- the possibility of a rollback of work. It should be noted
that the principle of returning the operation of the passage
algorithm has not been used previously. Using the rollback of
work prevents the looping of the algorithm, the rejection of
informational pixels and the possibility of correct work with
complex contours.</p>
      <p>Testing algorithm for correct work will be performed on
digital images with the cytological objects. Cytological
objects have different complexity of contour line, therefore
they are optimally suited for testing. An example of testing is
shown on Fig.2.
3 to 10 straight
lines
more than
10 straight
lines
more than 10 straight</p>
      <p>lines and different
angles between them</p>
      <p>The results of contour tracing algorithms for normal
contour are showing in Table II.
The advantages of this algorithm are:
- work with 8-connected contour;
- Independence from the choice of the start pixel;
- high speed by reducing points for analysis, for example,
in comparison with the "Redial Sweep" algorithm can make
up to 25% (Table II);
informational pixels do not belong to the background of the
image, but remain in the matrix of the outline points with the
appropriate label assignment to them.</p>
      <p>Results of simulation of contour tracing algorithms on the
images chest figures, which including object with normal
contour are showing in Tables III and IV.
Number
of
inspections
976
1356
1473
1289
100%
139%
151%
132%
1089
112%</p>
      <p>The Square Tracing Algorithm was chose as standard
because it is easy to implement and the result of its work is
always productive.</p>
    </sec>
    <sec id="sec-2">
      <title>III. CONCLUSION</title>
      <p>The contour tracing algorithm is allows to discard the less
informative branches for further analysis, since it provides for
a rollback process. However, if it is necessary to obtain a
complete connected contour of object, the possibility of
processing small informative branches is foreseen.</p>
      <p>Obtained connected object contour in the form of a
sequence of points coordinates can be further analyzed. For
example, to reduce the amount of memory for storing the
contour can perform an approximation procedure.
523
523
523
447
100%
77%
77%
77%
65%</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kazlouski; R. K. Sadykhov</surname>
          </string-name>
          ,
          <article-title>"Plain objects detection in image based on a contour tracing algorithm in a binary image", Innovations in Intelligent Systems</article-title>
          and
          <string-name>
            <surname>Applications (INISTA) Proceedings</surname>
          </string-name>
          , 2014 IEEE International Symposium,
          <volume>23</volume>
          -
          <fpage>25</fpage>
          June 2014, DOI: 10.1109/INISTA.
          <year>2014</year>
          .
          <volume>6873624</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>O.</given-names>
            <surname>Berezsky</surname>
          </string-name>
          , G. Melnyk, Yu. Batko,
          <string-name>
            <given-names>O.</given-names>
            <surname>Pitsun</surname>
          </string-name>
          ,
          <article-title>"Regions Matching Algorithms Analysis to Quantify the Image Segmentation Results"</article-title>
          ,
          <source>Proceedings of the 11th International Scientific and Technical Conference CSIT</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>200</fpage>
          -
          <lpage>203</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>William</surname>
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Pratt</surname>
          </string-name>
          ,
          <source>Digital Image Processing: PIKS Inside, Third Edition</source>
          , John Wiley and Sons, Inc., New York. - 2001-736p.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
            <surname>Hlavac</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sonka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Boyle</surname>
          </string-name>
          ,
          <source>Image Processing, Analysis, and Machine Vision</source>
          ,
          <source>International Student Edition. Thomson Learning, part of the Thomson Corporation - 2008 - 829p.</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Rajashekar</surname>
          </string-name>
          ,
          <article-title>"Evaluation of Stopping Criterion in Contour Tracing Algorithms"</article-title>
          (IJCSIT) International
          <source>Journal of Computer Science and Information Technologies</source>
          . - Vol.
          <volume>3</volume>
          (
          <issue>3</issue>
          ). -
          <fpage>2012</fpage>
          . - P.
          <fpage>3888</fpage>
          -
          <lpage>3894</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Pavlidis</surname>
          </string-name>
          ,
          <article-title>Algorithms for Graphics and Image Processing</article-title>
          ,
          <string-name>
            <surname>US</surname>
          </string-name>
          , Rockville, Maryland: Computer Science Press,
          <year>1982</year>
          . - 438 p.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Kass</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Witkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Terzopoulos</surname>
          </string-name>
          ,
          <article-title>Snakes: active contour models</article-title>
          ,
          <source>Int J Comput Vis - 1988</source>
          - pp.
          <fpage>321</fpage>
          -
          <lpage>331</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>G.</given-names>
            <surname>Iannizzotto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Vita</surname>
          </string-name>
          ,
          <article-title>Fast and accurate edge-based segmentation with no contour smoothing in 2-D real images</article-title>
          ,
          <source>IEEE Trans Image Process 9- 2000-1232-1237.</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>P.</given-names>
            <surname>Kuagoolkijgarn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Koomsap</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Chansri</surname>
          </string-name>
          ,
          <article-title>A new algorithm for tracing nests of interconnected contours</article-title>
          ,
          <source>The International Journal of Advanced Manufacturing Technology September</source>
          <year>2010</year>
          , Volume
          <volume>50</volume>
          ,
          <string-name>
            <surname>Issue</surname>
          </string-name>
          5-
          <issue>8</issue>
          , pp
          <fpage>717</fpage>
          -
          <lpage>727</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>P.</given-names>
            <surname>Koomsap</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Chansri</surname>
          </string-name>
          ,
          <article-title>Topological hierarchy-contour tracing algorithm for nests of interconnected contours</article-title>
          ,
          <source>Int J Adv Manuf Technol</source>
          (
          <year>2014</year>
          )
          <volume>70</volume>
          :
          <fpage>1247</fpage>
          -
          <lpage>1266</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Yu. Batko</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <article-title>Berezsky "Algorithm of determination of image contours of biological nature", Proceedings of international conference "Modern problems of radio engineering, telecommunications and computer science"</article-title>
          <source>TCSET</source>
          <year>2006</year>
          ,
          <volume>28</volume>
          February - 4
          <source>March</source>
          <year>2006</year>
          , Lviv, Ukraine. -
          <year>2006</year>
          . - pp.
          <fpage>642</fpage>
          -
          <lpage>644</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>