Determining Banana Size Based on Computer Vision

38
This article was downloaded by: [Aston University] On: 23 August 2014, At: 11:09 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK International Journal of Food Properties Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/ljfp20 Determining Banana Size Based on Computer Vision Menghan Hu a , Qingli Dong a , Pradeep K. Malakar b , Baolin Liu a & Ganesh K. Jaganathan a a Institute of Food Science and Engineering, University of Shanghai for Science and Technology, 516 JunGong Rd., Shanghai 200093, P. R. China b Institute of Food Research, NR47UA, Norwich, United Kingdom Accepted author version posted online: 28 Mar 2014. To cite this article: Menghan Hu, Qingli Dong, Pradeep K. Malakar, Baolin Liu & Ganesh K. Jaganathan (2014): Determining Banana Size Based on Computer Vision, International Journal of Food Properties, DOI: 10.1080/10942912.2013.833223 To link to this article: http://dx.doi.org/10.1080/10942912.2013.833223 Disclaimer: This is a version of an unedited manuscript that has been accepted for publication. As a service to authors and researchers we are providing this version of the accepted manuscript (AM). Copyediting, typesetting, and review of the resulting proof will be undertaken on this manuscript before final publication of the Version of Record (VoR). During production and pre-press, errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal relate to this version also. PLEASE SCROLL DOWN FOR ARTICLE Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) contained in the publications on our platform. However, Taylor & Francis, our agents, and our licensors make no representations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of the Content. Any opinions and views expressed in this publication are the opinions and views of the authors, and are not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon and should be independently verified with primary sources of information. Taylor and Francis shall not be liable for any losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoever or howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use of the Content. This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. Terms & Conditions of access and use can be found at http:// www.tandfonline.com/page/terms-and-conditions

Transcript of Determining Banana Size Based on Computer Vision

Page 1: Determining Banana Size Based on Computer Vision

This article was downloaded by: [Aston University]On: 23 August 2014, At: 11:09Publisher: Taylor & FrancisInforma Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House,37-41 Mortimer Street, London W1T 3JH, UK

International Journal of Food PropertiesPublication details, including instructions for authors and subscription information:http://www.tandfonline.com/loi/ljfp20

Determining Banana Size Based on Computer VisionMenghan Hua, Qingli Donga, Pradeep K. Malakarb, Baolin Liua & Ganesh K. Jaganathana

a Institute of Food Science and Engineering, University of Shanghai for Science andTechnology, 516 JunGong Rd., Shanghai 200093, P. R. Chinab Institute of Food Research, NR47UA, Norwich, United KingdomAccepted author version posted online: 28 Mar 2014.

To cite this article: Menghan Hu, Qingli Dong, Pradeep K. Malakar, Baolin Liu & Ganesh K. Jaganathan (2014): DeterminingBanana Size Based on Computer Vision, International Journal of Food Properties, DOI: 10.1080/10942912.2013.833223

To link to this article: http://dx.doi.org/10.1080/10942912.2013.833223

Disclaimer: This is a version of an unedited manuscript that has been accepted for publication. As a serviceto authors and researchers we are providing this version of the accepted manuscript (AM). Copyediting,typesetting, and review of the resulting proof will be undertaken on this manuscript before final publication ofthe Version of Record (VoR). During production and pre-press, errors may be discovered which could affect thecontent, and all legal disclaimers that apply to the journal relate to this version also.

PLEASE SCROLL DOWN FOR ARTICLE

Taylor & Francis makes every effort to ensure the accuracy of all the information (the “Content”) containedin the publications on our platform. However, Taylor & Francis, our agents, and our licensors make norepresentations or warranties whatsoever as to the accuracy, completeness, or suitability for any purpose of theContent. Any opinions and views expressed in this publication are the opinions and views of the authors, andare not the views of or endorsed by Taylor & Francis. The accuracy of the Content should not be relied upon andshould be independently verified with primary sources of information. Taylor and Francis shall not be liable forany losses, actions, claims, proceedings, demands, costs, expenses, damages, and other liabilities whatsoeveror howsoever caused arising directly or indirectly in connection with, in relation to or arising out of the use ofthe Content.

This article may be used for research, teaching, and private study purposes. Any substantial or systematicreproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in anyform to anyone is expressly forbidden. Terms & Conditions of access and use can be found at http://www.tandfonline.com/page/terms-and-conditions

Page 2: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 1

Determining Banana Size Based on Computer Vision 1

Running Title: Computer Vision on Banana Size 2

Menghan Hu1, Qingli Dong1, *, Pradeep K. Malakar2, Baolin Liu1, Ganesh K. Jaganathan1 3

1 Institute of Food Science and Engineering, University of Shanghai for Science and 4 Technology, 516 JunGong Rd., Shanghai 200093, P. R. China 5

2 Institute of Food Research, NR47UA, Norwich, United Kingdom 6

* Corresponding author. Tel: +86 21 5527 1117; Fax: +86 21 5527 1117. 7

