<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "journalpublishing3.dtd">
<article article-type="research-article" dtd-version="3.0" xml:lang="en" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
	<front>
		<journal-meta>
			<journal-id journal-id-type="publisher-id">SJAR</journal-id>
			<journal-title-group>
				<journal-title>Spanish Journal of Agricultural Research</journal-title>
				<abbrev-journal-title>SJAR</abbrev-journal-title>
			</journal-title-group>
			<issn pub-type="epub">2171-9292</issn>
			<publisher>
				<publisher-name>Instituto Nacional de Investigación y Tecnología Agraria y Alimentaria (INIA)</publisher-name>
			</publisher>
		</journal-meta>
		<article-meta>
			<article-id pub-id-type="publisher-id">6181</article-id>
			<article-id pub-id-type="doi">10.5424/sjar/2015131-6181</article-id>
			<article-categories>
				<subj-group subj-group-type="heading">
					<subject>Research Article</subject>
				</subj-group>
			</article-categories>
			<title-group>
				<article-title>An improved contour symmetry axes extraction algorithm and its application in the location of picking points of apples</article-title>
				<alt-title alt-title-type="running-head">Improved contour symmetry axes extraction algorithm for apples</alt-title>
			</title-group>
			<contrib-group>
			<contrib contrib-type="author" corresp="no">
					<name>
						<surname>Wang</surname>
						<given-names>Dandan</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
				<contrib contrib-type="author" corresp="yes">
					<name>
						<surname>Song</surname>
						<given-names>Huaibo</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
				<contrib contrib-type="author" corresp="no">
					<name>
						<surname>Yu</surname>
						<given-names> Xiuli</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
				<contrib contrib-type="author" corresp="no">
					<name>
						<surname>Zhang</surname>
						<given-names>Weiyuan</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
				<contrib contrib-type="author" corresp="no">
					<name>
						<surname>Qu</surname>
						<given-names>Weifeng</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
				<contrib contrib-type="author" corresp="no">
					<name>
						<surname>Xu</surname>
						<given-names>Yue</given-names>
					</name>
					<aff>College of Mechanical and Electronic Engineering, Northwest A&amp;F University, Yangling, Shaanxi 712100, China</aff>
				</contrib>
			</contrib-group>
			<author-notes>
				<corresp>should be addressed to Huaibo Song: <email xlink:href="songyangfeifei@163.com">songyangfeifei@163.com</email></corresp>
			</author-notes>
			<pub-date pub-type="epub">
				<day>31</day>
				<month>03</month>
				<year>2015</year>
			</pub-date>
			<pub-date pub-type="collection">
				<year>2015</year>
			</pub-date>
			<volume>13</volume>
			<issue>1</issue>
			<elocation-id content-type="doi">10.5424/sjar/2015131-6181</elocation-id>
			<history>
				<date date-type="recibido">
					<day>03</day>
					<month>05</month>
					<year>2014</year>
				</date>
				<date date-type="aceptado">
					<day>12</day>
					<month>02</month>
					<year>2015</year>
				</date>
			</history>
			<permissions>
				<copyright-statement>© 2015 INIA</copyright-statement>
				<copyright-year>2015</copyright-year>
				<license license-type="open-access" xlink:href="http://creativecommons.org/licenses/by-nc/3.0/">
					<license-p>This is an open access article distributed under the Creative Commons Attribution License (CC by 3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
				</license>
			</permissions>
			<abstract>
				<title>Abstract</title>
				<p>The key problem for picking robots is to locate the picking points of fruit. A method based on the moment of inertia and symmetry of apples is proposed in this paper to locate the picking points of apples. Image pre-processing procedures, which are crucial to improving the accuracy of the location, were carried out to remove noise and smooth the edges of apples. The moment of inertia method has the disadvantage of high computational complexity, which should be solved, so convex hull was used to improve this problem. To verify the validity of this algorithm, a test was conducted using four types of apple images containing 107 apple targets. These images were single and unblocked apple images, single and blocked apple images, images containing adjacent apples, and apples in panoramas. The root mean square error values of these four types of apple images were 6.3, 15.0, 21.6 and 18.4, respectively, and the average location errors were 4.9°, 10.2°, 16.3° and 13.8°, respectively. Furthermore, the improved algorithm was effective in terms of average runtime, with 3.7 ms and 9.2 ms for single and unblocked and single and blocked apple images, respectively. For the other two types of apple images, the runtime was determined by the number of apples and blocked apples contained in the images. The results showed that the improved algorithm could extract symmetry axes and locate the picking points of apples more efficiently. In conclusion, the improved algorithm is feasible for extracting symmetry axes and locating the picking points of apples.</p>
				</abstract>
			<kwd-group>
				<title>Additional key words</title>
				<kwd>picking robot</kwd>
				<kwd>fruit picking point</kwd>
				<kwd>symmetry axes extraction</kwd>
				<kwd>moment of inertia</kwd>
				<kwd>convex hull</kwd>
			</kwd-group>
			<kwd-group>
				<title>Abbreviations used</title>
				<kwd>CCD (charge coupled device)</kwd>
				<kwd>CIE (Commission Internationale d’Eclairage)</kwd>
				<kwd>HSI (Hue-Saturation-Intensity)</kwd>
				<kwd>RMSE (root mean square error)</kwd>
				<kwd>ULR (unitary linear regression)</kwd>
				<kwd>YIQ (Y represents brightness, I color changes from orange to cyan, and Q color changes from purple to kelly)</kwd>
			</kwd-group>
			<funding-group>
			<funding-statement>This work was supported by the National High Technology Research and Development Program of China (863 Program) (No.2013AA10230402); Natural Science Basic Research Plan in Shaanxi Province of China (No. 2014JQ3094); “National Natural Science Foundation” of China (No. 31000670); and the “Fundamental Research Funds for the Central Universities” of China (No. QN2011031).</funding-statement>
			</funding-group>
		    </article-meta>
		<notes>
		<p>This work has two supplementary tables and four supplementary figures that do not appear in the printed article but that accompany the paper online.</p>
		<p><bold>Competing interests:</bold> The authors have declared that no competing interests exist</p>
		</notes>
	</front>
	<body>
		<sec id="S1">
			<title>Introduction</title>
			<p>The fruit picking robot is one of the main research directions of modern agricultural development. The key problem is how to realize the goal of identification and localization of fruit through accurate use of machine vision technology. Under natural conditions, fruit have different growth postures due to different soil, seasons and weather conditions, which have strong impacts on locating the picking points of apples and the follow-up picking tasks.</p>
		<p>Several studies have been carried out to locate fruit under natural conditions (<xref ref-type="bibr" rid="CIT0011">Plebe <italic>&amp; </italic>Grasso, 2001</xref>; <xref ref-type="bibr" rid="CIT0002">Bulanon <italic>et al</italic>., 2004</xref>; <xref ref-type="bibr" rid="CIT0003">Chinchuluun <italic>et al</italic>., 2006</xref>; <xref ref-type="bibr" rid="CIT0006">Guo <italic>et al</italic>., 2008</xref>; <xref ref-type="bibr" rid="CIT0021">Yin <italic>et al</italic>., 2009</xref>; <xref ref-type="bibr" rid="CIT0012">Rajneesh <italic>et al</italic>., 2013</xref>). A computer vision-based method was presented by <xref ref-type="bibr" rid="CIT0007">Jiménez <italic>et al</italic>. (2000)</xref> to locate fruit on trees. Special attention was paid to CCD (charge coupled device) sensors and accessories, which were utilized for capturing tree images, and image processing strategies, such as local and shape-based analysis, were used to detect fruit and then locate them. Local analysis allowed for rapid detection and was only able to detect fruit at specific maturity stages. Shape analysis was capable of detecting fruit of any color, but it was time consuming. A method based on binocular stereovision was utilized to locate tomatoes by <xref ref-type="bibr" rid="CIT0018">Xiang <italic>et al</italic>. (2010)</xref>. To improve the precision of depth measurement for ripe tomatoes, two stereo matching methods, centroid-based matching and area-based matching, were analyzed comparatively in their paper. Their performances in depth measurement were also compared. Then, models of ULR (unitary linear regression) were used to improve the results of depth measurement. A cherry-harvesting robot was manufactured by <xref ref-type="bibr" rid="CIT0017">Tanigaki <italic>et al</italic>. (2008)</xref>. The vision system of the robot was a 3D vision sensor equipped with red and infrared laser diodes. Both laser beams scan the object simultaneously. By processing the images from the 3D vision sensor, the locations of cherries and obstacles were recognized. However, the end effector of the robot should be improved according to the result of field evaluation, as cherries can be damaged easily. <xref ref-type="bibr" rid="CIT0001">Arefi <italic>et al</italic>. (2011)</xref> proposed a machine vision-based method to recognize and locate ripen tomatoes. In Arefi’s paper, an R-G chromatic aberration image was defined to remove the background in the RGB color space. After extracting ripe tomatoes using a combination of RGB, HSI (Hue-Saturation-Intensity) and YIQ (Y represents brightness, I represents color changes from orange to cyan, and Q represents color changes from purple to kelly) color spaces, morphological features of the image were used to locate the ripe tomatoes; experimental results showed that the total recognition accuracy of the algorithm was 96.36%. A method based on convex hull (the convex hull is the minimum circumscribed polygons of a target; it is the smallest convex set that contains all of the objects in a set, and the vertexes must be in the point set) was proposed to locate occluded apples (<xref ref-type="bibr" rid="CIT0015">Song <italic>et al</italic>., 2012</xref>). In Song’s paper, the convex hull of the contour was used to extract the smooth and real contours, and the extracted contours were utilized to estimate the centers and radii, which were used to localize occluded apples. The average positioning error using the method was 4.28%. However, because apples are not idealistically round targets, the location result would be influenced by candidate points, which were used to estimate centers and radii of apples. <xref ref-type="bibr" rid="CIT0019">Xie <italic>et al</italic>. (2012)</xref> described four methods: the least distance, least slope variance, three collinear points and second-order central moment methods. A fusion of the four methods could reach recognition rates up to 90%. However, each of the four methods had its disadvantages, and the fusion of the four methods was time consuming.</p>
		<p>As seen from the literature above, these methods have some unsolved disadvantages, such as low accuracy rate, highly time consuming, complexity of the operating process, etc. These disadvantages, to some extent, restrict the real-time capability of the apple harvesting robot in natural scenes. Thus, a new method should be proposed to solve these problems.</p>
		<p>Symmetry axes detection of a 2D point set based on convex hull was presented by <xref ref-type="bibr" rid="CIT0022">Zhang<italic> et al</italic>. (2010)</xref>. After extracting the convex hull of the point set, the symmetry axes can be found through seeking the symmetry axes of the convex hull. A symmetry axis detection method based on the minimal value of the moment of inertia was proposed to extract the symmetry axis of gray images (<xref ref-type="bibr" rid="CIT0009">Liang <italic>et al</italic>., 2009</xref>). The literature above gives an idea that the symmetry axes of the convex hull of an apple can be extracted to locate the apple target due to the good symmetry characteristics of apples.</p>
		<p>Based on the descriptions above, this paper will try to describe a convex hull theory and contour symmetry axes extraction algorithm-based method to locate the picking points of apples. Firstly, the image is transformed from RGB color space to L*a*b* color space, and then the K-means color clustering algorithm is used to detect apples. Secondly, to weaken the influence of noise on the extraction of symmetry axes, image pre-processing algorithms, including mathematical morphology and noise removal, are carried out to remove noise and smooth the edges of the apples. Then the convex hull is used to replace the apple’s contour, which is useful to decrease the computational complexity. Finally, a moment of inertia algorithm is utilized to extract the symmetry axes of apples, which are used to realize the purpose of locating the picking points of apples accurately.</p>
		</sec>
		<sec id="S2">
			<title>Material and methods</title>
			<sec id="S2.1">
				<title>Hardware and software</title>
				<p>A personal computer with a 2.60 GHz processor and 4.0 GB of RAM was used as the hardware component of the computer vision system, and all algorithms were developed in MATLAB vers. R2013a. A digital camera (Fuji film A900, CMOS color camera) was selected, and the shooting distance was approximately 1.5 m. Our research will focus on the ‘Fuji’ apple (<italic>Malus domestica</italic>), which is the most popular apple species in China. Images used in the experiment were collected from September 2011 to September 2014 at Standard Rootstocks Density Planting Orchard at Northwest A&amp;F University. All of the images were acquired under natural daylight conditions in the RGB color model. Image frames were 1600×1200 pixels in JPEG format. In this study, 30 single and unblocked apple images, 20 single and blocked apple images, 5 images containing adjacent apples and 6 panoramas containing 45 apples were selected to test the performance of the presented algorithm.</p>
			</sec>
			<sec id="S2.2">
				<title>Picking point of an apple target</title>
				<p>The picking point is located on the peduncle of an apple, and it is one of the intersections of the symmetry axes and the contour of the apple. The intersection near the peduncle of the apple is the picking point. Searching for the picking point of an apple target is one of the most important tasks for the apple picking robot. After detection of the picking point, the robot can drive the end effector to cut the peduncle at the picking point and then fulfill the picking task for the apple. Through this manner of shearing, damage and decay of apples can be effectively decreased during storage processes and transportation, thus reducing loss effectively. The picking point, convex hull, and contour of an apple are shown in <xref ref-type="fig" rid="F0001">Fig. 1</xref>.</p>
				<fig id="F0001">
					<label>Figure 1.</label>
					<caption>
						<title>Schematic of the picking point, contour and convex hull of an apple. The black curve is the contour of the apple, the convex hull of the apple is represented by the blue curve, and the cyan “&#8709;” is the picking point of the apple.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f01.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
			</sec>
			<sec id="S2.3">
				<title>Apple contour extraction</title>
				<p>Apple contour extraction is one of the most important steps in locating apple targets. To extract the contours of apples accurately, the K-means clustering algorithm was used to extract the regions of apples, and then the vertexes of the convex hull of each apple were extracted, which were used to replace the contour points of each apple and were useful for improving the operation speed.</p>
		<p>
			<bold><italic>L*a*b* color space. </italic></bold>An appropriate color space is the basis of image segmentation. There is a strong correlation between each component in the commonly used RGB color space (<xref ref-type="bibr" rid="CIT0010">Luo <italic>et al</italic>., 2000</xref>), which makes it difficult to determine the hue and saturation information of pixels through the components of R, G and B. The L*a*b* color space is a color model specified in CIE (Commission Internationale d’Eclairage). Any color can be expressed in the L*a*b* color space. The L*a*b* color space is a color-opponent space with dimension L* for brightness, a* for the range from red to blue, and b* for the range from blue to yellow, based on nonlinearly compressed CIE XYZ color space coordinates (<xref ref-type="bibr" rid="CIT0021">Yin <italic>et al</italic>., 2009</xref>). Thus, to distinguish apple targets from the background automatically, it is necessary to transform the image from the RGB color space to the L*a*b* color space before clustering.</p>
		<p>There are no simple formulas for conversion between RGB and L*a*b*. The L*a*b* color space is based on the XYZ color space. Thus, RGB should be converted to the XYZ color space first and then transformed into the L*a*b* color space. The formulas that transform the RGB color space into the XYZ color space can be expressed as,</p>	
		<graphic xlink:href="sjar_e02_005_form1.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
		<p>The formulas that transform the XYZ color space into the L*a*b* color space are as follows,</p>
		<graphic xlink:href="sjar_e02_005_form2.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
		<p>where the function is,</p>
		<graphic xlink:href="sjar_e02_005_form3.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
		<p>The K-means clustering algorithm can be employed to cluster the apple images into several different classifications based on the a* and b* color components, regardless of the brightness.</p>
		<p>
			<bold><italic>Target segmentation by the K-means clustering algorithm. </italic></bold>The K-means clustering algorithm is a partitioning algorithm of the feature space and has been widely used in image segmentation fields (<xref ref-type="bibr" rid="CIT0013">Rekik <italic>et al</italic>., 2006</xref>; <xref ref-type="bibr" rid="CIT0020">Yao <italic>et al</italic>., 2013</xref>). The K-means algorithm has many advantages, such as its simple description, high efficiency and suitability for large-scale data processing, which make it more suitable to segment images in this work.</p>
		<p>The K-means algorithm is an unsupervised learning algorithm that groups data objects into several clusters to obtain the highest similarity between objects in the same cluster but the minimum similarity between objects in different clusters. That is, single pieces of data are segmented into specified clusters through iterative search (<xref ref-type="bibr" rid="CIT0008">Jim <italic>et al</italic>., 2008</xref>).</p>
		<p>The K-means clustering algorithm is described as follows,</p>
		<list list-type="disc">
			<list-item>
				<p><bold><italic>Step 1: </italic></bold>Select <italic>k</italic> initial clustering centers, <bold><italic>Z</italic></bold>
			<sub>1</sub>(1), <bold><italic>Z</italic></bold>
			<sub>2</sub>(1), …, <bold><italic>Z</italic></bold>
			<sub><italic>k</italic></sub>(1), where <italic>k</italic> is the number of clusters.</p>
			</list-item>
			<list-item>
				<p><bold><italic>Step 2: </italic></bold>After <italic>n</italic> iterations, the sample set {<bold><italic>Z</italic></bold>} is classified in the following way: for all <italic>i</italic>, <italic>j </italic>= 1, 2, …<italic>k</italic>, <italic>i </italic>≠ <italic>j</italic>, if ||<bold><italic>Z</italic></bold>-<bold><italic>Z</italic></bold>
			<sub><italic>j</italic></sub>(<italic>n</italic>)||&lt;||<bold><italic>Z</italic></bold>-<bold><italic>Z</italic></bold>
			<sub><italic>i</italic></sub>(<italic>n</italic>)||, then <bold><italic>Z</italic></bold>&#x2208;<bold><italic>S</italic></bold>
			<sub><italic>j</italic></sub>(<italic>n</italic>).</p>
			</list-item>
			<list-item>
				<p><bold><italic>Step 3: </italic></bold>Obtain a new class center <bold><italic>Z</italic></bold>
			<sub><italic>j</italic></sub>(<italic>n</italic> + 1) through <italic>Step 2</italic> to minimize <inline-graphic xlink:href="sjar_e02_005_form3a.jpg"/>.</p>
			</list-item>
			<list-item>
				<p><bold><italic>Step 4: </italic></bold>For all<italic> j </italic>= 1, 2, …, <italic>k</italic>, if <bold><italic>Z</italic></bold>
			<sub><italic>j</italic></sub>(<italic>n </italic>+ 1) = <bold><italic>Z</italic></bold>
			<sub><italic>j</italic></sub>(<italic>n</italic>), end the iteration; otherwise, <italic>n </italic>= <italic>n </italic>+ 1 and go to <italic>Step 2</italic> and continue.</p>
			</list-item>
		</list>
		<p>For the K-means clustering algorithm, the parameter <italic>k </italic>must be determined first. When we chose <italic>k </italic>= 2, the image was divided into two classes: the fruit and the background. When we chose <italic>k </italic>= 3, the image was divided into three classes: the fruit, the branches and the leaves. In this paper, the main task was to locate the picking points of apples, so we chose <italic>k </italic>= 2, resulting in branches and leaves being classified as the background. To ensure the accuracy of clustering, the morphological opening operation of the original color image was performed first, and a ‘disk’-shaped structure element with a specified radius of 5 was used before clustering to ensure the data information consistency in a small area and to make the image smoother. The opening operation would inevitably fill the gaps between objects and increase the apple size. Select small structure elements and appropriate structure shapes could weaken the effect of these problems, and such operations will not affect the subsequent process.</p>
		<p>The results of K-means clustering are shown in <xref ref-type="fig" rid="F0002">Fig. 2</xref> (<italic>k </italic>= 3) and <xref ref-type="fig" rid="F0003">Fig. 3</xref> (<italic>k </italic>= 2). Specifically, from <xref ref-type="fig" rid="F0002">Fig. 2</xref>, we can see that when we choose <italic>k </italic>= 3, the image can be clustered into three classes, that is, fruit, branches and leaves. <xref ref-type="fig" rid="F0003">Fig. 3a</xref>, which is the original color image, shows that the contours on the left and right parts of the target were smooth and symmetrical and that the apple’s symmetry axes lied on the line between the apple’s peduncle and calyx; <xref ref-type="fig" rid="F0003">Fig. 3b</xref>, the result of clustering from <xref ref-type="fig" rid="F0003">Fig. 3a</xref>, could be used for image segmentation; <xref ref-type="fig" rid="F0003">Fig. 3c</xref> is the gray image of <xref ref-type="fig" rid="F0003">Fig. 3b</xref>; <xref ref-type="fig" rid="F0003">Fig. 3d</xref> is the binary image of <xref ref-type="fig" rid="F0003">Fig. 3c</xref>, and it contains noise, such as holes and spurs, which would affect the accuracy of extraction of the symmetry axes. Therefore, further processing was needed before the image could be used to extract the symmetry axes of apples.</p>
		<fig id="F0002">
					<label>Figure 2.</label>
					<caption>
						<title>Result of the K-means algorithm when choosing the cluster parameter as<italic> k </italic>= 3. <bold>(a)</bold> Original digital image captured in natural daylight conditions. <bold>(b) </bold>Image of branches. <bold>(c)</bold> Image of leaves. <bold>(d)</bold> Extracted apple image.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f02.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
	<fig id="F0003">
					<label>Figure 3.</label>
					<caption>
						<title>Result of the K-means algorithm when choosing the cluster parameter as<italic> k </italic>= 2. <bold>(a)</bold> Original digital image captured in natural daylight conditions. <bold>(b)</bold> Extracted apple image after the K-means clustering algorithm with<italic> k </italic>= 2. (c) Gray image of the extracted apple. <bold>(d)</bold> Binary image of the extracted apple.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f03.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
		<p>
			<bold><italic>Pre-processing of clustered apple targets.</italic></bold> Compared with the real apple contour, the obtained contour was not smooth enough, and this might affect the precision in identifying the symmetry axes of apples. To solve the problem, pre-processing measures, including hole filling and noise removal, were performed. <xref ref-type="fig" rid="F0004">Fig. 4a</xref> shows that the pre-processed image still contained spurs, which could be further removed by performing a morphological opening operation with a ‘disk’-shaped structural element with a radius of 30. As a result, the processed image (<xref ref-type="fig" rid="F0004">Fig. 4b</xref>) showed no spurs and the contour became smoother, which was helpful in improving the accuracy of the extraction of apples´ symmetry axes.</p>
			<fig id="F0004">
					<label>Figure 4.</label>
					<caption>
						<title>Pre-processing result of the apple image after the K-means algorithm. <bold>(a)</bold> Pre-process the apple image via procedures such as hole filling and removing noise. <bold>(b) </bold>Smooth the edge of the counter using a mathematical morphology open operation with a flat ‘disk’-shaped structuring element with the specified radius = 30.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f04.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
		<p>
			<bold><italic>Convex hull-based method of identifying apple contours. </italic></bold>The method of replacing contour points with the convex hull has a number of advantages, including reducing the number of edge points, simplifying the complexity of the original algorithm and shortening the operation time. Thus, the convex hull is used to replace the contour of an apple. A classical volume package convex hull extraction algorithm (<xref ref-type="bibr" rid="CIT0023">Zhou <italic>et al.</italic>, 2008</xref>) was adopted in this work.</p>
		<p><xref ref-type="fig" rid="F0005">Fig. 5a</xref> shows the contour extracted from <xref ref-type="fig" rid="F0004">Fig. 4b</xref> using the volume package convex hull method, while <xref ref-type="fig" rid="F0005">Fig. 5b</xref> was derived from <xref ref-type="fig" rid="F0003">Fig. 3d</xref> using a canny boundary operator. The contour in <xref ref-type="fig" rid="F0005">Fig. 5b</xref> shows rough edges when compared with that in <xref ref-type="fig" rid="F0005">Fig. 5a</xref>. In addition, the convex hull of the apple target was almost the same as the real apple and was smoother than the contour extracted in <xref ref-type="fig" rid="F0005">Fig. 5b</xref> when the convex hull was added to its original color (<xref ref-type="fig" rid="F0005">Fig. 5c</xref>). Taken together, it was feasible to replace the contour of the apple with its convex hull.</p>
		<fig id="F0005">
					<label>Figure 5.</label>
					<caption>
						<title>Comparison of the convex hull and contour of an apple. <bold>(a)</bold> Convex hull of the apple. <bold>(b)</bold> Edge of the apple extracted using the canny algorithm. <bold>(c)</bold> Convex hull of the apple illustrated in the original image.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f05.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
		<p>The number of peripheral points in <xref ref-type="fig" rid="F0005">Fig. 5a</xref> using the improved algorithm was only 398, whereas the original contour of the apple in <xref ref-type="fig" rid="F0005">Fig. 5b</xref> consisted of 2412 peripheral points. Using the convex hull instead of the contour of the apple offers an improvement in algorithmic complexity as well as computational efficiency.</p>
			</sec>
			<sec id="S2.4">
				<label></label>
				<title>Location of an apple’s picking point</title>
				<p>Based on the good symmetry characteristics of apples, the symmetry axes of apples can be identified as a way to locate apple targets. There are many algorithms for target symmetry axes extraction, such as the Euclidean distance algorithm (<xref ref-type="bibr" rid="CIT0014">Remy &amp; Thiel, 2005</xref>), neural network algorithm (<xref ref-type="bibr" rid="CIT0004">Fukushima &amp; Kikuchi, 2006</xref>), minimal inertia algorithm (<xref ref-type="bibr" rid="CIT0005">Gong <italic>et al.</italic>, 2001</xref>), etc. Among these, both the Euclidean distance algorithm and neural network algorithm are more applicable to complex images and are more complicated with regard to image processing, while the moment of inertia method has the characteristic of a simple operation. Therefore, the moment of inertia algorithm was adopted to achieve the symmetry axes extraction in this paper.</p>
		<p>
			<bold><italic>Moment of inertia algorithm. </italic></bold>The moment of inertia algorithm can detect the symmetry axes of images quickly and accurately (<xref ref-type="bibr" rid="CIT0009">Liang <italic>et al</italic>., 2009</xref>). The symmetry axes of an image are the lines when the moment of inertia reaches its extreme values. This is the theoretical basis of the moment of inertia algorithm.</p>
		<p>The moment of inertia of the curve <italic>y</italic> = <italic>f</italic> (<italic>x</italic>) relative to the axis <italic>y</italic>
			<sub>1</sub> = <italic>ax</italic> + <italic>b</italic> is defined as (assuming that <italic>y</italic> =<italic> f</italic> (<italic>x</italic>) is continuously differentiable on [- <italic>c</italic>, <italic>c</italic>]) (<xref ref-type="bibr" rid="CIT0005">Gong <italic>et al.</italic>, 2001</xref>):</p>
			<graphic xlink:href="sjar_e02_005_form4.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>Specifically, <italic>μ</italic> is the linear density. If the mass distribution is uniform, then <italic>μ</italic> is a constant. <italic>D</italic> (<italic>x</italic>) is the distance between a point (<italic>x</italic>, <italic>f</italic> (<italic>x</italic>)) on the curve <italic>y</italic> = <italic>f</italic> (<italic>x</italic>) and the straight line <italic>y</italic>
			<sub>1</sub> = <italic>ax</italic> +<italic> b</italic>; <italic>D</italic> (<italic>x</italic>) is defined as:</p>
			<graphic xlink:href="sjar_e02_005_form5.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>Assuming that the function<italic> y</italic> =<italic> f</italic> (<italic>x</italic>) is axis symmetric, that is, <italic>f</italic> (-<italic>x</italic>) =<italic> f</italic> (<italic>x</italic>), then by setting the rotation axis:</p>
			<graphic xlink:href="sjar_e02_005_form6.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>or:</p>
			<graphic xlink:href="sjar_e02_005_form7.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>Two extreme values of the moment of inertia can be obtained. The line is a symmetry axis if it makes the moment of inertia reach one of its extreme values (maximum value or minimum value, depending on the shape of the curve); the line that reaches another extreme value (minimum value or maximum value) of the moment of inertia is perpendicular to the symmetry axis of the curve.</p>
		<p>Because the moment of inertia is invariant with shifts and rotations of the coordinate axis, the extraction of symmetry axes of any symmetrical curve in any placement can be realized by locating the line when the corresponding moment of inertia reaches its extreme value. As shown in <xref ref-type="fig" rid="F0006">Fig. 6</xref>, the dashed line <italic>l </italic>is the symmetry axis. The selection of coordinate axes has no effect on the moment of inertia, so the accuracy of the extreme value has nothing to do with the symmetry axes. In this respect, the moment of inertia algorithm is accurate and stable in the extraction of the symmetry axes.</p>
		<fig id="F0006">
					<label>Figure 6.</label>
					<caption>
						<title>Symmetry axes of the symmetrical curve in any placement.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f06.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
		<p>
			<bold><italic>Apple target symmetry axes extraction. </italic></bold>According to the theory of the above-mentioned moment of inertia algorithm, the symmetry axes and picking points (marked with a cyan color “&#8709;”)  of the apple targets are indicated in <xref ref-type="fig" rid="F0007">Fig. 7</xref>. As observed from <xref ref-type="fig" rid="F0007">Fig. 7</xref>, we obtained symmetry axes of the apple targets that varied between apple varieties and light conditions, and the other line was vertical to the symmetry axes. For these two lines, which one is the symmetry axis of an apple should be determined by the variety of the apple. The picking points were basically the two points of the apple peduncle and the apple calyx, and the extracted symmetry axis was nearly the same as the real symmetry axes of the apple target. Thus, the method presented in this paper can extract the symmetry axes of apples and locate the picking points well.</p>
			<fig id="F0007">
					<label>Figure 7.</label>
					<caption>
						<title>Location of the apple by extracting the symmetry axis and picking point (picking points marked with cyan“&#8709;”).</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f07.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
			</sec>
		</sec>
		<sec id="S3">
			<title>Results</title>
			<p>To verify the validity of the improved contour symmetry axes method presented in this paper, four types of images containing 107 apple targets were used to conduct the experiment. The test was run on 30 single and unblocked apple images, 20 single and blocked apple images, 5 images containing 12 adjacent apples and 45 apples captured in 6 panoramas. The performances of the proposed methods of the first two types of images were compared to those of the unimproved method and the method of principal inertia axis (<xref ref-type="bibr" rid="CIT0006">Guo <italic>et al</italic>., 2008</xref>). The unimproved method is a method using the apple contour extracted by the canny algorithm without a pre-processing measure to extract symmetry axes. The method of principal inertia axis (PIA method) is a method utilizing the extracted principal inertia axis of an apple to locate the apple target. The direction of the principal inertia axis can be expressed as <xref ref-type="disp-formula" rid="form0008">[8]</xref> (<xref ref-type="bibr" rid="CIT0006">Guo <italic>et al</italic>., 2008</xref>),</p>
			<graphic id="form0008" xlink:href="sjar_e02_005_form8.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>where <italic>θ</italic> is the orientation angle of the principal inertia axis and <italic>m</italic>
			<sub>11</sub>, <italic>m</italic>
			<sub>20</sub>, <italic>m</italic>
			<sub>02</sub> are two-order center moments of the binary image. They can be calculated by Eq. <xref ref-type="disp-formula" rid="form0009">[9]</xref>,</p>
			<graphic id="form0009" xlink:href="sjar_e02_005_form9.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>where <italic>f </italic>(<italic>i</italic>, <italic>j</italic>) is the binary image and <italic>m</italic>, <italic>n</italic> are the height and width of the image, respectively.  are coordinates of the centroid, which can be calculated by formula <xref ref-type="disp-formula" rid="form0010">[10]</xref>,</p>
			<graphic id="form0010" xlink:href="sjar_e02_005_form10.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
			<p>From the equation above, <italic>θ</italic> can be calculated, and then the principal inertia axis can be obtained, which is used to locate apples.</p>
		<p>The location results of the last two types of apple images were not compared to the unimproved method and PIA method. There were many apple targets in the images, and some adjacent apples occluded severely, which resulted in the real contour of the apple being unable to be extracted for the follow-up experiment.</p>
		<p>The locations of real symmetry axes were found through observation, and the location errors were the angles between the obtained symmetry axes and the real symmetry axes. Here, we assumed the angle of the real symmetry axes was <italic>α</italic>, the angle of the obtained symmetry axes was <italic>β</italic>,<italic> </italic>and the location error was <italic>γ</italic>, so the formula of the location error was as follows:</p>
		<graphic id="form0011" xlink:href="sjar_e02_005_form11.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
		<p>RMSE (root mean square error) was used in this paper to measure the performance of the method proposed. RMSE can be used to judge the deviations between the true value and the value obtained from the test. The picking point is on the symmetry axes of the apple, so the location error of the picking point is the location error of the symmetry axes of the apple. The picking point is one of the intersections of the symmetry axes and the contour of the apple. In this paper, the convex hull was used to replace the contour. Thus, the picking point is defined as one of the intersections of the symmetry axes and the convex hull, and it should be determined by the variety of the apple.</p>
		<sec id="S3.1">
			<title>Location results of single and unblocked apple targets</title>
			<p>For 30 single and unblocked apple images, the processing step was relatively easy. The main procedures of the experiment were as follows,</p>
			<list list-type="disc">
				<list-item>
					<p><bold><italic>Step 1:</italic></bold> Transform the original image from the RGB color space to the L*a*b* color space, and then cluster the apple image using the K-means clustering algorithm.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 2:</italic></bold> Binarize the clustered apple image.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 3: </italic></bold>Extract the symmetry axes using the moment of inertia algorithm to test the effectiveness of the unimproved method.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 4: </italic></bold>Pre-process the binary image, such as by a mathematical morphological operation and/or noise removal.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 5:</italic></bold> Extract the principal inertia axis to locate the apple and test the performance of the PIA method.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 6:</italic></bold> Extract the convex hull of the apple, replace the apple contour with it and identify the apple symmetry axes using the moment of inertia algorithm to test the effectiveness of the improved method presented in this paper.</p>
				</list-item>
<list-item>
					<p><bold><italic>Step 7:</italic></bold> Compare the performances of the methods from <italic>Steps 3, 5 </italic>and <italic>6</italic>, and calculate the location error according to formula <xref ref-type="disp-formula" rid="form0011">[11]</xref>.</p>
				</list-item>
			</list>
			<p>The location results of apple targets are shown in <xref ref-type="fig" rid="F0008">Fig. 8</xref>. Detailed results of the location, location errors and running time of 30 images are given in <xref ref-type="table" rid="T0001">
Table 1</xref>. From <xref ref-type="fig" rid="F0008">Fig. 8</xref>, we can see that the contours of the binary images in <xref ref-type="fig" rid="F0008">Figs. 8e-h</xref> were not smooth enough. In stark contrast, the images in <xref ref-type="fig" rid="F0008">Figs. 8i-l</xref> pre-processed with the improved algorithm presented in this paper were smoother in contour, which could enhance the precision of locating the symmetry axes of the apple targets. Moreover, the apple symmetry axes obtained using the improved method in <xref ref-type="fig" rid="F0008">Figs. 8m-p</xref> were basically in agreement with the real symmetry axes. Additionally, the picking points marked with the cyan “&#8709;” in <xref ref-type="fig" rid="F0008">Figs. 8m-p</xref> were basically correct. As clearly shown in <xref ref-type="table" rid="T0001">Table 1</xref>, the smallest location error was 0.0° using the newly presented method, and the average location error was 4.9°. The average run time was 3.7 ms, and the RMSE of the method was 6.3. However, among all of the test images in <xref ref-type="table" rid="T0001">Table 1</xref>, some apple targets (3, 4 and 7) were not accurate enough in location when performing the presented method. The location results are shown in <xref ref-type="fig" rid="F0009">Fig. 9</xref>. Among the three apples, the largest location error was 14.7°.</p>
			<fig id="F0008">
					<label>Figure 8.</label>
					<caption>
						<title>Location results of single and unblocked apples: <bold>(a, b, c, d)</bold> original digital images captured in natural daylight conditions; <bold>(e, f, g, h)</bold> binary images after being processed with the K-means clustering algorithm; <bold>(i, j, k, l)</bold> pre-processing results of the binary images; <bold>(m, n, o, p)</bold> location of apple targets using the method proposed in this paper (picking points marked with cyan “&#8709;”); <bold>(q, r, s, t)</bold> location of apple targets using the unimproved method; <bold>(u, v, w, x)</bold> location results of apples using the PIA method.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f08.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
	<fig id="F0009">
					<label>Figure 9.</label>
					<caption>
						<title>Location of single and unblocked apple targets with larger errors: <bold>(a, b, c)</bold> original digital images captured in natural daylight condition; <bold>(d, e, f)</bold> results of the K-means algorithm;<bold> (g, h, i)</bold> result of binary images after pre-processing; <bold>(j, k, l) </bold>location of apple targets by using method presented in this paper (picking points marked with cyan “&#8709;”); <bold>(m, n, o) </bold>location results after processed with unimproved method;<bold> (p, q, r) </bold>location results of apples using PIA method.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f02.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
	<table-wrap id="T0001">
		<label>Table 1.</label>
		<caption>
		<title>Location results of 30 single and unblocked apple images using the method described in this work.</title>
		</caption>
		<graphic xlink:href="sjar_e02_005_t01.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</table-wrap>
		</sec>
		<sec id="S3.2">
			<title>Location results of single and blocked apple targets</title>
			<p>In natural scenes, the localization of apples is always influenced by being blocked by branches and leaves, light intensity, shadows on the surface of apples and the ripeness of apples. Twenty single and blocked apple targets containing these four situations were selected to conduct the experiment. The main procedures were the same as above. The results of the location of single and blocked apples are shown in <xref ref-type="table" rid="T0002">Table 2</xref>. Specifically, targets 1-12 were apples blocked by branches and leaves. Targets 13-15 were apples with shadows on their surfaces. Targets 16-18 were apples influenced by their maturity. Targets 19-20 were apples affected by light intensity. Some location results are shown in Suppl. Figs. S1 and S2 [pdfs online]. The apples were: blocked by leaves (Suppl. Fig. S1a-b), influenced by shadows and light intensity (Suppl. Fig. S1c), and affected by their maturity and light intensity (Suppl. Fig. S1d). Suppl. Fig. S2 [pdf online] shows location results with larger errors; despite this, the picking points of the apples could be extracted. <xref ref-type="table" rid="T0002">Table 2</xref> shows that the RMSE of the proposed method was 15.0, the average location error was 10.2°, and the average runtime was 9.2 ms. The smallest location error of the newly proposed method was only 0.1°, while the largest location error was 39.5°.</p>
			<table-wrap id="T0002">
		<label>Table 2.</label>
		<caption>
		<title>Location results of 20 single and blocked apple images using presented method.</title>
		</caption>
		<graphic xlink:href="sjar_e02_005_t02.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</table-wrap>
		</sec>
		<sec id="S3.3">
			<title>Location results of apples captured in panoramas and images containing adjacent apples</title>
			<p>Some apples in panoramas and images containing adjacent apples required reconstructing the contour for occluded areas that were too large. The main procedures for this were as follows,</p>
			<list list-type="disc">
				<list-item>
					<p><bold><italic>Step 1:</italic></bold> Transform the original image from the RGB color space to the L*a*b* color space, and then cluster the apple image using the K-means clustering algorithm.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 2:</italic></bold> Binarize the clustered apple image.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 3: </italic></bold>Pre-process the binary image, such as by a mathematical morphological operation and/or noise removal.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 4:</italic></bold> Reconstruct the contour of adjacent and blocked apples (<xref ref-type="bibr" rid="CIT0016">Song <italic>et al</italic>., 2013</xref>).</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 5:</italic></bold> Extract the convex hull of the apple, replace the apple contour with it and identify the apple symmetry axes using the moment of inertia algorithm to test the effectiveness of the improved method presented in this paper.</p>
				</list-item>
				<list-item>
					<p><bold><italic>Step 6:</italic></bold> Calculate the location error according to formula <xref ref-type="disp-formula" rid="form0011">[11]</xref>.</p>
				</list-item>
			</list>
			<p>The experimental results and experimental data of images containing adjacent apples are shown in Suppl. Fig. S3 and Suppl. Table S1 [pdfs online], and those of the panoramas are shown in Suppl. Fig. S4 and Suppl. Table S2 [pdfs online]. As clearly shown in Suppl. Tables S1 and S2, the RMSE values of images containing adjacent apples and panoramas were 21.6 and 18.4, respectively, and the average location errors were 16.3° and 13.8°, respectively. The runtimes of these two types of images were determined by the number of apples and that of blocked apples contained in the image. From Suppl. Figs. S3 and S4, we can see that all of the apples in the images can be found and the picking points of the apples could be extracted.</p>
		</sec>
		</sec>
		<sec id="S4">
			<title>Discussion</title>
			<sec id="S4.1">
				<title>Performance of the proposed method for single and unblocked apple targets</title>
				<p>From <xref ref-type="fig" rid="F0008">Figs. 8</xref> and <xref ref-type="fig" rid="F0010">10</xref>, we can see the different performances of the PIA, improved and unimproved methods. As shown in <xref ref-type="fig" rid="F0008">Fig. 8</xref>, compared to the performance of the improved method, the obtained symmetry axes shown in <xref ref-type="fig" rid="F0008">Figs. 8q-t</xref> using the unimproved method and the extracted principal inertia axes utilizing the PIA method shown in <xref ref-type="fig" rid="F0008">Figs. 8u-x</xref> were rather biased. After analyzing the algorithm location error data of the 30 images in <xref ref-type="fig" rid="F0010">Figs. 10a,b</xref> in detail, we could find that the location error curve and runtime curve of the presented method were both under those of the other two methods. The average location error of the newly presented method was 80.6% and 73.8% lower than that of the PIA method (25.3°) and the original algorithm (18.7°), respectively. The accuracy of the proposed method improved by 80.7% and 71.7% when compared to the PIA method (32.8) and the unimproved method (22.3), respectively, in terms of RMSE. To further analyze the effectiveness of the algorithm presented in the paper, the runtime of the algorithm on 30 images was analyzed. The average runtime of the improved algorithm was 98.8% shorter than that of the PIA method (306.2 ms), and it was decreased by 96.6% when compared to the original algorithm (107.7 ms). Compared with these two methods, the runtime of the improved algorithm was drastically reduced, which indicated that the improved algorithm could improve the operational efficiency effectively. From <xref ref-type="fig" rid="F0008">Figs. 8</xref> and <xref ref-type="fig" rid="F0010">10a,b</xref>, it can be concluded that the pre-processing measures and convex hull algorithm smoothed and simplified the contour of apple, which could improve the accuracy of location precision.</p>
		<p>Errors in location results (see <xref ref-type="fig" rid="F0009">Figs. 9</xref>, S2) might be caused by too strong or too weak light conditions, which could result in inaccurate segmentation during the color clustering process, thereby affecting the accuracy of extracting the symmetry axes. In detail, the light condition on the lower-left corner of target 3 in <xref ref-type="fig" rid="F0008">Fig. 9a</xref> was too dim, which led to mistaking it for the background, and the wrong contour extraction occurred when it was clustered. In <xref ref-type="fig" rid="F0009">Fig. 9b</xref>, the dim light conditions and lack of red in some areas of target 4 resulted in inaccurate contour extraction. In <xref ref-type="fig" rid="F0009">Fig. 9c</xref>, target 7 was incorrectly clustered due to overly dim light and overly strong light in some areas. The area where the light was too strong was corrected by image pre-processing, while the overly dim light resulted in incorrect classification when it was clustered.</p>
		<p>Although the location error of the presented algorithm is obvious for some apple targets, the location error of these apple targets using the proposed algorithm is lower than that of the PIA method and the unimproved algorithm.</p>
			</sec>
			<sec id="S4.2">
				<title>Analysis of the location of single and blocked apple targets</title>
				<p>A comparison of the performance of the PIA method, the unimproved method and the presented method is shown in <xref ref-type="fig" rid="F0010">Figs. 10c,d</xref>. From <xref ref-type="fig" rid="F0010">Fig. 10c,d</xref>, the location error curve and runtime curve of the presented method were under those of the other two methods, which indicates that the proposed method was effective. Looking at the RMSE of these three methods, we find that the present method (RMSE=15.0) was a little better than the unimproved method (RMSE=19.3), while it was much better than the PIA method (RMSE=33.2). The average location error (10.2°) and average runtime (9.2 ms) of the proposed method were much smaller than those of the unimproved method and the PIA method. The results showed that the location accuracy was increased by 22.3%, the average location error was decreased by 36.3%, and the average runtime was decreased by 87.1% when compared to the unimproved method. When compared to the PIA method, the accuracy of the proposed method was improved by 54.8% and the average location error of the presented method was decreased by 67.9%. The improved method was more efficient in terms of runtime, which was 96.6% shorter than that of the PIA method. From the runtime of these methods, it can be concluded that the pre-processing measure and convex hull algorithm could simplify the complexity of the algorithm. As clearly shown in <xref ref-type="fig" rid="F0010">Fig. 10c</xref>, the proposed method was better than the PIA method. However, it was worse than the unimproved method in some cases (target 7, target 13, target 18 and target 20 in <xref ref-type="table" rid="T0002">Table 2</xref>). The reason was that the convex hull of an apple cannot express the region of the apple accurately because of the too large block area, immaturity, light intensity, shadows on the apple and background factors (details shown in Fig. S2).</p>
				<fig id="F0010">
					<label>Figure 10.</label>
					<caption>
						<title>Comparison of the PIA method, unimproved method and improved method when processing 30 (left) or 20 (right) single and unblocked apple images. <bold>(a, c) </bold>Comparison of the location error of the three methods; <bold>(b, d) </bold>comparison of the runtime of the three methods.</title>
					</caption>
					<graphic xlink:href="sjar_e02_005_f10.jpg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
	</fig>
			</sec>
			<sec id="S4.3">
				<title>Location of apples captured in panorama and images containing adjacent apples</title>
				<p>For images containing adjacent apples, the entire contour of some apples could not be extracted because they were being blocked by adjacent apples or leaves, and thus, the contour of these apples should be reconstructed. Though there were location errors of reconstruction, the apple targets could be located. Location errors of some unblocked apple targets were larger (targets 3 and 11 in Suppl. Fig. S3 [pdf online]). This was due to the poor symmetry of these apples. For apples captured in panoramas, all apples in the images could be found. It was precise in locating some of the apples. The smallest location error was 0.0°. There were also some apples with larger location errors: the largest location error was 38.1°. Some of them were because of poor symmetry. Others were because the convex hull of the apple could not express the region of the apple accurately, which resulted from branches and background factors, light intensity, being blocked by leaves and/or the maturity of the apple. Details are shown in Suppl. Fig. S4 [pdf online].</p>
		<p>For these two types of apple images, the runtime was slightly longer; this resulted from the execution loop of every apple and the reconstruction of the blocked region of the blocked apples in the images.</p>
		<p>In summary, this paper utilized the convex hull theory in combination with the K-means clustering algorithm and mathematical morphology to replace the contour curve of single and unblocked apple targets with the convex hull, thereby improving the precision of the target localization, enhancing the efficiency of operation, and simplifying the computational complexity of the original algorithm. The moment of inertia method was used to extract symmetry axes of apple targets, which could better locate the picking points of apples. The correctness and the effectiveness of the algorithm presented in this paper showed that the improved algorithm was feasible for extracting symmetry axes and locating the picking points of apples. For occluded apple targets, though the apple targets could be located, the location result was not accurate enough because they were blocked by leaves, stems or other apples. Therefore, further study is needed to improve the accuracy of the location of occluded apple targets.</p>
			</sec>
		</sec>
	</body>
	<back>
				<ack>
				<title id="S5">Acknowledgments</title>
				<p>The authors would like to thank Leilei Niu (graduate student, College of Mechanical and Electronic Engineering, Northwest A&amp;F University) and anonymous referees for their helpful comments and suggestions.</p>
				</ack>
		<ref-list>
			<title id="S6">References</title>
		<ref id="CIT0001">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Arefi</surname>
				<given-names>A</given-names>
			</name>
			<name>
				<surname>Motlagh</surname>
				<given-names>AM</given-names>
			</name>
			<name>
				<surname>Mollazade</surname>
				<given-names>K</given-names>
			</name>
			<name>
				<surname>Teimourlou</surname>
				<given-names>RF</given-names>
			</name>
			</person-group>
			<article-title>Recognition and localization of ripen tomato based on machine vision</article-title>
			<source>Aust J Crop Sci</source>
			<year>2011</year>
			<volume>5</volume>
			<issue>10</issue>
			<fpage>1144</fpage>
			<lpage>1149</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0002">
		<element-citation publication-type="conf-proc">
			<person-group person-group-type="author">
			<name>
				<surname>Bulanon</surname>
				<given-names>DM</given-names>
			</name>
			<name>
				<surname>Kataoka</surname>
				<given-names>T</given-names>
			</name>
			<name>
				<surname>Okamoto</surname>
				<given-names>H</given-names>
			</name>
			<name>
				<surname>Hata</surname>
			<given-names>S</given-names>
			</name>
			</person-group>
			<article-title>Development of a real-time machine vision system for the apple harvesting robot</article-title>
			<conf-name>SICE Annu Conf in Sapporo</conf-name>
			<conf-date>Aug 4-6</conf-date>
			<year>2004</year>
			<fpage>595</fpage>
			<lpage>598</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0003">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Chinchuluun</surname>
				<given-names>R</given-names>
			</name>
			<name>
				<surname>Lee</surname>
				<given-names>WS</given-names>
			</name>
			<name>
				<surname>Burks</surname>
				<given-names>TF</given-names>
			</name>
			</person-group>
			<article-title>Machine vision-based Citrus yield mapping system</article-title>
			<source>Proc Fla State Hort Soc</source>
			<year>2006</year>
			<issue>119</issue>
			<fpage>142</fpage>
			<lpage>147</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0004">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Fukushima</surname>
				<given-names>K</given-names>
			</name>
			<name>
				<surname>Kikuchi</surname>
				<given-names>M</given-names>
			</name>
			</person-group>
			<article-title>Symmetry axis extraction by a neural network</article-title>
			<source>Neuro- computing</source>
			<year>2006</year>
			<volume>69</volume>
			<issue>16</issue>
			<fpage>1827</fpage>
			<lpage>1836</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.neucom.2005.11.010">http://dx.doi.org/10.1016/j.neucom.2005.11.010</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0005">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Gong</surname>
				<given-names>JW</given-names>
			</name>
			<name>
				<surname>Huang</surname>
				<given-names>WY</given-names>
			</name>
			<name>
				<surname>Lu</surname>
				<given-names>JL</given-names>
			</name>
			</person-group>
			<article-title>A new algorithm to estimate the symmetrical axis of a curve in data processing</article-title>
			<source>Measurement Technique</source>
			<year>2001</year>
			<issue>6</issue>
			<fpage>3</fpage>
			<lpage>5</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0006">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Guo</surname>
				<given-names>F</given-names>
			</name>
			<name>
				<surname>Cao</surname>
				<given-names>QX</given-names>
			</name>
			<name>
				<surname>Cui</surname>
				<given-names>YJ</given-names>
			</name>
			<name>
				<surname>Nagata</surname>
				<given-names>M</given-names>
			</name>
			</person-group>
			<article-title>Fruit location and stem detection method for strawberry harvesting robot</article-title>
			<source>T CSAE</source>
			<year>2008</year>
			<volume>24</volume>
			<issue>10</issue>
			<fpage>89</fpage>
			<lpage>94</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0007">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Jiménez</surname>
				<given-names>AR</given-names>
			</name>
			<name>
				<surname>Ceres</surname>
				<given-names>R</given-names>
			</name>
			<name>
				<surname>Pons</surname>
				<given-names>JL</given-names>
			</name>
			</person-group>
			<article-title>A survey of computer vision methods for locating fruit on trees</article-title>
			<source>T ASAE</source>
			<year>2000</year>
			<volume>43</volume>
			<issue>6</issue>
			<fpage>1911</fpage>
			<lpage>1920</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.13031/2013.3096">http://dx.doi.org/10.13031/2013.3096</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0008">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Jim</surname>
				<given-names>J</given-names>
			</name>
			<name>
				<surname>Jensen</surname>
				<given-names>JR</given-names>
			</name>
			<name>
				<surname>Tullis</surname>
				<given-names>JA</given-names>
			</name>
			</person-group>
			<article-title>Object-based change detection using correlation image analysis and image segmentation</article-title>
			<source>Int J Remote Sens</source>
			<year>2008</year>
			<volume>29</volume>
			<issue>2</issue>
			<fpage>399</fpage>
			<lpage>423</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1080/01431160601075582">http://dx.doi.org/10.1080/01431160601075582</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0009">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Liang</surname>
				<given-names>N</given-names>
			</name>
			<name>
				<surname>Guo</surname>
				<given-names>L</given-names>
			</name>
			<name>
				<surname>Yu</surname>
				<given-names>Y</given-names>
			</name>
			</person-group>
			<article-title>A symmetry detected method based on the minimal value of moment of inertia</article-title>
			<source>Microprocessors</source>
			<year>2009</year>
			<volume>30</volume>
			<issue>6</issue>
			<fpage>62</fpage>
			<lpage>64</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0010">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Luo</surname>
				<given-names>MR</given-names>
			</name>
			<name>
				<surname>Cui</surname>
				<given-names>G</given-names>
			</name>
			<name>
				<surname>Rigg</surname>
				<given-names>B</given-names>
			</name>
			</person-group>
			<article-title>The development of the CIE 2000 color-difference formula: CIEDE</article-title>
			<source>Color Res Appl</source>
			<year>2000</year>
			<volume>26</volume>
			<issue>5</issue>
			<fpage>340</fpage>
			<lpage>350</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1002/col.1049">http://dx.doi.org/10.1002/col.1049</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0011">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Plebe</surname>
				<given-names>A</given-names>
			</name>
			<name>
				<surname>Grasso</surname>
				<given-names>G</given-names>
			</name>
			</person-group>
			<article-title>Localization of spherical fruits for robotic harvesting</article-title>
			<source>Machine Vision Appl</source>
			<year>2001</year>
			<volume>13</volume>
			<issue>2</issue>
			<fpage>70</fpage>
			<lpage>79</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1007/PL00013271">http://dx.doi.org/10.1007/PL00013271</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0012">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Rajneesh</surname>
				<given-names>B</given-names>
			</name>
			<name>
				<surname>Won</surname>
				<given-names>SL</given-names>
			</name>
			<name>
				<surname>Saumya</surname>
				<given-names>S</given-names>
			</name>
			</person-group>
			<article-title>Green citrus detection using fast fourier transform leakage</article-title>
			<source>Precis Agric</source>
			<year>2013</year>
			<volume>14</volume>
			<issue>1</issue>
			<fpage>59</fpage>
			<lpage>70</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1007/s11119-012-9292-3">http://dx.doi.org/10.1007/s11119-012-9292-3</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0013">
		<element-citation publication-type="conf-proc">
			<person-group person-group-type="author">
			<name>
				<surname>Rekik</surname>
				<given-names>A</given-names>
			</name>
			<name>
				<surname>Zribi</surname>
				<given-names>M</given-names>
			</name>
			<name>
				<surname>Benjelloun</surname>
				<given-names>M</given-names>
			</name>
			<name>
				<surname>Ben</surname>
				<given-names> HA</given-names>
			</name>
			</person-group>
			<article-title>A K-means clustering algorithm initialization for unsupervised statistical satellite image segmentation</article-title>
			<source>E-Learning in Industrial Electronics, 1st IEEE Int Conf</source>
			<year>2006</year>
			<fpage>11</fpage>
			<lpage>16</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0014">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Remy</surname>
				<given-names>E</given-names>
			</name>
			<name>
				<surname>Thiel</surname>
				<given-names>E</given-names>
			</name>
			</person-group>
			<article-title>Exact medial axis with euclidean distance</article-title>
			<source>Image Vision Comput</source>
			<year>2005</year>
			<volume>23</volume>
			<issue>2</issue>
			<fpage>167</fpage>
			<lpage>175</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.imavis.2004.06.007">http://dx.doi.org/10.1016/j.imavis.2004.06.007</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0015">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Song</surname>
				<given-names>HB</given-names>
			</name>
			<name>
				<surname>He</surname>
				<given-names>DJ</given-names>
			</name>
			<name>
				<surname>Pan</surname>
				<given-names>JP</given-names>
			</name>
			</person-group>
			<article-title>Recognition and localization methods of occluded apples based on convex hull theory</article-title>
			<source>T CSAE</source>
			<year>2012</year>
			<volume>28</volume>
			<issue>22</issue>
			<fpage>174</fpage>
			<lpage>180</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0016">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Song</surname>
				<given-names>HB</given-names>
			</name>
			<name>
				<surname>Zhang</surname>
				<given-names>CD</given-names>
			</name>
			<name>
				<surname>Pan</surname>
				<given-names>JP</given-names>
			</name>
			<name>
				<surname>Yin</surname>
				<given-names>X</given-names>
			</name>
			</person-group>
			<article-title>Segmentation and reconstruction of overlapped apple images based on convex hull</article-title>
			<source>T CSAE</source>
			<year>2013</year>
			<volume>29</volume>
			<issue>3</issue>
			<fpage>163</fpage>
			<lpage>168</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0017">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Tanigaki</surname>
				<given-names>K</given-names>
			</name>
			<name>
				<surname>Fujiura</surname>
				<given-names>T</given-names>
			</name>
			<name>
				<surname>Akase</surname>
				<given-names>A</given-names>
			</name>
			<name>
				<surname>Imagawa</surname>
				<given-names>J</given-names>
			</name>
			</person-group>
			<article-title>Cherry-harvesting robot</article-title>
			<source>Comput Electron Agr</source>
			<year>2008</year>
			<volume>63</volume>
			<issue>1</issue>
			<fpage>65</fpage>
			<lpage>72</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.compag.2008.01.018">http://dx.doi.org/10.1016/j.compag.2008.01.018</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0018">
		<element-citation publication-type="conf-proc">
			<person-group person-group-type="author">
			<name>
				<surname>Xiang</surname>
				<given-names>R</given-names>
			</name>
			<name>
				<surname>Ying</surname>
				<given-names>YB</given-names>
			</name>
			<name>
				<surname>Jiang</surname>
				<given-names>HY</given-names>
			</name>
			<name>
				<surname>Peng</surname>
				<given-names>YS</given-names>
			</name>
			</person-group>
			<article-title>Three-dimensional location of tomato based on binocular stereo vision for tomato harvesting robot</article-title>
			<conf-name>5th Int Symp Advanced Optical Manufacturing and Testing Technologies, Int Soc for Optics and Photonics</conf-name>
			<year>2010</year>
			<fpage>76582Z</fpage>
			<lpage>76582Z</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0019">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Xie</surname>
				<given-names>ZH</given-names>
			</name>
			<name>
				<surname>Xu</surname>
				<given-names>Y</given-names>
			</name>
			<name>
				<surname>Ji</surname>
				<given-names>CY</given-names>
			</name>
			<name>
				<surname>Guo</surname>
				<given-names>XQ</given-names>
			</name>
			<name>
				<surname>Zhu</surname>
				<given-names>SX</given-names>
			</name>
			</person-group>
			<article-title>Estimation method of apple growing attitude based on computer vision</article-title>
			<source>T CSAM</source>
			<year>2012</year>
			<volume>42</volume>
			<issue>11</issue>
			<fpage>154</fpage>
			<lpage>157</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0020">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Yao</surname>
				<given-names>H</given-names>
			</name>
			<name>
				<surname>Duan</surname>
				<given-names>Q</given-names>
			</name>
			<name>
				<surname>Li</surname>
				<given-names>D</given-names>
			</name>
			<name>
				<surname>Wang</surname>
				<given-names>J</given-names>
			</name>
			</person-group>
			<article-title>An improved K-means clustering algorithm for fish image segmentation</article-title>
			<source>Math Comput Model</source>
			<year>2013</year>
			<issue>58</issue>
			<fpage>790</fpage>
			<lpage>798</lpage>
			<comment><ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.1016/j.mcm.2012.12.025">http://dx.doi.org/10.1016/j.mcm.2012.12.025</ext-link></comment>
			</element-citation>
		</ref>
		<ref id="CIT0021">
		<element-citation publication-type="conf-proc">
			<person-group person-group-type="author">
			<name>
				<surname>Yin</surname>
				<given-names>HP</given-names>
			</name>
			<name>
				<surname>Chai</surname>
				<given-names>Y</given-names>
			</name>
			<name>
				<surname>Yang</surname>
				<given-names>SX</given-names>
			</name>
			<name>
				<surname>Simon</surname>
				<given-names>X</given-names>
			</name>
			<name>
				<surname>Mittal</surname>
				<given-names>GS</given-names>
			</name>
			</person-group>
			<article-title>Ripe tomato recognition and localization for a tomato harvesting robotic system</article-title>
			<conf-name>Int Conf of Soft Computing and Pattern Recognition</conf-name>
			<conf-loc>Melacca, TBD, Malaysia</conf-loc>
			<year>2009</year>
			<fpage>557</fpage>
			<lpage>562</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0022">
		<element-citation publication-type="journal">
			<person-group person-group-type="author">
			<name>
				<surname>Zhang</surname>
				<given-names>HM</given-names>
			</name>
			<name>
				<surname>Gao</surname>
				<given-names>MT</given-names>
			</name>
			<name>
				<surname>Zhang</surname>
				<given-names>GM</given-names>
			</name>
			</person-group>
			<article-title>Symmetry axes search of 2D point set based on convex hull technology</article-title>
			<source>Comput Appl</source>
			<year>2010</year>
			<volume>30</volume>
			<issue>4</issue>
			<fpage>905</fpage>
			<lpage>908</lpage>
			</element-citation>
		</ref>
		<ref id="CIT0023">
		<element-citation publication-type="conf-proc">
			<person-group person-group-type="author">
			<name>
				<surname>Zhou</surname>
				<given-names>QH</given-names>
			</name>
			<name>
				<surname>Huang</surname>
				<given-names>T</given-names>
			</name>
			<name>
				<surname>Wu</surname>
				<given-names>HY</given-names>
			</name>
			<name>
				<surname>Li</surname>
				<given-names>ZJ</given-names>
			</name>
			<name>
				<surname>Lin</surname>
				<given-names>X</given-names>
			</name>
			</person-group>
			<article-title>A new algorithm for finding convex hull with a maximum pitch of the dynamical base line</article-title>
			<conf-name>Knowledge Discovery and Data Mining, WKDD. First Int Workshop IEEE</conf-name>
			<year>2008</year>
			<fpage>630</fpage>
			<lpage>634</lpage>
			</element-citation>
		</ref>
		</ref-list>
	</back>
</article>
