<!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>
      <journal-title-group>
        <journal-title>C =</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Irregular Ob jects. Shape Detection and Characteristic Sizes</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sergey O. Bochkarev</string-name>
          <email>sergey.bochkarev@urfu.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Igor B. Litus</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Natalia S. Kravchenko</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Scontour</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Nizhny Tagil Institute of Metal Testing</institution>
          ,
          <addr-line>Nizhny Tagil</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ural Federal University</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
      <volume>17</volume>
      <issue>18</issue>
      <fpage>28</fpage>
      <lpage>35</lpage>
      <abstract>
        <p>In this work, results of detecting the objects of irregular form with image analysis are described. The offered algorithm can reduce an irregular object to one of the standard shape, in which it looks like, and choose characteristic sizes of this standard shape, where the object area stays constant. Nizhny Tagil Technological Institute of Ural Federal University carries out investigations of shape detection of irregular plate objects with image analysis. Problem of research includes three subproblems: 1. Find contour of object on a picture. It is considered that the source image is a binary-colored one. Binarization of multicolored images is the subject of another research. The object perimeter and area are formed by using contour. 2. Detect standard shape, in which it looks like. In this work, the following four shapes are examined: circle, rectangle, rhombus, and ellipse. Nevertheless, real objects can have very complex shape. 3. Find characteristic sizes of chosen standard shape, using equation (1). Characteristic sizes are shown in Table 1.</p>
      </abstract>
      <kwd-group>
        <kwd>Computer vision</kwd>
        <kwd>image analysis</kwd>
        <kwd>object search</kwd>
        <kwd>contour search</kwd>
        <kwd>shape detection</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