E-mail: [email protected] (Dr. Qingli Dong). 8

E-mail: [email protected] (Menghan Hu). 9

ABSTRACT 10

An automatic algorithm based on computer vision to determine three size indicators of banana, 11

namely length, ventral straight length and arc height, respectively, was developed in this paper. 12

The automatic algorithm calculated these indicators by three steps. First, banana was marked by 13

image pre-processing. Then, the Five Points Method as the core part of the automatic algorithm 14

was used to locate five points at the edge of banana. Finally, the Euclidean distances between two 15

certain points were calculated to determine these indicators. The three size indicators of 28 16

bananas with slightly curved, curved and end-straight shape were determined using the manual 17

method, semi-automatic method and automatic method, respectively. Results demonstrated that 18

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 3: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 2

the automatic method was more precise with lower standard deviations and more accurate with a 19

percent difference within 16 and 22% for the length and the ventral straight length, respectively. In 20

conclusion, the automatic algorithm was acceptable for banana size determination. 21

Keywords: Computer vision; Machine vision; Banana; Image processing; Size; Shape 22

INTRODUCTION 23

Banana is the most widely consumed fruit in the world. [1] Food and Agriculture Organization has 24

estimated that the world production of banana in 2005 was more than 70 Million metric tons. [2] It 25

has also been estimated that the production of banana in China was over 7 Million metric tons, thus 26

ranked second in the world only next to India. [2] Often, banana is classified by its size which not 27

only achieves fruit value maximization as commercial marketing price depends on the fruit size 28

but also eventually benefit the transportation of fruit. [3] To date, however, there appears to be no 29

standardized measure to classify banana according to the size which directly hampers the 30

profitability of Chinese banana industry. Moreover, the harvesting equipments and packaging 31

facilities are largely imperfect, making the banana industry costly and time-consuming. 32

Consequently, increasing attention has been paid to develop non-destructive technologies that 33

obtain the good quality of banana. 34

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 4: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 3

In recent years, the application of non-destructive technologies on detecting the banana quality has 35

principally focused on gas sensors to determine the ripeness of banana [4], utilizing capacitive 36

properties to test the maturity of banana [5], using hyperspectral imaging technique to study the 37

quality and maturity stages of banana [6], applying image analysis for classifying the maturity 38

stages of banana [7], and combining a sound velocity and visible-short wave near infrared 39

technique to assess the firmness of intact banana [8]. On the other hand, a large volume of literature 40

continues to accumulate on using computer vision to measure the size of the fruit and hence 41

predicting its quality. For example, Xu and Zhao [9] described the size of strawberry by the largest 42

fruit diameter. Radojević et al. [10] distinguished the deformed shape and satisfactory shape of 43

apple by measuring the radius. Li and Zhu [11] went further and measured the diameter as the 44

feature of size to grade apple. Similar experiments have also been conducted on cantaloupe [12], 45

watermelon [13], citrus fruit [14, 15], kiwifruit [16], and peach [17]. Interestingly, the assessment of the 46

relationship between size and quality of a fruit based on computer vision analysis has been limited 47

to fruits that exhibit axis-symmetric or ellipse shape. Extending the computer vision method to 48

determine size of irregular shaped fruit like banana, although with tremendous practical 49

application, has not been attempted in addition to the research reported by Jarimopas and Jaisin [18], 50

who used the radial signal between a circle surrounded the sweet tamarind and the boundary of 51

tamarind to determined the location of tail and stem, and then the length was calculated. 52

Nevertheless, this algorithm is inadaptable for banana size determination due to the bigger 53

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 5: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 4

dimension of banana which will make the circle out of the image horizon and the other two size 54

indicators need measuring in this study. 55

In spite of this, Mustafa et al. [19] used image processing to calculate the area, circumference, 56

length and thickness of banana. However, the accuracy of their results are questionable since they 57

ignored pedicel measurement and the algorithm was only suitable for banana with gentle 58

curvature. Also, Codex Alimentarius Commission [20] suggested measuring the length of banana 59

along the convex face from the blossom end of the pedicel. More recently, Soltani et al. [21] used 60

computer vision technology to detect the area of banana, but measured the length and the 61

perpendicular diameter by a flexible ruler and a digital caliper, respectively, due to the difficulty 62

to perform the automatic measurement of these two parameters in the images. Furthermore, 63

ventral straight length and arc height are also known as two important size indicators [22], and 64

there are no related research to measure them using computer vision. Therefore, an automatic 65

algorithm analysis based on Five Points Method using computer vision to measure the ventral 66

straight length and arc height of banana was the main goal of this research. 67

The specific objectives of this work were: (1) to detect the pedicel location; (2) to test the 68

performance of the Five Points Method which is the key sub-algorithm of the automatic 69

measurement algorithm; and (3) to determine the three size indicators of banana using computer 70

vision and to compare the performance of three different methods. 71

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 6: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 5

MATERIALS AND METHODS 72

