<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Irregular Objects. Shape Detection and Characteristic Sizes</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Sergey</forename><forename type="middle">O</forename><surname>Bochkarev</surname></persName>
							<email>sergey.bochkarev@urfu.ru</email>
							<affiliation key="aff0">
								<orgName type="institution">Ural Federal University</orgName>
								<address>
									<settlement>Yekaterinburg</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution">Nizhny Tagil Institute of Metal Testing</orgName>
								<address>
									<settlement>Nizhny Tagil</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Igor</forename><forename type="middle">B</forename><surname>Litus</surname></persName>
							<affiliation key="aff1">
								<orgName type="institution">Nizhny Tagil Institute of Metal Testing</orgName>
								<address>
									<settlement>Nizhny Tagil</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Natalia</forename><forename type="middle">S</forename><surname>Kravchenko</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">Ural Federal University</orgName>
								<address>
									<settlement>Yekaterinburg</settlement>
									<country key="RU">Russia</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Irregular Objects. Shape Detection and Characteristic Sizes</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">DD3098FBC082AF247906D13449A4CF89</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T13:10+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Computer vision</term>
					<term>image analysis</term>
					<term>object search</term>
					<term>contour search</term>
					<term>shape detection</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><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.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Nizhny Tagil Technological Institute of Ural Federal University carries out investigations of shape detection of irregular plate objects with image analysis.</p><p>Problem of research includes three subproblems:</p><p>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 <ref type="bibr" target="#b0">(1)</ref>. Characteristic sizes are shown in Table <ref type="table" target="#tab_0">1</ref>.</p><formula xml:id="formula_0">S contour = S shape .<label>(1)</label></formula><p>The opencv library is used to find contour of the object and its characteristics. The following three criteria of contour are used to detect the standard shape:</p><p>rectness that characterizes closeness of contour to rectangle; it is calculated by Eq. 2</p><formula xml:id="formula_1">rec = S contour S rect , (<label>2</label></formula><formula xml:id="formula_2">)</formula><p>where rec is the rectness, S contour is the area of a contour, S rect is the area of minimum rectangle that contains this contour. It can be found by the method GetMinAreaRect <ref type="bibr" target="#b1">[2]</ref> in opencv. rec ≤ 1 (rec = 1 for the rectangle). circless that characterizes closeness of the contour to a circle; it is calculated by Eq. ( <ref type="formula" target="#formula_3">3</ref>)</p><formula xml:id="formula_3">cir = S contour S cirle ,<label>(3)</label></formula><p>where cir is the circless, S contour is the area of a contour, S cirle is the area of enclosing circle that contains this contour; it can be found by method MinEnclosingCircle <ref type="bibr" target="#b2">[3]</ref> in opencv. cir ≤ 1 (cir = 1 for the circle); compactness <ref type="bibr" target="#b0">[1]</ref> is an universal shape criterion; if the contour is close to the standard shape, their compactnesses are approximataly equal; it is calculated by Eq. ( <ref type="formula" target="#formula_4">4</ref>)</p><formula xml:id="formula_4">C = P 2 S ,<label>(4)</label></formula><p>where C is the compactness, P is the perimeter of the contour, S is the area of the contour.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Shape detection</head><p>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. <ref type="bibr" target="#b0">(1)</ref>. It can be done by 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. The coefficient k = S contour S hull is used to return to real contour in the next calculations. So, characteristic size a of a real contour can be calculated from size of the smoothed contour with this coefficient:</p><formula xml:id="formula_5">a contour = a hull √ k .</formula><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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Compactness of standard shapes</head><p>Compactness of standard shapes can be calculated by the following equations:</p><p>circle (see Eq. 5)</p><formula xml:id="formula_6">C = (2πr) 2 πr 2 = 4π;<label>(5)</label></formula><p>the circle compactness is constant; it is minimum possible compactness; in all cases C ≥ 4π. The characteristic parameter (diameter) can be calculated using Eq. ( <ref type="formula" target="#formula_0">1</ref>) as d = S contour 4π ;</p><p>rhombus (see Eq. 6)</p><formula xml:id="formula_7">C = (4a) 2 a 2 sin α = 16 sin(α) ,<label>(6)</label></formula><p>rhombus compactness C ≥ 16 (C = 16 in the case of α = π/2, i.e. quadrate);</p><p>rectangle (see Eq. 7):</p><formula xml:id="formula_8">C = (2(a + b)) 2 ab = 4a 2 + 8ab + 4b 2 ab ,<label>(7)</label></formula><p>rectangle compactness C ≥ 16 (C = 16 in the case of a = b, i.e. quadrate) ellipse perimeter is calculated with elliptic integral <ref type="bibr" target="#b4">[5]</ref> (see Eq. 8)</p><formula xml:id="formula_9">P = π/2 0 1 − e 2 cos 2 tdt.<label>(8)</label></formula><p>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,</p><formula xml:id="formula_10">P ≈ 4 πab + (a − b) 2 a + b . (<label>9</label></formula><formula xml:id="formula_11">)</formula><p>In this case, the ellipse compactness can be calculated by Eq. ( <ref type="formula" target="#formula_12">10</ref>)</p><formula xml:id="formula_12">C = P 2 S = 4πab + (a − b) 2 a + b 2 πab = 16 πab + a 2 − 2ab + b 2 2 πa 3 b + 2πa 2 b 2 + πab 3 . (<label>10</label></formula><formula xml:id="formula_13">)</formula><p>The ellipse compactness C ≥ 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.  In the case of circle, characteristic size (d) is calculated uniquely using Eq. ( <ref type="formula" target="#formula_0">1</ref>) with Eq. ( <ref type="formula" target="#formula_14">11</ref>)</p><formula xml:id="formula_14">d = 1 2 S contour π .<label>(11)</label></formula><p>In the case of rhombus, characteristic sizes (a, h) are calculated with Eq. (6) by Eq. (12 and Eq. 13)</p><formula xml:id="formula_15">a = S sin α = S 16/C = S • P 2 S • 16 = P 4 ,<label>(12)</label></formula><formula xml:id="formula_16">h = S/a.<label>(13)</label></formula><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 = a In the case of rectangle, e can be expressed with equation in Table <ref type="table" target="#tab_1">2</ref> by Eq. ( <ref type="formula" target="#formula_17">14</ref>)</p><formula xml:id="formula_17">e = C − 8 ± √ C 2 − 16C 8 .<label>(14)</label></formula><p>In the case of rhombus, dependence C(e) is very complex, but this equation can be solved numerically.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Results of detection</head><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 -C r is the compacntess of rectangle -C c is the compacntess of circle -C rh is the compacntess of rhombus -C e is the compacntess of ellipse a, b, h, α, d are the characteristic parameters of detected figure (depending on shape).</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. Source and smoothed contour.</figDesc><graphic coords="3,255.80,175.89,103.75,111.78" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>1 2πe 3 + 2πe 2 + πe 4</head><label>134</label><figDesc>axis b-semiminor axis e = b/a-ratio C(e) = 16 (π − 2)e + e 2 + Characteristic parameters</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head></head><label></label><figDesc>2 e and S = a 2 πe, so a = S e , b = S a for rectangles, and a = S πe , b = S πa for ellipses. It means that parameters e and S are sufficiant to calculate the characteristic sizes.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1 .</head><label>1</label><figDesc>Characteristic sizes of standard shapes.</figDesc><table><row><cell>Circle</cell><cell>d-diameter</cell></row><row><cell>Rectangle</cell><cell>a-width b-height</cell></row><row><cell>Rhombus</cell><cell>a-width h-height</cell></row><row><cell>Ellipse</cell><cell>a-semimajor axis b-semiminor axis</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>Table 2 .</head><label>2</label><figDesc>Characteristic parameters of standard forms.</figDesc><table><row><cell cols="3">Shape Characteristic sizes Compactness parameter</cell><cell>Compactness formula</cell></row><row><cell>Circle</cell><cell>d-diameter</cell><cell>-</cell><cell>C = 4π</cell></row></table></figure>
		</body>
		<back>
			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Generated figures</head><p>This subsection contains image analysis of figures drawn upon the graphic primitives (Table <ref type="table">3</ref>). Columns 1,2 present source figures, columns 3,4 present artificially eroded figures.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Real figures similar to standard</head><p>This subsection contains image analysis of real figures similar to standard ones (Table <ref type="table">4</ref>). </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">Irregular figures</head><p>This subsection contains image analysis of real irregular figures (Table <ref type="table">5</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusion</head><p>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></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Geometry and Gerrymandering</title>
		<author>
			<persName><forename type="first">Rick</forename><surname>Gillman</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Math Horizons</title>
		<imprint>
			<biblScope unit="volume">10</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="10" to="13" />
			<date type="published" when="2002-09">Sep, 2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<ptr target="http://www.emgu.com/wiki/files/1.5.0.0/Help/html/748c1975-172a-9b73-a102-cdb695182d68.htm" />
		<title level="m">GetMinAreaRect Method</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<ptr target="http://www.emgu.com/wiki/files/2.4.0/document/html/784a59ae-b9a2-4eb0-b94b-3aed1614e4b0.htm" />
		<title level="m">MinEnclosingCircle Method</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<ptr target="http://docs.opencv.org/2.4/doc/tutorials/imgproc/shapedescriptors/hull/hull.html" />
		<title level="m">Convex hull</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">An eloquent formula for the perimeter of an ellipse</title>
		<author>
			<persName><forename type="first">Semjon</forename><surname>Adlaj</surname></persName>
		</author>
		<idno type="DOI">10.1090/noti879</idno>
	</analytic>
	<monogr>
		<title level="j">Notices of the AMS</title>
		<idno type="ISSN">1088-9477</idno>
		<imprint>
			<biblScope unit="volume">76</biblScope>
			<biblScope unit="issue">8</biblScope>
			<biblScope unit="page" from="1094" to="1099" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