All standard shapes are convex ones, but real irregular objects can have a lot of
local concavities. So before calculations, a source contour must be smoothed and
perimeter must be decreased to make it closer to perimeter of the standard
form. Real and smoothed contours are shown in Fig. (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ). It can be done by
– circless that characterizes closeness of the contour to a circle; it is calculated
by Eq. (
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
where cir is the circless, Scontour is the area of a contour, Scirle is the area
of enclosing circle that contains this contour; it can be found by method
MinEnclosingCircle [3] in opencv. cir 1 (cir = 1 for the circle);
– compactness [1] is an universal shape criterion; if the contour is close to
the standard shape, their compactnesses are approximataly equal; it is
calculated by Eq. (
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
cir = Scontour;
      </p>
      <p>Scirle
C =</p>
      <p>
        P 2
S
;
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
the GetConvexHull [4] method in opencv. It is interesting to note that
perimeter of the source contour is 6804px, but perimeter of the smoothed contour is
only 3702px.
      </p>
      <p>The coefficient k = Scontour is used to return to real contour in the next</p>
      <p>Shull
calculations. So, characteristic size a of a real contour can be calculated from
ahull
size of the smoothed contour with this coefficient: acontour = p .
k</p>
      <p>Combination of three criteria (rectness, circless, and compactness) does not
allow to detect one of the standard shape uniquely. The next strategy is used:
if rec &gt; 0:8 or cir &gt; 0:8, than contour is counted as a rectangle or a circle
respetively. In other cases, it is neccesary to choose a shape, which compactness
is closest to the smoothed contour compactness.
3</p>
    </sec>
    <sec id="sec-2">
      <title>Compactness of standard shapes</title>
      <p>
        Compactness of standard shapes can be calculated by the following equations:
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(6)
– circle (see Eq. 5)
      </p>
      <p>
        using Eq. (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) as d =
– rhombus (see Eq. 6)
r Scontour
4
This intergal cannot be expressed in terms of elementary functions, so the
following approximation (Eq. 9) of ellipse perimeter with the maximun error
of 0:63% is used. The strcucture of this formula can help to simplify the
following mathematical transformations,
In this case, the ellipse compactness can be calculated by Eq. (10)
      </p>
      <p>4 (C = 4 in the case of a = b, i.e. circle).</p>
      <p>In the cases of rectangle and ellipse, compactness depends on two parameters,
so, characteristic sizes cannot be determined uniquely. But if relation e = b=a
is used, compactness depends on one parameter, and all similar rectangles and
ellipses have the same compactness. Compactness equations are shown on
Table 2.
rectangle compactness C 16 (C = 16 in the case of a = b, i.e. quadrate)
– ellipse perimeter is calculated with elliptic integral [5] (see Eq. 8)
(7)
(8)
(9)</p>
    </sec>
    <sec id="sec-3">
      <title>Characteristic parameters</title>
      <p>
        (12)
(13)
(14)
In the case of circle, characteristic size (d) is calculated uniquely using Eq. (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
with Eq. (11)
d = 1 r Scontour : (11)
      </p>
      <p>2</p>
      <p>In the case of rhombus, characteristic sizes (a, h) are calculated with Eq. (6)
by Eq. (12 and Eq. 13)
a =
r S
sin
=
s S
16=C
=
r S P 2</p>
      <p>S 16
=</p>
      <p>P
4</p>
      <p>;
h = S=a:</p>
      <p>In the cases of rectangle and ellipse, characteristic sizes can be calculated
with well-known area equations S = ab and S = ab respectively. Using the
compactness parameter e = b=a, these equations are transformed to S = a2e and
r S S r S S
S = a2 e, so a = , b = for rectangles, and a = , b = for ellipses. It
e a e a
means that parameters e and S are sufficiant to calculate the characteristic sizes.
In the case of rectangle, e can be expressed with equation in Table 2 by Eq. (14)</p>
      <p>C 8 pC2 16C
e =
8
:</p>
      <p>In the case of rhombus, dependence C(e) is very complex, but this equation
can be solved numerically.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Results of detection</title>
      <p>This algorithm was applied to some real irregular objects. In this section some
examples are introduced. All results have gathered in tables. The first column
contains the original image, image with contour, and detected shape. The
second column represents the calculated data. Bold font marks the base for shape
detection.</p>
      <p>Notations in tables are
– S is the area of contour (smoothed)
– P is the perimeter of contour (smoothed)
– C is the compacntess of contour (smoothed)
– rec is the rectness
– cir is the circless
– Cr is the compacntess of rectangle
– Cc is the compacntess of circle
– Crh is the compacntess of rhombus
– Ce is the compacntess of ellipse
– a, b, h, , d are the characteristic parameters of detected figure
(depending on shape).
5.1</p>
      <p>Generated figures
This subsection contains image analysis of figures drawn upon the graphic
primitives (Table 3). Columns 1,2 present source figures, columns 3,4 present
artificially eroded figures.
This subsection contains image analysis of real figures similar to standard ones
(Table 4).
The given algorithm provides to detecting the standard shape of irregular
object, in which it looks like. Combination of three criteria (rectness, circless, and
compactness) gives good results. Algorithm detects standard shape and
characteristic sizes of it using area equivalence and compactness criterion.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Rick</given-names>
            <surname>Gillman</surname>
          </string-name>
          . Geometry and Gerrymandering, Math Horizons, Vol.
          <volume>10</volume>
          ,
          <issue>1</issue>
          (
          <issue>Sep</issue>
          ,
          <year>2002</year>
          )
          <fpage>10</fpage>
          -
          <lpage>13</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>GetMinAreaRect</given-names>
            <surname>Method</surname>
          </string-name>
          . http://www.emgu.com/wiki/files/1.5.
          <issue>0</issue>
          .0/Help/html/748c1975- 172a
          <string-name>
            <surname>-</surname>
          </string-name>
          9b73
          <string-name>
            <surname>-</surname>
          </string-name>
          a102-cdb695182d68.htm
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>MinEnclosingCircle</given-names>
            <surname>Method</surname>
          </string-name>
          . http://www.emgu.com/wiki/files/2.4.0/document/html/784a59aeb9a2-4eb0
          <string-name>
            <surname>-</surname>
          </string-name>
          b94b-3aed1614e4b0.htm
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Convex hull. http://docs.opencv.
          <source>org/2</source>
          .4/doc/tutorials/imgproc/shapedescriptors/hull/hull.html
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Adlaj</surname>
            ,
            <given-names>Semjon.</given-names>
          </string-name>
          <article-title>An eloquent formula for the perimeter of an ellipse</article-title>
          ,
          <source>Notices of the AMS</source>
          <volume>76</volume>
          (
          <issue>8</issue>
          ):
          <fpage>1094</fpage>
          -
          <lpage>1099</lpage>
          , doi:10.1090/noti879, ISSN 1088-
          <fpage>9477</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>