Banana samples 73

Eighteen bananas (Musa AAA cavendish) with slightly curved and curved fruit shape (see 74

Appendix 1) from a single batch purchased from a local market in Shanghai, P. R. China, were 75

used in these experiments. In addition, ten bananas with three different shapes (see Appendix 2) 76

were purchased for validation experiments. 77

Computer Vision System (CVS) 78

The computer vision system used in this study was developed as described by Mendoza and 79

Aguilera with some minor modifications [7]. The Canon digital camera (model: EOS 550D) with 80

lens EF-S 18-55mm, placed vertically at a distance of 35cm from the sample, was used to capture 81

the images. The digital camera was connected to the PC (T4200 2GHz) with an USB interfaces. 82

The EOS Utility Ver.2.10 software (Canon U.S.A., Inc.) was used to control the camera remotely 83

and to acquire the digitalized images directly, and the resolution of each image is 2592×1728 84

pixels. The spatial distance between pixels with horizontal and vertical relationship in the images 85

was equal to 0.1595mm and the spatial distance of a pair diagonal pixel was considered as 86

0.1595mm approximately in our experiments. Each banana was taken three different images (three 87

repetitions) under each treatment. 88

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 7: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 6

Image pre-processing 89

The preliminary images taken were subjected to image cut in order to eliminate the redundant and 90

useless background. Subsequently these images were involved in image graying and later 91

converted to binary images. The noises were reduced by image enhancement and the object was 92

marked to be convenient for the following operations. The process has been described in Fig. 1. 93

The software of MATLAB 7.9 (The Math Work, Inc., USA) was applied to achieve the algorithms 94

of pre-processing and further analysis. 95

Five Points Method 96

In order to measure the size of the banana from the binary image, we developed the Five Points 97

Method. However, it should be mentioned that size measurement always, if not frequently, 98

depends on the orientation of the object with respect to the camera [23]. Therefore, all bananas in 99

this experiment were placed in the orientation shown in Fig. 2. Whilst determining the size of 100

banana, it has been emphasized that pedicel must be excluded. [20, 24] The sub-algorithm of 101

automatic method, The Five Points Method, was used to measure the fruit size that does not 102

include pedicel which is depicted in Fig.2. 103

First point: In the binary image, the point joining between the pedicel and the edible pulp in the 104

lower edge was considered as first point. This point is unique in all banana tested in this 105

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 8: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 7

experiment. The value of first point was determined by calculating the forward difference between 106

the y-coordinate of the lower edge by using the following equation: 107

1 - -1,i i iG y y i n+= ≤ (1) 108

where n means the number of lower edge point, the yi denote the points set of the lower edge of 109

banana, and the coordinate of the maximum value of the Gi is the corresponding coordinate of the 110

first point. 111

Second point: The coordinate of the last point in lower edge points set is the second point. 112

Third point: The (xi, yi) denote the points set of the upper edge. Then, the Euclidean distance 113

between the first point and each of the upper edge points is calculated using the following 114

equation: 115

2 2( - ) ( - ) 1, 2,3,..., ,iP x x y y i ni first i first= + = (2) 116

where n denotes the point number of upper boundary of banana, (xfirst, yfirst) is the coordinate of the 117

first point. The coordinate of the minimum value of Pi is the corresponding coordinate of the third 118

point. 119

Fourth point: There is some difficulty in determining the fourth point, because of the irregular 120

shape of the banana. To overcome this, the image was split in to two halves. The left handed image 121

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 9: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 8

was eliminated from the analysis and the skeleton image of the right hand side alone was used after 122

removing the boundary pixels by infinite erosion. The skeletonization was an iterative procedure 123

which only stopped when no more pixels could be removed. [25] Subsequently, the extreme value 124

of the image skeleton was then calculated. Owing to the orientation of banana in this experiment, 125

the extreme value with minimum x value was the fourth point. The results of two processes for the 126

image were illustrated in Fig. 3. Fig. 3 (b) shows that the extreme point in the upper right is the 127

fourth point (highlighted by a small circle). 128

Fifth point: The fifth point is the peak of the convex face of the banana. The third point and the 129

fourth point confirm a straight line, and the distances D (i) between lower edge point sets and the 130

straight line can be calculated by the following equation: 131

2( ) 1, 2,3,..., ,

1i iy kx bD i i n

k− −

= =+

(3) 132

where k and b are the slope and the intercept of the straight line, respectively, n is the number of the 133

lower edge point. The point with the max value of D (i) is the fifth point and the corresponding 134

coordinate of the fifth point could be obtained from lower edge point sets. 135

Determination of banana size 136

After calculating the coordinate of these five points, the length (L1), the ventral straight length (L2) 137

and the arc height (H) are determined as follows. 138

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 10: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 9

The length (L1): For measuring the length of the banana, the first point, the second point and the 139

fifth point were utilized to divide the pre-processed image into two parts (see Fig. 4). Then, the 140

perimeters of two parts were calculated by counting the number of pixel around the edge of each 141

part and the lengths of two straight lines could be determined as well. A simple subtraction was 142

employed to obtain the two divided parts of the banana length. Therefore, the entire length of 143

banana could be obtained by summing previous two divided lengths. 144

Ventral straight length (L2): The Euclidean distance between the third point and the fourth point 145

is the ventral straight length as shown in the Fig. 2. 146

Arc height (H): The arc height of bananas was the maximum value of D (i) which could be 147

calculated by Eq. (3). 148

In order to verify the accuracy of this automatic measurement algorithm, results obtained by the 149

automatic algorithm are compared with manual and semi-automatic measurement results, 150

respectively. The manual measurement results are obtained by two different persons, and each 151

person repeats three times at half an hour interval. With regards to the semi-automatic method, the 152

coordinates of five points are found manually in the images rather than Five Points Method. 153

Because both the manual and automatic measurement results of the arc height (H) are highly 154

dependent on the results of the length and the ventral straight length, solely the length (L1) and 155

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 11: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 10

ventral straight length (L2) were measured manually by a flexible ruler in the experiments. The 156

percent difference between the manual method and semi-automatic/automatic method is 157

calculated as follows. 158

100%mX Xdiff

X−

= × (4) 159

where, diff is the percent difference, and the X and Xm are the semi-automatic or automatic and 160

the manual measured value of banana, respectively. Ten banana fingers of three different shapes 161

(Appendix 2) are utilized for the validation experiments to evaluate the accuracy of the automatic 162

method. 163

RESULTS AND DISCUSSION 164

Pedicel location detection 165

A major problem in determining the size of the banana using the computer vision seems to be the 166

pedicel location identification. According to all the standards for banana, the length of banana is 167

exclusive of the pedicel, so the position of the pedicel should be determined. It was pointed out by 168

Du and Sun [26], that protrusion (equivalent to the pedicel mentioned in this experiment) on the 169

sides of packed ellipsoidal ham affected the accuracy of the results of area measurement with 170

computer vision analysis and thus they excluded it from analysis. To quote another example, 171

Blasco et al. [27] working with apple size estimation using computer vision found the longest region 172

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 12: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 11

in the binary image as the stem and validate the image by obviating the stem in the image. It may 173

be of interest to note Batchelor and Searcy studied the diameter relationships in the area near the 174

stem/root joint in advance and this prior knowledge was used to determine the stem/root joint of 175

carrots. [28] 176

Since such measurements are not available for banana, size assessment studies often misjudged the 177

location of pedicel in the banana, making the calculation obscure and unreliable. The first and third 178

points shown in Fig. 2 illustrated that the location of the pedicel could be calculated using the 179

method described in section 2.4. We tested a total of 18 bananas and the results revealed that this 180

method could be applied to determine the location of pedicel in all, but two bananas (6 and 9 in 181

Appendix 1). The reason for this result may be interpreted as in banana No. 6, due to the excessive 182

curvature the maximum gradient which made the first point unable to calculate. Whereas, in 183

banana No. 9, the maximum gradient could not be established because the unclear cut in the 184

pedicel formed protrusion was identified as the first point. Nevertheless, it is emphasized the use of 185

a more robust algorithm should eliminate these shortcomings and improve the accuracy of the 186

results in the future studies. Furthermore, if assembling one more camera horizontally towards 187

banana to capture the banana side images, the location of pedicel would be determined easily by 188

setting the threshold according to the average thickness of banana. 189

190

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 13: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 12

Five Points Method 191

The Five Points Method is the key sub-algorithm used in the automatic algorithm. To evaluate the 192

accuracy of the Five Points Method, the coordinates of five points found by the Five Points 193

Method was marked on the images to compare with the points which were found manually, and 194

results showed that the coordinates found by two methods were basically the same, therefore, the 195

Five Points Method could be used as the sub-algorithm in the automatic algorithm to replace the 196

manual one. Although the five points could be exactly found by such method, the dark patches (i.e. 197

senescent spots, bruise and peduncle residue, etc) on banana would affect the size determination, 198

and it could be decreased by improvement of the image pre-processing and the computer vision 199

system. To locate the fourth point, the skeleton of the left half part of banana was extracted in the 200

automatic algorithm (Fig. 3). In our previous analysis, if we searched the extreme directly, the 201

fourth point would largely deviate from its true location due to the existence of obvious ridge near 202

the end of some plump bananas. 203

Size determination of banana 204

The performances of the three difference methods for size determination of banana were presented 205

in Fig. 5, Fig.6 and Fig.7, respectively. The standard deviation was used to evaluate precision of 206

three different methods. According to common situation, the repeatability of automatic method 207

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 14: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 13

was better than that of manual method and that of semi-automatic method, respectively, and it also 208

could be intuitively seen in Fig. 5, Fig. 6 and Fig. 7, respectively. It could be found that the 209

standard deviations of manual results were higher than those of semi-automatic and automatic 210

ones, respectively. The high standard deviations indicated that the precision of manual method was 211

lower than that of other two methods. For the manual method, strong subjectivity led to the higher 212

standard deviations. The manual method was also time-consuming and could lead to measurement 213

and record errors. For the semi-automatic method, it could be observed that standard deviations of 214

semi-automatic results were a little higher than those of automatic results shown in Fig. 5, Fig. 6 215

and Fig. 7, respectively, and the reason might be that some subjectivity existed in semi-automatic 216

method to find the coordinates of five points in images manually. Besides, the existence of surface 217

curvature of banana added the measurement errors. Some researchers had studied the effect of 218

curved surfaces in color measurements, [29, 30] few researchers paid attention to these influence of 219

curvature on the size or shape measurements, since it was difficult to eliminate the measurement 220

error caused by curved surfaces. Recently, some high-end cameras could be used to eliminate 221

curvature effect within a certain object distance by assembling telecentric lens. [31, 32] But the 222

telecentric lens has not been used widely due to its limited application fields. 223

In order to estimate the accuracy of these methods, the percent difference between the manual and 224

semi-automatic/automatic results was calculated and the values of the percent difference for the 225

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 15: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 14

length and ventral straight length of banana were presented in Table 1. In terms of the length, the 226

percent difference values of the semi-automatic method were within 14% and the automatic 227

method within 15%. The minimum values of percent difference for these two methods were all 228

within 1%. From the mean values (5.13% and 5.68%, respectively for semi-automatic and 229

automatic method), these two methods for determining the length of bananas proved to be 230

acceptable. The validation experiments were added to prove the feasibility of the five-point 231

technique, and the comparison results were shown in Table 2. It could be observed from table 1 232

and table 2 that the percent differences between the manual and automatic method for the banana 233

length were within 16%, and some values were close to 1%. For the ventral straight length, the 234

percent differences were within 22% except 49% difference which occurred on the banana number 235

18. By checking the coordinates of five points (all fall on the right locations) in the images of 236

banana number 18, we could find that the five-point technique was not the main source of this 237

large devotion, and hence, this value could be treated as the outlier. In conclusion, 28 banana 238

samples were tested and all results were satisfactory apart from one mistake for the ventral straight 239

length of banana number 18. Consequently, the automatic method was acceptable for size 240

determination of banana finger. 241

Two sources of error should be noticed. Firstly, the shape diversity of banana would cause error: 242

individual bananas had particular shapes, which would lead to significant differences in selecting 243

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 16: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 15

the measured points using these three different methods. Furthermore, it must be point out that a 244

pair diagonal pixel in images was disposed of the same as the horizontal and vertical ones which 245

make the values of size indicators smaller. The size of food determined by the image processing 246

was often compared with the manual result [15, 26]. But the manual results should not be regarded as 247

the standard values because of the poor precision and low accuracy. Consequently, this kind of 248

comparison could also give rise to inaccurate evaluation, especially for size determination of 249

banana. Because unlike axi-symmetric food product, the convexity on the outboard, the concavity 250

on the inner side and curved surface of banana would lead to the sizable manual measurement 251

error. Therefore, the manual measurement error might contribute to the high value of percent 252

difference. Considering these drawbacks of the manual measurement, the authors suggested that 253

the semi-automatic method could be used to evaluate the performance of the automatic method in 254

future study. This was because the semi-automatic method was less subjective than the manual 255

method, such as using the image as the measured object and utilizing computer to obtain final 256

results. 257

The size of images used in this study was 2592×1728 pixels, and this resolution is rather higher 258

than these which were commonly used in the scientific research and manufacturing process 259

nowadays. As we all known, the image would contain much more contents if its size was bigger. 260

These attributes of large size image might magnify or lead to the measurement error of the 261

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 17: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 16

automatic method. For instance, the protrusion in the pedicel (see section 3.1) might be expelled 262

through the image processing operations if the image size was low. Certainly, the in-depth 263

relationship between the image size and measurement result of image processing needs further 264

studying. 265

It could be observed that this algorithm highly depended on the banana orientation which also had 266

been mentioned in Section 2.4. The dependence of the orientation would render the algorithm less 267

applicable for further applications. The potential solution to this drawback was the utilization of 268

some mechanical methods for adjusting the banana orientation automatically, and consequently 269

the fusion of the algorithm and the mechanical methods could be attempted in the future studies. 270

Nowadays, the relevant banana standards were imperfect and the implementation of standards was 271

deficient because of the low automation in banana industry. From above studies, the automatic 272

algorithm could be used to determine the size of banana. The measurement of the length (L1) was 273

more accurate compared with the ventral straight length (L2) and the arc height (H). According to 274

the many current banana standards, banana is often graded by the length, so the automatic 275

algorithm could help to grade banana on-line. Besides, sizes were often used to describe the shape 276

features. [33] In our study, the arc height (H) divided by the length (L1) was used to characterize 277

bending degree of banana as a shape indicator. In a future study, a large number of bananas with 278

the same variety might be studied to improve standards by summing up the shape characteristics. 279

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 18: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 17

Therefore, the automatic algorithm was beneficial for standards formulation and implementation 280

in the banana industry. 281

The experiments in our research were based on banana finger. However, it should be noted that 282

bananas were always presented for packaged and sales in hands or clusters. [34] Mendoza et al. [34] 283

reported that banana hand was a finger group which ten or more fingers grew together, and Codex 284

Alimentarius Commission [20] defined that banana cluster, which was a part of banana hand, was a 285

small finger group with no more than four fingers (see Appendix 2). At present, there were no 286

correlation study based on banana hands and clusters previously due to the difficulty in image 287

processing. According to Codex Alimentarious Commission, while sizing bananas, the median 288

finger and the finger next to the cut section on the outer row were the reference fruit for hands and 289

clusters, respectively. [20] But the reference banana was difficult to be segmented from hands and 290

clusters by images processing. Therefore, the size determination based on complete hands and 291

clusters should be studied to extend computer vision technology applications in banana industry. 292

CONCLUSIONS 293

In this paper, an automatic algorithm based on computer vision system was developed to 294

determine the size of banana. Compared with the manual method and semi-automatic method, the 295

automatic algorithm proved to be more precise by the standard deviation. In terms of the accuracy 296

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 19: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 18

of the automatic algorithm, the mean values of the percent difference for the length and the ventral 297

straight length of banana were 5.68% and 10.47%, respectively. With the exception of size 298

determination, the automatic algorithm could also detect pedicel location of banana and two of 299

eighteen bananas failed to find the pedicel location. Consequently, the automatic algorithm is 300

acceptable for banana size determination and the implementation of the automatic algorithm 301

would promote automation and improve standards formulation of banana industry. 302

ACKNOWLEDGEMENTS 303

This paper is supported by the National Natural Science Foundation of China (NSFC31271896) 304

and Shanghai Municipal Natural Science Foundation (12ZR1420500). 305

REFERENCES 306

1. Hui, Y. H. Major Tropical Fruits and Products: Banana, Mango, and Pineapple. In Handbook of 307

Food Products Manufacturing; Po, L. G., Eds.; John Wiley & Sons, Inc.,; Hoboken, NJ, USA, 308

2006; 816-845. 309

2. Food and Agriculture Organization. FAO statistical databases, 2006. Available at: 310

http://faostat3.fao.org/home/index.html. 311

3. Tabatabaeefar, A.; Vefagh-Nematolahee, A.; Rajabipour, A. Modeling of Orange Mass Based 312

on Dimensions. Journal of Agricultural Science and Technology 2000, 2(4), 299-305. 313

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 20: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 19

4. Steffens, C.; Franceschi, E.; Corazza, F. C.; Herrmann, P. S. P.; Oliveira, J. V. Gas Sensors 314

Development Using Supercritical Fluid Technology to Detect the Ripeness of Bananas. Journal of 315

Food Engineering 2010, 101(4), 365-369. 316

5. Zulhusin, Aziz. A. H. A.; Ahmad, R. B. Feasibility Study of a Non-Destructive Fruit Maturity 317

Testing System on Banana Utilising Capacitive Properties, 2008 International Conference on 318

Electronic Design. 2008, 1-4. 319

6. Rajkumar, P.; Wang, N.; Elmasry, G.; Raghavan, G. S. V.; Gariepy, Y. Studies on Banana Fruit 320

Quality and Maturity Stages Using Hyperspectral Imaging. Journal of Food Engineering 2012, 321

108(1), 194-200. 322

7. Mendoza, F.; Aguilera, J. M. Application of Image Analysis for Classification of Ripening 323

Bananas. Journal of Food Science 2004, 69(9), 471-477. 324

8. Subedi, P. P.; Walsh, K. B. Non-Invasive Techniques for Measurement of Fresh Fruit Firmness. 325

Postharvest Biology and Technology 2009, 51(3), 297-304. 326

9. Xu, L. M.; Zhao, Y. C. Automated Strawberry Grading System Based on Image Processing. 327

Computers and Electronics in Agriculture 2010, 71, 32-39. 328

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 21: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 20

10. Radojević, R. L.; Petrović, D. V.; Pavlović, V. B.; Nikolić, Z. M.; Urošević, M. P. Digital 329

Parameterization of Apple Fruit Size, Shape and Surface Spottiness. African Journal of 330

Agricultural Research 2011, 6(13), 3131-3142. 331

11. Li, X. F.; Zhu, W. X. Apple Grading Method Based on Features Fusion of Size, Shape and 332

Color. Procedia Engineering 2011, 15, 2885–2891. 333

12. Rashidi, M.; Keyvan, S. Classification of Fruit Shape in Cantaloupe Using the Analysis of 334

Geometrical Attributes. World Journal of Agricultural Sciences 2007, 3(6), 735-740. 335

13. Sadrnia, H.; Rajabipour, A.; Jafary, A.; Javadi, A.; Mostofi, Y. Classification and Analysis of 336

Fruit Shapes in Long Type Watermelon Using Image Processing International Journal of 337

Agriculture and Biology 2007, 1, 68-70. 338

14. Fellegari, R.; Navid, H. Determining the Orange Volume Using Image Processing, 2011 339

International Conference on Food Engineering and Biotechnology. IPCBEE. 2011, 180-184. 340

15. Omid, M.; Khojastehnazhand, M.; Tabatabaeefar, A. Estimating Volume and Mass of Citrus 341

Fruits by Image Processing Technique. Journal of Food Engineering 2010, 100(2), 315-321. 342

16. Rashidi, M.; Gholami, M. Determination of Kiwifruit Volume Using Ellipsoid Approximation 343

and Image-Processing Methods. International Journal of Agriculture and Biology 2008, 10(4). 344

375-380. 345

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 22: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 21

17. Sabliov, C. M.; Boldor, D.; Keener, K. M.; Farkas, B. E. Image Processing Method to 346

Determine Surface Area and Volume of Axi-Symmetric Agricultural Products. International 347

Journal of Food Properties 2002, 5(3), 641-653. 348

18. Jarimopas, B.; Jaisin, N. An Experimental Machine Vision System for Sorting Sweet 349

Tamarind. Journal of Food Engineering 2008, 89(3), 291-297. 350

19. Mustafa, N. B. A.; Fuad, N. A.; Ahmed, S. K.; Abidin, A. A. Z.; Ali, Z.; Yit, W. B.; Sharrif, Z. 351

A. M. Image Processing of an Agriculture Produce: Determination of Size and Ripeness of a 352

Banana. International Symposium of Information Technology 2008, Vols 1-4, Proceedings: 353

Cognitive Informatics: Bridging Natural and Artificial Knowledge, 733-739. 354

20. Codex Alimentarius Commission. Codex Standard for Banana 2005. 355

21. Soltani, M.; Alimardari, R.; Omid, M. Modeling the Main Physical Properties of Banana Fruit 356

Based on Geometrical Attributes. International Journal of Multidisciplinary Sciences and 357

Engineering 2011, 2(2):1-6. 358

22. Chen, H. B.; Li, J. G.; Feng, Q. R.; Xu, C. X.; Yang, H. N.; Lu, S. Evaluation of Fruit 359

Characteristics of Twenty-Eight Cavendish Subgroup Banana Cultivars (Musa spp., AAA Group). 360

Journal of South China Agriculture University 2004, 25(4), 6-11. (In Chinese with English 361

Abstract) 362

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 23: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 22

23. Cubero, S.; Aleixos, N.; Moltó, E.; Gómez-Sanchis, J.; Blasco, J. Advances in Machine Vision 363

Applications for Automatic Inspection and Quality Evaluation of Fruits and Vegetables. Food and 364

Bioprocess Technology 2011, 4(4), 487-504. 365

24. Codex Alimentarius Commission. Quality Standards for Banana 1994. 366

25. Russ, J. C. The Image Processing Handbook. Press: FL, CRC Press, Boca Raton, 2011. 367

26. Du, C. J.; Sun, D. W. Estimating the Surface Area and Volume of Ellipsoidal Ham Using 368

Computer Vision. Journal of Food Engineering 2006, 73(3), 260-268. 369

27. Blasco, J.; Aleixos, N.; Moltó, E. Machine Vision System for Automatic Quality Grading of 370

Fruit. Biosystems Engineering 2003, 85(4), 415-423. 371

28. Batchelor, M. M.; Searcy, S. W. Computer Vision Determination of the Stem/Root Joint on 372

Processing Carrots. Journal of Agricultural Engineering Research 1989, 43, 259-269. 373

29. Mendoza, F.; Dejmek, P.; Aguilera, J. M. Calibrated Color Measurements of Agricultural 374

Foods Using Image Analysis. Postharvest Biology and Technology 2006, 41(3), 285-295. 375

30. Kang, S. P.; East, A. R.; Trujillo, F. J. Colour Vision System Evaluation of Bicolour Fruit: A 376

Case Study with 'B74' Mango. Postharvest Biology and Technology 2008, 49(1), 77-85. 377

31. Petrozzo, R. A.; Singer, S. W. Telecentric Lenses Simplify Noncontact Metrology. Test & 378

Measurement World 2001, 21(13), 4-99. 379

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 24: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 23

32. Wilson, A. Telecentric Lenses Focus on Machine Vision. Vision Systems Design 2004, 9(1), 380

37-41. 381

33. Du, C. J.; Sun, D. W. Recent Developments in the Applications of Image Processing 382

Techniques for Food Quality Evaluation. Trends in Food Science & Technology 2004, 15(5), 383

230-249. 384

34. Mendoza, F.; Dejmek, P.; Aguilera, J. M. Predicting Ripening Stages of Bananas (Musa 385

cavendish) by Computer Vision. Proceedings of the 5th International Postharvest Symposium. 386

2005, Vols 1-3(682), 1363-1369. 387

Figure Captions 388

Fig. 1 - The main procedure of image pre-processing. 389

Fig. 2 - The indicators of banana size. (L1, L2 and H are the length, the ventral straight length 390

and the arc height of banana, respectively). 391

Fig. 3 - The results of two processes: (a) the right half of banana; (b) the image skeleton of 392

banana. 393

Fig. 4 - Two parts of divided images of banana pre-processed image. 394

Fig.5 - Performances of the three different methods for estimating the length of banana. 395

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 25: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 24

Fig.6 - Performances of the three different methods for estimating the ventral straight 396

length of banana. 397

Fig.7 - Performances of the two different methods for estimating the curvature of banana. 398

Appendix 1- Eighteen bananas (Musa AAA cavendish) with slightly curved and curved fruit 399

shape. 400

Appendix 2-Ten tested banana (Musa AAA cavendish) for validation experiments (banana 401

shape: 1, 2, 3, 4 are slightly curved; 5, 6, 7, 8 are curved and 9, 10 are end-straight.). 402

Appendix 3 – One banana cluster cut from banana hand with three banana finger. 403

(1) 404

(2) 405

(3) 406

(4) 407

408

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 26: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 25

Fig. 1 - The main procedure of image pre-processing. 409

Image acquisition

Binaryzation

Image graying

Image cut

Image enhancement

Object mark 410

411

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 27: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 26

Fig. 2 - The indicators of banana size. (L1, L2 and H are the length, the ventral straight 412 length and the arc height of banana, respectively). 413

L2

First point

Third pointFourth point

Second point

H

L1

Fifth point

414

415

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 28: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 27

Fig. 3 - The results of two processes: (a) the right half of banana; (b) the image skeleton of 416 banana. 417

(a) (b) 418

419

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 29: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 28

Fig. 4 - Two parts of divided images of banana pre-processed image. 420

First point

Fifth pointSecond point

421

422

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 30: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 29

Fig.5 - Performances of the three different methods for estimating the length of banana. 423

424

425

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 31: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 30

Fig.6 - Performances of the three different methods for estimating the ventral straight 426 length of banana. 427

428

429

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 32: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 31

Fig.7 - Performances of the two different methods for estimating the curvature of banana. 430

431

432

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 33: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 32

Appendix 1- Eighteen bananas (Musa AAA cavendish) with slightly curved and curved fruit 433 shape. 434

1 2 3 4 5 6

7 8

9

10 11 12

13 14 15 16 17 18

9

435

436

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 34: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 33

Appendix 2-Ten tested banana (Musa AAA cavendish) for validation experiments (banana 437 shape: 1, 2, 3, 4 are slightly curved; 5, 6, 7, 8 are curved and 9, 10 are end-straight.). 438

1 2 3

4 56 7

8 9 10 439

440

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 35: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 34

Appendix 3 – One banana cluster cut from banana hand with three banana finger. 441

442

443

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 36: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 35

Table 1 The values of the percent difference for the length and the ventral straight length of 444 banana 445

Banana

Number

The length The ventral straight length

Semi-automatic method (%)

Automatic method (%)

Semi-automatic

method (%) Automatic method

(%)

1 1.15 0.34 11.77 8.02

2 2.63 5.48 15.27 6.40

3 3.13 3.57 11.08 9.87

4 2.78 2.24 16.19 7.32

5 0.98 4.15 14.34 12.15

7 5.31 4.02 8.72 10.67

8 1.22 0.09 8.99 7.05

10 5.06 7.07 22.99 21.15

11 13.45 14.44 8.78 3.15

12 4.48 2.35 23.46 13.55

13 6.71 7.03 10.05 10.46

14 4.10 4.93 6.50 0.95

15 12.06 13.86 1.38 2.69

16 10.31 11.02 0.85 0.15

17 5.04 5.81 2.09 4.91

18 3.75 4.56 49.40 49.00

mean±SD 5.13±3.78A 5.68±4.24B 13.24±11.72C 10.47±11.54C

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 37: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 36

1) Means values in the last row with the same letter are not significant different (P>0.05) 446

447

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4

Page 38: Determining Banana Size Based on Computer Vision

ACCEPTED MANUSCRIPT

ACCEPTED MANUSCRIPT 37

Table 2 The percent difference between the manual and automatic method for the length 448 and ventral straight length 449

Banana

Number

The length The ventral straight length

The percent difference (%)

1 4.53 6.54

2 13.41 5.62

3 12.40 4.62

4 12.99 4.72

5 2.19 5.54

6 11.86 9.57

7 3.18 9.25

8 4.10 3.29

9 14.71 11.99

10 15.10 17.76

450

451

Dow

nloa

ded

by [

Ast

on U

nive

rsity

] at

11:

09 2

3 A

ugus

t 201

4