A Robust Machine Vision Algorithm Development for Quality ...

14
Research Article A Robust Machine Vision Algorithm Development for Quality Parameters Extraction of Circular Biscuits and Cookies Digital Images Satyam Srivastava, 1 Sachin Boyat, 2 and Shashikant Sadistap 3 1 ACSIR, CSIR-CEERI, Advanced Electronics Systems, Pilani, Rajasthan 333031, India 2 Karnataka State Open University (KSOU), Pilani, Rajasthan 333031, India 3 CSIR-CEERI, Agri-Electronics Group, Pilani, Rajasthan 333031, India Correspondence should be addressed to Satyam Srivastava; [email protected] Received 18 September 2014; Revised 9 December 2014; Accepted 11 December 2014; Published 31 December 2014 Academic Editor: Franco P. Pedreschi Copyright © 2014 Satyam Srivastava et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Biscuits and cookies are one of the major parts of Indian bakery products. e bake level of biscuits and cookies is of significant value to various bakery products as it determines the taste, texture, number of chocolate chips, uniformity in distribution of chocolate chips, and various features related to appearance of products. Six threshold methods (isodata, Otsu, minimum error, moment preserving, Fuzzy, manual method, and k-mean clustering) have been implemented for chocolate chips extraction from captured cookie image. Various other image processing operations such as entropy calculation, area calculation, parameter calculation, baked dough color, solidity, and fraction of top surface area have been implemented for commercial KrackJack biscuits and cookies. Proposed algorithm is able to detect and investigate about various defects such as crack and various spots. A simple and low cost machine vision system with improved version of robust algorithm for quality detection and identification is envisaged. Developed system and robust algorithm have a great application in various biscuit and cookies baking companies. Proposed system is composed of a monochromatic light source, and USB based 10.0 megapixel camera interfaced with ARM-9 processor for image acquisition. MATLAB version 5.2 has been used for development of robust algorithms and testing for various captured frames. Developed methods and procedures were tested on commercial biscuits resulting in the specificity and sensitivity of more than 94% and 82%, respectively. Since developed soſtware package has been tested on commercial biscuits, it can be programmed to inspect other manufactured bakery products. 1. Introduction Automating visual inspection based quality control processes are highly desirable for manufacturing companies as it significantly reduces manufacturing costs and can provide for greater accuracy in the monitoring of their manufacturing processes for different biscuits varieties [1]. Physical features present on cookies can be examined by employing various image processing algorithms to extract various features of importance [2]. A wide array of image acquisition technology is available that helps make this automation efficient and cost effective [3]. Developed algorithm also greatly simplifies the image processing techniques used in an automation process by handling at acquisition level common problems such as light reflection and color variation in an acquired image. Various physical parameters have been extracted using developed algorithm such as convex area, solidity, change in color, and convex hull. Higher level of image processing has been implemented for integration of quality features for commercial biscuits collected in database. Very few researchers contributed their work in this area. Some of the reviewed work has been shared as follows. Chocolate chips counting by multiple image operations has been reported by Chang [4]. He used various image processing operations for quality parameters extraction from cookies such as HSI color extraction and various morphological operations (dilation, erosion, and filtering). Automated Tallying of Chocolate Chips Hindawi Publishing Corporation Journal of Food Processing Volume 2014, Article ID 376360, 13 pages http://dx.doi.org/10.1155/2014/376360

Transcript of A Robust Machine Vision Algorithm Development for Quality ...

Page 1: A Robust Machine Vision Algorithm Development for Quality ...

Research ArticleA Robust Machine Vision Algorithm Development forQuality Parameters Extraction of Circular Biscuits andCookies Digital Images

Satyam Srivastava1 Sachin Boyat2 and Shashikant Sadistap3

1ACSIR CSIR-CEERI Advanced Electronics Systems Pilani Rajasthan 333031 India2Karnataka State Open University (KSOU) Pilani Rajasthan 333031 India3CSIR-CEERI Agri-Electronics Group Pilani Rajasthan 333031 India

Correspondence should be addressed to Satyam Srivastava satyamsrivastava2442gmailcom

Received 18 September 2014 Revised 9 December 2014 Accepted 11 December 2014 Published 31 December 2014

Academic Editor Franco P Pedreschi

Copyright copy 2014 Satyam Srivastava et al This is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work is properlycited

Biscuits and cookies are one of themajor parts of Indian bakery productsThe bake level of biscuits and cookies is of significant valueto various bakery products as it determines the taste texture number of chocolate chips uniformity in distribution of chocolatechips and various features related to appearance of products Six threshold methods (isodata Otsu minimum error momentpreserving Fuzzy manual method and k-mean clustering) have been implemented for chocolate chips extraction from capturedcookie image Various other image processing operations such as entropy calculation area calculation parameter calculationbaked dough color solidity and fraction of top surface area have been implemented for commercial KrackJack biscuits andcookies Proposed algorithm is able to detect and investigate about various defects such as crack and various spots A simple andlow cost machine vision system with improved version of robust algorithm for quality detection and identification is envisagedDeveloped system and robust algorithm have a great application in various biscuit and cookies baking companies Proposed systemis composed of a monochromatic light source and USB based 100 megapixel camera interfaced with ARM-9 processor for imageacquisition MATLAB version 52 has been used for development of robust algorithms and testing for various captured framesDeveloped methods and procedures were tested on commercial biscuits resulting in the specificity and sensitivity of more than94 and 82 respectively Since developed software package has been tested on commercial biscuits it can be programmed toinspect other manufactured bakery products

1 Introduction

Automating visual inspection based quality control processesare highly desirable for manufacturing companies as itsignificantly reducesmanufacturing costs and can provide forgreater accuracy in the monitoring of their manufacturingprocesses for different biscuits varieties [1] Physical featurespresent on cookies can be examined by employing variousimage processing algorithms to extract various features ofimportance [2] Awide array of image acquisition technologyis available that helps make this automation efficient andcost effective [3] Developed algorithm also greatly simplifiesthe image processing techniques used in an automationprocess by handling at acquisition level common problems

such as light reflection and color variation in an acquiredimageVarious physical parameters have been extracted usingdeveloped algorithm such as convex area solidity changein color and convex hull Higher level of image processinghas been implemented for integration of quality featuresfor commercial biscuits collected in database Very fewresearchers contributed their work in this area Some of thereviewed work has been shared as follows Chocolate chipscounting by multiple image operations has been reported byChang [4] He used various image processing operations forquality parameters extraction from cookies such as HSI colorextraction and various morphological operations (dilationerosion and filtering) Automated Tallying of Chocolate Chips

Hindawi Publishing CorporationJournal of Food ProcessingVolume 2014 Article ID 376360 13 pageshttpdxdoiorg1011552014376360

2 Journal of Food Processing

Camera controllerARM based

processor unit

Signal conditioning and filtering

Wireless ZigBee

transmitter

PC based server

Color filtersCamera controller

USB based camera

Intensity controlling slits

Sample (biscuit)

Monochromaticlight source

Tx

Rx

Figure 1 Experimental setup for biscuit image acquisition

Using Color Segmentation has been reported by James East-man

Author implemented color segmentation dynamic thres-hold and various morphological operations for extractingand counting the number of chocolate chips from cookies [5]Roberts and Merat reported about surface feature detectionfor quality assurance with cookies Various surface featureshave been extracted related to quality parameters using colorsegmentation and morphological operations [6] Johannsenreported a different methodology for counting the numberof chocolate chips from cookies using various morphologicaloperators such as erosion dilation and boundary extraction[7] Presented work has been tested on commercial biscuitsbut it can be used for other bakery products Guillard et alreported a model for change in diffusivity calculation dueto moisture transfer at 20∘C in various dry biscuits [8] Aprototype artificial neural network system for assessmentof bake level of biscuits has been implemented by Yeh andHamey [9] A robust automatic crack detection methodfor nonuniform color distributions on texture images isproposed by Abdullah et al [10] In this method a newimage segmentation technique is developedwhere theHoughtransform is used for feature extractionA simple and low costmachine vision system for fault detection and identificationhas been developed by Ganesan et al [11]

2 Material and Methods

21 Image Acquisition and Database Preparation The cook-ies and commercial biscuits used are from a study [12]investigating the various characteristics about baking timeorganic flours change in color and so forth 100 circularKrackJack biscuit pieces (area = 5026 cm2 and 10 gram)with 50 different cookies (area = 3848 cm2 and 14 gram)are collected from local market and preserved in differentenvironmental conditions such as moist open and packedA 100 megapixel USB based camera has been interfaced withARM-9 based embedded system for image acquisition Totaltwenty cookies and commercial KrackJack biscuit digitalimages were captured using 100 megapixel cameras andsaved in JPEG format Image acquisition experimental setup(Figure 1) is composed of USB based camera with ARM-9 based developed embedded system monochromatic lightsource color filters and light controlling slits and is installedin a black color aluminum chamber Color filters have beenused for validation of extracted color index using developedalgorithm and also for detailed color analysis in RGB domainseparately

Preliminary captured images (Figure 2) brightness andlightness are to be adjusted to minus1 and 50 for each color plane(red green and blue (RGB)) respectively Standard imagetool software (UTHSCA Image Tool v20) was cropped to 535

Journal of Food Processing 3

Figure 2 Collected commercial cookies and KrackJack biscuit gray-level images of 40 times 40mm2 field of view

times 535 pixels (representing 40 times 40mm2 of frame area) andwas finally converted into gray-level images (8 bits) Collectedbiscuits samples have been preserved in different kind ofenvironmental conditions such as controlled (119879 = 40∘C andRH = 80) moist (119879 = 15∘C and RH = 30) householdrefrigerator (119879 = 8∘C and RH = 70) and open (119879 = 27∘Cand RH = 50) (see Figure 3)

22 Proposed Algorithm A digital image is a two-dime-nsional discrete function 119891(119909 119910) which has been digitizedboth in spatial coordinates and inmagnitude of feature valueAcquired image processed through implemented segmen-tation process follows through the preprocessing steps likenoise removal image calibration and so forth Hundredsof segmentation techniques are present in the literature andalmost are all ad hoc in nature [12] However neither singlemethod can be considered better enough for all images norall methods do equally good for a particular type of image[12] (see Figure 4) The calculated entropy is extracted fromgray-level cooccurrence matrix (GLCM) for texture qualityinspection Entropy is used to characterize the texture ofthe segmented image by statistical measure of randomnessOther quality parameters related to physical appearance ofthe biscuits and cookies have been extracted using area andparameter calculation Red green and blue (RGB) huesaturation and intensity (HSI) and gamma (YCbCr) colormodels have been used for extraction of color with respect toproperties for cookies and commercial biscuits (see Table 1)

221 Segmentation Techniques Seven standard techniquesof threshold have been implemented and compared forsegmentation purpose The exact value of the threshold hasconsiderable effect on effect on the boundary position andtherefore on the overall size of the extracted objects 119896-mean

clustering also has been implemented with manual thresholdmethod for segmentation of commercial biscuits and cookies

(a) Isodata Thresholding Algorithm [13] This irrelative tech-nique for choosing a threshold was developed by DiasVelasco The histogram is initially segmented into two partsusing a starting threshold value such as 120579

0 which is half of the

maximum dynamic range Consider

120579

119896= 2

119887minus1

(1)

where 119887 corresponds to various gray levels present in gray-level images

The sample mean (1198981198910) value of gray values of con-

verted image associated with the foreground pixels and thesample mean (119898

1198870) of the gray values associated with the

background pixels have been computed In order to calculatenew threshold 120579

1 system calculates average of the two sample

means This process is repeated until the new calculatedthreshold value remains unchanged Consider

120579

119896=

119898

119891119896minus1+ 119898

119887119896minus1

2

Until 120579119896= 120579

119896minus1

(2)

(b) Otsursquos Thresholding Algorithm [14] Otsursquos method [15]has been used to automatically perform clustering basedimage threshold or the reduction of a gray-level image toa binary image This technique assumes that the imagecontains two classes of pixels following bimodal histogram(foreground and background pixels) System then calculatesthe optimum threshold separating the two classes so thattheir combined spread (intraclass variance) is minimal Inthis method algorithm exhaustively extract for the thresholdthat minimizes an intraclass variance (within the class) canbe defined as a weighted sum of variances of two classes suchthat

120590

2

120596

(119905) = 119902

1(119905) 120590

2

1

(119905) + 119902

2(119905) 120590

2

2

(119905) (3)

4 Journal of Food Processing

(a) (b) (c) (d)

Figure 3 Biscuit samples preserved in different environmental conditions (a) moist (b) controlled (c) open and (d) refrigerator

Table 1 Color extraction using RGB color model for various biscuit samples preserved in different environmental conditions

Serialnumber

Environmentalconditions

Inputimages

Redcomponent

Greencomponent

Bluecomponent Parameter ()

1 OpenR = 333G = 50B = 1667

2 MoistR = 9401G = 512B = 0854

3 FrozenR = 1667G = 6667B = 1667

4 ControlledR = 60G = 20B = 20

where 119902119894(119905) is the probability of the two classes separated by a

threshold 119905 and 1205902119894

is variance of these classes

119902

1(119905) =

119899

sum

119894=1

119875 (119894)

119902

2(119905) =

119868

sum

119894=119899+1

119875 (119894)

(4)

Otsu shows thatminimizing an intraclass variance is the sameas maximizing interclass variance

120590

2

119887

(119905) = 120590

2

minus 120590

2

120596

(119905)

120590

2

119887

(119905) = 120596

1(119905) 120596

2(119905) [120583

1(119905) minus 120583

2(119905)]

2

(5)

where 120596119894and 120583

119894correspond to class probabilities and means

respectively Class probabilities 120596119894have been computed from

the extracted histogram as 119905 while class means 120583119894are as

follows

120583

1(119905) =

119899

sum

119894=1

119894119875 (119894)

119902

1(119905)

120583

2(119905) =

119868

sum

119894=119899+1

119894119875 (119894)

119902

2(119905)

(6)

(c) Minimum Error Thresholding Algorithm [16] In thisalgorithm developed by Kittler and Illingworth the gray-level histogram is viewed as an estimate of the probabilitydensity function of the mixture population comprising thegrey levels of the objects and background (119895 = 1 2 3) Eachelement of GL image is normally distributed with mean119898(119895)and standard deviation 120590(119895) and probability of 119901(119895) These

Journal of Food Processing 5

(a) (b) (c)

(d) (e) (f)

Figure 4 Binary images of input cookie image (a) isodata threshold (thresh = 07020) (b) Otsursquos threshold (thresh = 06299) (c) manualmethod (d) fuzzy based threshold (thresh = 0480292) (e) minimum error threshold (thresh = 09961) and (f) 119896-mean clustering

parameters are generally not usually known and instead acreation function 119895(119905) is used

119869 (119905) = 1 + 2 lowast [119875

1(119905) ln120590

1(119905) + 119875

2(119905) ln120590

2(119905)]

minus 2 [119875

1(119905) ln119875

1(119905) + 119875

2(119905) ln119875

2(119905)]

(7)

where

119875

1(119905) =

119868

sum

119894=1

119875 (119894)

119875

1(119905) =

119871minus1

sum

119894=119868+1

119875 (119894) = 1 minus 119875

1(119905)

119898

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

119894 lowast 119875 (119894)

119898

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

119894 lowast 119875 (119894)

120590

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

[1 minus 119898

1(119905)]

2

lowast 119875 (119894)

120590

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

[1 minus 119898

2(119905)]

2

lowast 119875 (119894)

(8)

The optimal threshold 119905lowast is obtained by

119869 (119905

lowast

) = min 119869 (119905) (9)

(d) k-Mean Clustering Algorithm [17] 119896-mean clustering isa method of vector quantization cluster analysis in a giveninput image consisting of various clusters This algorithmaims to partition 119899 observations into 119896 clusters in which eachobservation belongs to the cluster with the nearest meanserving as a prototype of the various clusters This techniquecalculates Euclidian distance from a random selected meaneach presenting in a cluster in an observation and trying tominimize the calculated Euclidian distance by shifting thepoint to its nearest cluster Distance between different pointsand cluster has been calculated using the following relations

(Ed)2 = min 1205831sdot sdot sdot 120583

119896

119894=119899

sum

119894=1

119895=119899

sum

119895=1

1003816

1003816

1003816

1003816

1003816

119883 (119894 119895) minus 120583

21003816

1003816

1003816

1003816

1003816

120583

ℎ=

sum

119894=119899

119894=1

119875 (119894) lowast 119894

sum

119894=119899

119894=1

119875 (119894)

(10)

(e) Fuzzy Thresholding Algorithm [18] Fuzzy set theory hasbeen used for partitioning an image space by minimizingthe measure of fuzziness of an image This measurementcan be expressed as entropy which is index of fuzziness and

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 2: A Robust Machine Vision Algorithm Development for Quality ...

2 Journal of Food Processing

Camera controllerARM based

processor unit

Signal conditioning and filtering

Wireless ZigBee

transmitter

PC based server

Color filtersCamera controller

USB based camera

Intensity controlling slits

Sample (biscuit)

Monochromaticlight source

Tx

Rx

Figure 1 Experimental setup for biscuit image acquisition

Using Color Segmentation has been reported by James East-man

Author implemented color segmentation dynamic thres-hold and various morphological operations for extractingand counting the number of chocolate chips from cookies [5]Roberts and Merat reported about surface feature detectionfor quality assurance with cookies Various surface featureshave been extracted related to quality parameters using colorsegmentation and morphological operations [6] Johannsenreported a different methodology for counting the numberof chocolate chips from cookies using various morphologicaloperators such as erosion dilation and boundary extraction[7] Presented work has been tested on commercial biscuitsbut it can be used for other bakery products Guillard et alreported a model for change in diffusivity calculation dueto moisture transfer at 20∘C in various dry biscuits [8] Aprototype artificial neural network system for assessmentof bake level of biscuits has been implemented by Yeh andHamey [9] A robust automatic crack detection methodfor nonuniform color distributions on texture images isproposed by Abdullah et al [10] In this method a newimage segmentation technique is developedwhere theHoughtransform is used for feature extractionA simple and low costmachine vision system for fault detection and identificationhas been developed by Ganesan et al [11]

2 Material and Methods

21 Image Acquisition and Database Preparation The cook-ies and commercial biscuits used are from a study [12]investigating the various characteristics about baking timeorganic flours change in color and so forth 100 circularKrackJack biscuit pieces (area = 5026 cm2 and 10 gram)with 50 different cookies (area = 3848 cm2 and 14 gram)are collected from local market and preserved in differentenvironmental conditions such as moist open and packedA 100 megapixel USB based camera has been interfaced withARM-9 based embedded system for image acquisition Totaltwenty cookies and commercial KrackJack biscuit digitalimages were captured using 100 megapixel cameras andsaved in JPEG format Image acquisition experimental setup(Figure 1) is composed of USB based camera with ARM-9 based developed embedded system monochromatic lightsource color filters and light controlling slits and is installedin a black color aluminum chamber Color filters have beenused for validation of extracted color index using developedalgorithm and also for detailed color analysis in RGB domainseparately

Preliminary captured images (Figure 2) brightness andlightness are to be adjusted to minus1 and 50 for each color plane(red green and blue (RGB)) respectively Standard imagetool software (UTHSCA Image Tool v20) was cropped to 535

Journal of Food Processing 3

Figure 2 Collected commercial cookies and KrackJack biscuit gray-level images of 40 times 40mm2 field of view

times 535 pixels (representing 40 times 40mm2 of frame area) andwas finally converted into gray-level images (8 bits) Collectedbiscuits samples have been preserved in different kind ofenvironmental conditions such as controlled (119879 = 40∘C andRH = 80) moist (119879 = 15∘C and RH = 30) householdrefrigerator (119879 = 8∘C and RH = 70) and open (119879 = 27∘Cand RH = 50) (see Figure 3)

22 Proposed Algorithm A digital image is a two-dime-nsional discrete function 119891(119909 119910) which has been digitizedboth in spatial coordinates and inmagnitude of feature valueAcquired image processed through implemented segmen-tation process follows through the preprocessing steps likenoise removal image calibration and so forth Hundredsof segmentation techniques are present in the literature andalmost are all ad hoc in nature [12] However neither singlemethod can be considered better enough for all images norall methods do equally good for a particular type of image[12] (see Figure 4) The calculated entropy is extracted fromgray-level cooccurrence matrix (GLCM) for texture qualityinspection Entropy is used to characterize the texture ofthe segmented image by statistical measure of randomnessOther quality parameters related to physical appearance ofthe biscuits and cookies have been extracted using area andparameter calculation Red green and blue (RGB) huesaturation and intensity (HSI) and gamma (YCbCr) colormodels have been used for extraction of color with respect toproperties for cookies and commercial biscuits (see Table 1)

221 Segmentation Techniques Seven standard techniquesof threshold have been implemented and compared forsegmentation purpose The exact value of the threshold hasconsiderable effect on effect on the boundary position andtherefore on the overall size of the extracted objects 119896-mean

clustering also has been implemented with manual thresholdmethod for segmentation of commercial biscuits and cookies

(a) Isodata Thresholding Algorithm [13] This irrelative tech-nique for choosing a threshold was developed by DiasVelasco The histogram is initially segmented into two partsusing a starting threshold value such as 120579

0 which is half of the

maximum dynamic range Consider

120579

119896= 2

119887minus1

(1)

where 119887 corresponds to various gray levels present in gray-level images

The sample mean (1198981198910) value of gray values of con-

verted image associated with the foreground pixels and thesample mean (119898

1198870) of the gray values associated with the

background pixels have been computed In order to calculatenew threshold 120579

1 system calculates average of the two sample

means This process is repeated until the new calculatedthreshold value remains unchanged Consider

120579

119896=

119898

119891119896minus1+ 119898

119887119896minus1

2

Until 120579119896= 120579

119896minus1

(2)

(b) Otsursquos Thresholding Algorithm [14] Otsursquos method [15]has been used to automatically perform clustering basedimage threshold or the reduction of a gray-level image toa binary image This technique assumes that the imagecontains two classes of pixels following bimodal histogram(foreground and background pixels) System then calculatesthe optimum threshold separating the two classes so thattheir combined spread (intraclass variance) is minimal Inthis method algorithm exhaustively extract for the thresholdthat minimizes an intraclass variance (within the class) canbe defined as a weighted sum of variances of two classes suchthat

120590

2

120596

(119905) = 119902

1(119905) 120590

2

1

(119905) + 119902

2(119905) 120590

2

2

(119905) (3)

4 Journal of Food Processing

(a) (b) (c) (d)

Figure 3 Biscuit samples preserved in different environmental conditions (a) moist (b) controlled (c) open and (d) refrigerator

Table 1 Color extraction using RGB color model for various biscuit samples preserved in different environmental conditions

Serialnumber

Environmentalconditions

Inputimages

Redcomponent

Greencomponent

Bluecomponent Parameter ()

1 OpenR = 333G = 50B = 1667

2 MoistR = 9401G = 512B = 0854

3 FrozenR = 1667G = 6667B = 1667

4 ControlledR = 60G = 20B = 20

where 119902119894(119905) is the probability of the two classes separated by a

threshold 119905 and 1205902119894

is variance of these classes

119902

1(119905) =

119899

sum

119894=1

119875 (119894)

119902

2(119905) =

119868

sum

119894=119899+1

119875 (119894)

(4)

Otsu shows thatminimizing an intraclass variance is the sameas maximizing interclass variance

120590

2

119887

(119905) = 120590

2

minus 120590

2

120596

(119905)

120590

2

119887

(119905) = 120596

1(119905) 120596

2(119905) [120583

1(119905) minus 120583

2(119905)]

2

(5)

where 120596119894and 120583

119894correspond to class probabilities and means

respectively Class probabilities 120596119894have been computed from

the extracted histogram as 119905 while class means 120583119894are as

follows

120583

1(119905) =

119899

sum

119894=1

119894119875 (119894)

119902

1(119905)

120583

2(119905) =

119868

sum

119894=119899+1

119894119875 (119894)

119902

2(119905)

(6)

(c) Minimum Error Thresholding Algorithm [16] In thisalgorithm developed by Kittler and Illingworth the gray-level histogram is viewed as an estimate of the probabilitydensity function of the mixture population comprising thegrey levels of the objects and background (119895 = 1 2 3) Eachelement of GL image is normally distributed with mean119898(119895)and standard deviation 120590(119895) and probability of 119901(119895) These

Journal of Food Processing 5

(a) (b) (c)

(d) (e) (f)

Figure 4 Binary images of input cookie image (a) isodata threshold (thresh = 07020) (b) Otsursquos threshold (thresh = 06299) (c) manualmethod (d) fuzzy based threshold (thresh = 0480292) (e) minimum error threshold (thresh = 09961) and (f) 119896-mean clustering

parameters are generally not usually known and instead acreation function 119895(119905) is used

119869 (119905) = 1 + 2 lowast [119875

1(119905) ln120590

1(119905) + 119875

2(119905) ln120590

2(119905)]

minus 2 [119875

1(119905) ln119875

1(119905) + 119875

2(119905) ln119875

2(119905)]

(7)

where

119875

1(119905) =

119868

sum

119894=1

119875 (119894)

119875

1(119905) =

119871minus1

sum

119894=119868+1

119875 (119894) = 1 minus 119875

1(119905)

119898

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

119894 lowast 119875 (119894)

119898

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

119894 lowast 119875 (119894)

120590

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

[1 minus 119898

1(119905)]

2

lowast 119875 (119894)

120590

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

[1 minus 119898

2(119905)]

2

lowast 119875 (119894)

(8)

The optimal threshold 119905lowast is obtained by

119869 (119905

lowast

) = min 119869 (119905) (9)

(d) k-Mean Clustering Algorithm [17] 119896-mean clustering isa method of vector quantization cluster analysis in a giveninput image consisting of various clusters This algorithmaims to partition 119899 observations into 119896 clusters in which eachobservation belongs to the cluster with the nearest meanserving as a prototype of the various clusters This techniquecalculates Euclidian distance from a random selected meaneach presenting in a cluster in an observation and trying tominimize the calculated Euclidian distance by shifting thepoint to its nearest cluster Distance between different pointsand cluster has been calculated using the following relations

(Ed)2 = min 1205831sdot sdot sdot 120583

119896

119894=119899

sum

119894=1

119895=119899

sum

119895=1

1003816

1003816

1003816

1003816

1003816

119883 (119894 119895) minus 120583

21003816

1003816

1003816

1003816

1003816

120583

ℎ=

sum

119894=119899

119894=1

119875 (119894) lowast 119894

sum

119894=119899

119894=1

119875 (119894)

(10)

(e) Fuzzy Thresholding Algorithm [18] Fuzzy set theory hasbeen used for partitioning an image space by minimizingthe measure of fuzziness of an image This measurementcan be expressed as entropy which is index of fuzziness and

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 3: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 3

Figure 2 Collected commercial cookies and KrackJack biscuit gray-level images of 40 times 40mm2 field of view

times 535 pixels (representing 40 times 40mm2 of frame area) andwas finally converted into gray-level images (8 bits) Collectedbiscuits samples have been preserved in different kind ofenvironmental conditions such as controlled (119879 = 40∘C andRH = 80) moist (119879 = 15∘C and RH = 30) householdrefrigerator (119879 = 8∘C and RH = 70) and open (119879 = 27∘Cand RH = 50) (see Figure 3)

22 Proposed Algorithm A digital image is a two-dime-nsional discrete function 119891(119909 119910) which has been digitizedboth in spatial coordinates and inmagnitude of feature valueAcquired image processed through implemented segmen-tation process follows through the preprocessing steps likenoise removal image calibration and so forth Hundredsof segmentation techniques are present in the literature andalmost are all ad hoc in nature [12] However neither singlemethod can be considered better enough for all images norall methods do equally good for a particular type of image[12] (see Figure 4) The calculated entropy is extracted fromgray-level cooccurrence matrix (GLCM) for texture qualityinspection Entropy is used to characterize the texture ofthe segmented image by statistical measure of randomnessOther quality parameters related to physical appearance ofthe biscuits and cookies have been extracted using area andparameter calculation Red green and blue (RGB) huesaturation and intensity (HSI) and gamma (YCbCr) colormodels have been used for extraction of color with respect toproperties for cookies and commercial biscuits (see Table 1)

221 Segmentation Techniques Seven standard techniquesof threshold have been implemented and compared forsegmentation purpose The exact value of the threshold hasconsiderable effect on effect on the boundary position andtherefore on the overall size of the extracted objects 119896-mean

clustering also has been implemented with manual thresholdmethod for segmentation of commercial biscuits and cookies

(a) Isodata Thresholding Algorithm [13] This irrelative tech-nique for choosing a threshold was developed by DiasVelasco The histogram is initially segmented into two partsusing a starting threshold value such as 120579

0 which is half of the

maximum dynamic range Consider

120579

119896= 2

119887minus1

(1)

where 119887 corresponds to various gray levels present in gray-level images

The sample mean (1198981198910) value of gray values of con-

verted image associated with the foreground pixels and thesample mean (119898

1198870) of the gray values associated with the

background pixels have been computed In order to calculatenew threshold 120579

1 system calculates average of the two sample

means This process is repeated until the new calculatedthreshold value remains unchanged Consider

120579

119896=

119898

119891119896minus1+ 119898

119887119896minus1

2

Until 120579119896= 120579

119896minus1

(2)

(b) Otsursquos Thresholding Algorithm [14] Otsursquos method [15]has been used to automatically perform clustering basedimage threshold or the reduction of a gray-level image toa binary image This technique assumes that the imagecontains two classes of pixels following bimodal histogram(foreground and background pixels) System then calculatesthe optimum threshold separating the two classes so thattheir combined spread (intraclass variance) is minimal Inthis method algorithm exhaustively extract for the thresholdthat minimizes an intraclass variance (within the class) canbe defined as a weighted sum of variances of two classes suchthat

120590

2

120596

(119905) = 119902

1(119905) 120590

2

1

(119905) + 119902

2(119905) 120590

2

2

(119905) (3)

4 Journal of Food Processing

(a) (b) (c) (d)

Figure 3 Biscuit samples preserved in different environmental conditions (a) moist (b) controlled (c) open and (d) refrigerator

Table 1 Color extraction using RGB color model for various biscuit samples preserved in different environmental conditions

Serialnumber

Environmentalconditions

Inputimages

Redcomponent

Greencomponent

Bluecomponent Parameter ()

1 OpenR = 333G = 50B = 1667

2 MoistR = 9401G = 512B = 0854

3 FrozenR = 1667G = 6667B = 1667

4 ControlledR = 60G = 20B = 20

where 119902119894(119905) is the probability of the two classes separated by a

threshold 119905 and 1205902119894

is variance of these classes

119902

1(119905) =

119899

sum

119894=1

119875 (119894)

119902

2(119905) =

119868

sum

119894=119899+1

119875 (119894)

(4)

Otsu shows thatminimizing an intraclass variance is the sameas maximizing interclass variance

120590

2

119887

(119905) = 120590

2

minus 120590

2

120596

(119905)

120590

2

119887

(119905) = 120596

1(119905) 120596

2(119905) [120583

1(119905) minus 120583

2(119905)]

2

(5)

where 120596119894and 120583

119894correspond to class probabilities and means

respectively Class probabilities 120596119894have been computed from

the extracted histogram as 119905 while class means 120583119894are as

follows

120583

1(119905) =

119899

sum

119894=1

119894119875 (119894)

119902

1(119905)

120583

2(119905) =

119868

sum

119894=119899+1

119894119875 (119894)

119902

2(119905)

(6)

(c) Minimum Error Thresholding Algorithm [16] In thisalgorithm developed by Kittler and Illingworth the gray-level histogram is viewed as an estimate of the probabilitydensity function of the mixture population comprising thegrey levels of the objects and background (119895 = 1 2 3) Eachelement of GL image is normally distributed with mean119898(119895)and standard deviation 120590(119895) and probability of 119901(119895) These

Journal of Food Processing 5

(a) (b) (c)

(d) (e) (f)

Figure 4 Binary images of input cookie image (a) isodata threshold (thresh = 07020) (b) Otsursquos threshold (thresh = 06299) (c) manualmethod (d) fuzzy based threshold (thresh = 0480292) (e) minimum error threshold (thresh = 09961) and (f) 119896-mean clustering

parameters are generally not usually known and instead acreation function 119895(119905) is used

119869 (119905) = 1 + 2 lowast [119875

1(119905) ln120590

1(119905) + 119875

2(119905) ln120590

2(119905)]

minus 2 [119875

1(119905) ln119875

1(119905) + 119875

2(119905) ln119875

2(119905)]

(7)

where

119875

1(119905) =

119868

sum

119894=1

119875 (119894)

119875

1(119905) =

119871minus1

sum

119894=119868+1

119875 (119894) = 1 minus 119875

1(119905)

119898

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

119894 lowast 119875 (119894)

119898

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

119894 lowast 119875 (119894)

120590

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

[1 minus 119898

1(119905)]

2

lowast 119875 (119894)

120590

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

[1 minus 119898

2(119905)]

2

lowast 119875 (119894)

(8)

The optimal threshold 119905lowast is obtained by

119869 (119905

lowast

) = min 119869 (119905) (9)

(d) k-Mean Clustering Algorithm [17] 119896-mean clustering isa method of vector quantization cluster analysis in a giveninput image consisting of various clusters This algorithmaims to partition 119899 observations into 119896 clusters in which eachobservation belongs to the cluster with the nearest meanserving as a prototype of the various clusters This techniquecalculates Euclidian distance from a random selected meaneach presenting in a cluster in an observation and trying tominimize the calculated Euclidian distance by shifting thepoint to its nearest cluster Distance between different pointsand cluster has been calculated using the following relations

(Ed)2 = min 1205831sdot sdot sdot 120583

119896

119894=119899

sum

119894=1

119895=119899

sum

119895=1

1003816

1003816

1003816

1003816

1003816

119883 (119894 119895) minus 120583

21003816

1003816

1003816

1003816

1003816

120583

ℎ=

sum

119894=119899

119894=1

119875 (119894) lowast 119894

sum

119894=119899

119894=1

119875 (119894)

(10)

(e) Fuzzy Thresholding Algorithm [18] Fuzzy set theory hasbeen used for partitioning an image space by minimizingthe measure of fuzziness of an image This measurementcan be expressed as entropy which is index of fuzziness and

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 4: A Robust Machine Vision Algorithm Development for Quality ...

4 Journal of Food Processing

(a) (b) (c) (d)

Figure 3 Biscuit samples preserved in different environmental conditions (a) moist (b) controlled (c) open and (d) refrigerator

Table 1 Color extraction using RGB color model for various biscuit samples preserved in different environmental conditions

Serialnumber

Environmentalconditions

Inputimages

Redcomponent

Greencomponent

Bluecomponent Parameter ()

1 OpenR = 333G = 50B = 1667

2 MoistR = 9401G = 512B = 0854

3 FrozenR = 1667G = 6667B = 1667

4 ControlledR = 60G = 20B = 20

where 119902119894(119905) is the probability of the two classes separated by a

threshold 119905 and 1205902119894

is variance of these classes

119902

1(119905) =

119899

sum

119894=1

119875 (119894)

119902

2(119905) =

119868

sum

119894=119899+1

119875 (119894)

(4)

Otsu shows thatminimizing an intraclass variance is the sameas maximizing interclass variance

120590

2

119887

(119905) = 120590

2

minus 120590

2

120596

(119905)

120590

2

119887

(119905) = 120596

1(119905) 120596

2(119905) [120583

1(119905) minus 120583

2(119905)]

2

(5)

where 120596119894and 120583

119894correspond to class probabilities and means

respectively Class probabilities 120596119894have been computed from

the extracted histogram as 119905 while class means 120583119894are as

follows

120583

1(119905) =

119899

sum

119894=1

119894119875 (119894)

119902

1(119905)

120583

2(119905) =

119868

sum

119894=119899+1

119894119875 (119894)

119902

2(119905)

(6)

(c) Minimum Error Thresholding Algorithm [16] In thisalgorithm developed by Kittler and Illingworth the gray-level histogram is viewed as an estimate of the probabilitydensity function of the mixture population comprising thegrey levels of the objects and background (119895 = 1 2 3) Eachelement of GL image is normally distributed with mean119898(119895)and standard deviation 120590(119895) and probability of 119901(119895) These

Journal of Food Processing 5

(a) (b) (c)

(d) (e) (f)

Figure 4 Binary images of input cookie image (a) isodata threshold (thresh = 07020) (b) Otsursquos threshold (thresh = 06299) (c) manualmethod (d) fuzzy based threshold (thresh = 0480292) (e) minimum error threshold (thresh = 09961) and (f) 119896-mean clustering

parameters are generally not usually known and instead acreation function 119895(119905) is used

119869 (119905) = 1 + 2 lowast [119875

1(119905) ln120590

1(119905) + 119875

2(119905) ln120590

2(119905)]

minus 2 [119875

1(119905) ln119875

1(119905) + 119875

2(119905) ln119875

2(119905)]

(7)

where

119875

1(119905) =

119868

sum

119894=1

119875 (119894)

119875

1(119905) =

119871minus1

sum

119894=119868+1

119875 (119894) = 1 minus 119875

1(119905)

119898

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

119894 lowast 119875 (119894)

119898

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

119894 lowast 119875 (119894)

120590

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

[1 minus 119898

1(119905)]

2

lowast 119875 (119894)

120590

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

[1 minus 119898

2(119905)]

2

lowast 119875 (119894)

(8)

The optimal threshold 119905lowast is obtained by

119869 (119905

lowast

) = min 119869 (119905) (9)

(d) k-Mean Clustering Algorithm [17] 119896-mean clustering isa method of vector quantization cluster analysis in a giveninput image consisting of various clusters This algorithmaims to partition 119899 observations into 119896 clusters in which eachobservation belongs to the cluster with the nearest meanserving as a prototype of the various clusters This techniquecalculates Euclidian distance from a random selected meaneach presenting in a cluster in an observation and trying tominimize the calculated Euclidian distance by shifting thepoint to its nearest cluster Distance between different pointsand cluster has been calculated using the following relations

(Ed)2 = min 1205831sdot sdot sdot 120583

119896

119894=119899

sum

119894=1

119895=119899

sum

119895=1

1003816

1003816

1003816

1003816

1003816

119883 (119894 119895) minus 120583

21003816

1003816

1003816

1003816

1003816

120583

ℎ=

sum

119894=119899

119894=1

119875 (119894) lowast 119894

sum

119894=119899

119894=1

119875 (119894)

(10)

(e) Fuzzy Thresholding Algorithm [18] Fuzzy set theory hasbeen used for partitioning an image space by minimizingthe measure of fuzziness of an image This measurementcan be expressed as entropy which is index of fuzziness and

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 5: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 5

(a) (b) (c)

(d) (e) (f)

Figure 4 Binary images of input cookie image (a) isodata threshold (thresh = 07020) (b) Otsursquos threshold (thresh = 06299) (c) manualmethod (d) fuzzy based threshold (thresh = 0480292) (e) minimum error threshold (thresh = 09961) and (f) 119896-mean clustering

parameters are generally not usually known and instead acreation function 119895(119905) is used

119869 (119905) = 1 + 2 lowast [119875

1(119905) ln120590

1(119905) + 119875

2(119905) ln120590

2(119905)]

minus 2 [119875

1(119905) ln119875

1(119905) + 119875

2(119905) ln119875

2(119905)]

(7)

where

119875

1(119905) =

119868

sum

119894=1

119875 (119894)

119875

1(119905) =

119871minus1

sum

119894=119868+1

119875 (119894) = 1 minus 119875

1(119905)

119898

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

119894 lowast 119875 (119894)

119898

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

119894 lowast 119875 (119894)

120590

1(119905) =

1

119875

1(119905)

119868

sum

119894=0

[1 minus 119898

1(119905)]

2

lowast 119875 (119894)

120590

2(119905) =

1

119875

2(119905)

119871minus1

sum

119894=119868+1

[1 minus 119898

2(119905)]

2

lowast 119875 (119894)

(8)

The optimal threshold 119905lowast is obtained by

119869 (119905

lowast

) = min 119869 (119905) (9)

(d) k-Mean Clustering Algorithm [17] 119896-mean clustering isa method of vector quantization cluster analysis in a giveninput image consisting of various clusters This algorithmaims to partition 119899 observations into 119896 clusters in which eachobservation belongs to the cluster with the nearest meanserving as a prototype of the various clusters This techniquecalculates Euclidian distance from a random selected meaneach presenting in a cluster in an observation and trying tominimize the calculated Euclidian distance by shifting thepoint to its nearest cluster Distance between different pointsand cluster has been calculated using the following relations

(Ed)2 = min 1205831sdot sdot sdot 120583

119896

119894=119899

sum

119894=1

119895=119899

sum

119895=1

1003816

1003816

1003816

1003816

1003816

119883 (119894 119895) minus 120583

21003816

1003816

1003816

1003816

1003816

120583

ℎ=

sum

119894=119899

119894=1

119875 (119894) lowast 119894

sum

119894=119899

119894=1

119875 (119894)

(10)

(e) Fuzzy Thresholding Algorithm [18] Fuzzy set theory hasbeen used for partitioning an image space by minimizingthe measure of fuzziness of an image This measurementcan be expressed as entropy which is index of fuzziness and

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 6: A Robust Machine Vision Algorithm Development for Quality ...

6 Journal of Food Processing

Portion of image

structuring elements3 times 3 cross-shaped

3 times 3 neighborhoods

Figure 5 Structuring element and neighborhood definition for morphological processing

nonfuzziness In the notation of fuzzy set an image set 119868 =119891(119909 119910) of size119872times119873 can be expressed as

119868 = (119891 (119909 119910) 120583

1(119891 (119909 119910))) (11)

The membership function levels 120583119868(119891(119909 119910)) can be

viewed as characteristics equation that can extract the fuzzi-ness of a (119909 119910) pixel in given image 119868

120583

1(119891 (119909 119910)) =

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

0(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) ⩽ 119905

1

1 +

1003816

1003816

1003816

1003816

119891 (119909 119910) minus 120583

1(119905)

1003816

1003816

1003816

1003816

119888

If 119891 (119909 119910) gt 119905

(12)

Average grey levels 1205830(119905) and 120583

1(119905) can be regarded as target

values of the background and the object for a given thresholdvalue 119905 and 119862 is a constant value such that 5 ⩽ 120583

1(119891(119909 119910)) ⩽

1

120583

0(119905) =

sum

119868

119894=0

119894ℎ (119894)

sum

119868

119894=0

ℎ (119894)

120583

1(119905) =

sum

119871minus1

119894=119905+1

119894ℎ (119894)

sum

119868119871minus1

119894=119868+1

ℎ (119894)

(13)

The measure of fuzziness used in this work was the entropy119864(119868) by using Shannonrsquos function 119878(120583(119909

119894)) The optimal

threshold can be extracted by minimizing the measure offuzziness 119864(119883)

(f) Proposed Manual Method Morphological analysis hasbeen implemented to extract the chocolate chips from cookieinput images This approach is especially designed to extractchocolate chips perfectly The processing starts with a gray-level thinning followed by a gray-level opening so thatregion segmentation is obtained Morphological erosionoperation has been used for extracting the chocolate chipsfrom binary images of the cookies In order to perform

erosion a 3 times 3 structuring element has been used overthe binary segmented image Boundary extraction also hasbeen performed for area calculation of each chocolate chipexisting in cookies It has been performed by subtracting theeroded image from original binary image Detailed processof morphological operations is demonstrated in Figure 5It shows that all morphological operations have been per-formed using 3 times 3 cross-shaped structural elements Variousmorphological operations used in proposed manual methodhave been performed using 3 times 3 kernel movement over thegray-level image

eroded (119909 119910) = max(119899minus1

sum

119894=0

119899minus1

sum

119895=0

119868 (119894 119895) lowast 119908 (3 times 3)) (14)

222 Color Extraction Various Color Models such as RGBHSV and HIS have been implemented for extraction of colorregarding information from cookies and biscuit input imagesChange in color of biscuits and cookie during baking is adynamic process in which certain color transitions occur asthe baking proceeds Developed algorithm also discriminatesbetween the changes in color due to various environmentalconditions Sample biscuits are preserved in three differentconditions such as packed moist open It has been observedthat there is considerable change in color due to change inenvironment

119877 (119909 119910 119911) = Input ( 2) = 0

119877 (119909 119910 119911) = Input ( 3) = 0

119866 (119909 119910 119911) = Input ( 1) = 0

119866 (119909 119910 119911) = Input ( 3) = 0

119861 (119909 119910 119911) = Input ( 1) = 0

119861 (119909 119910 119911) = Input ( 2) = 0

(15)

HSI and HSV color models have been used for extractionof color regarding information for various chocolate cookies

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 7: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 7

Figure 6 HSI Color transformations for chocolate cookies

because HSI and HSV color models are designed in such away that humans can see color (see Figure 6) The particularcolor such as chocolate can be easily recognized by HSI colormodel Various statistical methods have been implementedfor extraction of perfect chocolate color ranges using HSIcolor models

119868

1=

(119877 + 119866 + 119861)

3

119868

2=

(119877 minus 119861)

2

119868

3=

(2119866 minus 119877 minus 119861)

4

(16)

HIS color model can be derived using 1198681 1198682 and 119868

3

119867 = tanminus1119868

3

119868

2

119878 =

2radic

(119868

2

2

+ 119868

2

3

)

119868 = 119868

1

(17)

223 Physical Parameters Extraction Various physicalparameters related to quality of the biscuits and cookiessuch as number of chocolate chips per cookie area ofthe chocolate chips and cookies area of the biscuitschocolate chips density solidity convex hull convex areaand entropy have been extracted using various imageprocessing operations (see Tables 2 and 3) Entropy is used tocharacterize texture of the input image by statistical measureof randomness

119867(119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119875 (119894 119895 119896) lowast log2

119875 (119894 119895 119896)

119875 (119909 119910 119911) =

119894=119899

sum

119894=1

119895=119899

sum

119895=1

3

sum

119896=1

119899 (119894 119895 119896)

119898

2

(18)

Area of each sample biscuit and cookie has been measuredusing different algorithms In this process system first appliesbinary image conversion on input grayscale image Afterbinary image conversion system calculates approximate area

of chocolate chip Calculated area is a scalar whose valuecorresponds roughly to the total number of pixels in theimage but might not be exactly the same because differentpatterns of pixels are weighted differently Basically systemestimates the area of all pixels in the converted binary imageby summing the areas of each pixel in the image The areaof an individual pixel is determined by looking at its 2-by-2 neighborhood There are six patterns each representinga different area Each pixel is part of four different 2-by-2neighborhoods

(i) patterns with zero on pixels (area = 0)(ii) patterns with one on pixel (area = 14)(iii) patterns with two adjacent on pixels (area = 12)(iv) patterns with two diagonal on pixels (area = 34)(v) patterns with three on pixels (area = 78)(vi) patterns with four on pixels (area = 1)

Convex hull and its area also have been calculated using119901-by-2 matrix that specifies the smallest convex polygon that cancontain the region Each rowof thematrix contains the119909- and119910-coordinates of one vertex of the polygon This property issupported only for 2D input label matrices

Various physical parameters also have been extractedfor different cookies samples such as chocolate chips countarea of chocolate chips and chocolate chips density Havingdiscrete uninterrupted blocks is important but a process stillneeds to be defined so that each block can be counted upeffectively Towards this purpose an algorithm involving aspecial spatial-domain filter was devised to reduce each blockof white to a single white pixel Once each block is reduced assuch it becomes trivial to countThe filter operates a windowof a certain size for counting the number of white pixelsWith the direction of its movement basically if more thanone white pixel group is present in input binary image itwill reduce it to one pixel of white in corner of the windowcorresponding with the direction of its movement across thesample image System also calculates the area of each samplecookie and it can be further helpful in chocolate densitycalculation

224 Crack and Fault Detection Crack and fault detectionalso have been implemented using Hough transform imple-mentation on converted binary image of commercial biscuitdigital image The objective is to enhance the crack portioncoming in input image Several methods have been used tosegment defects like crack ranging from threshold methodsto different advanced methods that combined backgroundsubtraction [19] histogram threshold technique [20] adap-tive threshold [21] and so forth In all these methods lowthreshold value provides a seed point of a crack and lessnoise and high threshold provide an entire crack region withhigh amount of noise Therefore to extract the entire crackregion in captured input image a soft threshold methodbased on fuzzy 119888-means clustering has been proposed forbinary image conversion from given target image Segmentedimage proceeds for crack detection in segmented biscuit

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 8: A Robust Machine Vision Algorithm Development for Quality ...

8 Journal of Food Processing

Table 2 Various extracted texture parameters for different commercial biscuit samples

Input image Convex image Image area(pixels)

Convex area(pixels)

Solidness(index)

Convex hull(normalized

area)Texture image Texture

parameters

28774 29565 0973 2995Min = 616Max = 140Mean = 757

29750 30395 0978 3055Min = 609Max = 178Mean = 786

28754 29616 0970 3075Min = 608Max = 192Mean = 8013

28212 29568 0954 3305Min = 6043Max = 1890Mean = 793

Table 3 Various extracted physical parameters for commercial cookies samples

Serialnumber

Grayscale version ofinput sample image Processed image

Chocolatechips count(automatic)

Chocolate chipscount (manual)

Total chocolatechips area(mm2)

Chocolate chipsdensity

(mm2counts)

Averagechocolate area

(mm2)

1 12 12 38633 00371 03219

2 17 19 47293 00250 02781

3 14 14 57299 00869 04092

4 17 18 87283 002098 05134

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 9: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 9

y 120579

120579 minus120587 r

r

x

120587

12

3

10

10

05

05

00 1

0

Figure 7 Mapping process from (119909 119910) coordinate to the (119903 120579) space using Hough transform (1 2 and 3 correspond to mapped tokens fromdetected straight line to Hough space curve)

sample digital image (see Figure 8) The key component ofa robust crack detection system is crack feature extractionand detection The objective of this section of implementedalgorithm is to detect cracks in commercial biscuits andcookies and find out whether cracks are able to be avoidedbased on the extracted features Hough transform techniqueis basically a robust global method used for fitting lines anddifferent curves such as circle and parabola It has been usedextensively for a wide range of applications with excellentempirical performance [22] Hough transform method basi-cally identifies a specific class of shapes based on votingprocedure The aggregation of pixels belonging to variouscracks in each sample approximately forms a line ThereforeHough transform has been implemented for crack detectionand feature extractionThemethod performs amapping fromthe119909minus119910 space to the 119903minus120579 space using parameters to representsolution of the line equation which can be defined as thefollowing equation

119903 = 119909 cos 120579 + 119910 sin 120579 (19)

where (119909 119910) is the coordinate of a pixel and (119903 120579) is corre-sponding distance angle parameter curve (see Figure 7)

To extract crackrsquos features in commercial biscuit imageevery pixel in the original image is mapped to the Houghspace using all values of 120579 [23] This leads to a sine wave inHough space for each individual pixelThe detection is basedon a voting procedure It is carried out in a parameter out ina parameter space or accumulator Here accumulator valueis updated continuously In this algorithm an accumulatorarray 119860 is used to count the number of intersects of various119903 and 120579 values For every input image the concentricitymeasure 119878 is computed by finding the maximum values of119903 for each angle 120579 that can be expressed as the followingmathematical equation

119878 (120579) = Max (119860119903120579) 120579 = 0 sdot sdot sdot 180

(20)

Crack segmentation and detection are implemented in faultybiscuit sample digital image

Various features of the cracks have been extracted usinghistogram analysis Histogram [24] of various biscuit sampleshas been extracted and it has been observed that eachhistogram consists of two major peaks Second peak signifiesabout crack features Overshoot of second peak has beeninversely relatedwith crackwidth As the overshoot of second

peak decreased width of the crack increases It can beobserved in Figures 9(a) and 9(d) that second peak achievesmaximum height and as crack width increases height of thesecond overshoot decreases This analysis extracts informa-tion regarding various crack features This analysis can bediscriminating between commercial biscuit samples havinglarge cracks minor cracks and no cracks

3 Results and Discussion

31 Comparison of Proposed Segmentation Techniques withPreexisting Thresholding Algorithms Developed algorithmhas been tested on 50 cookies and 100 commercial Krack-Jack biscuits regarding various quality parameters such aschocolate chip count area of chocolate chips proper bakingtime texture features solidity and various faults occurringin commercial biscuit and cookies digital images Variousthreshold techniques for image as mentioned earlier havebeen implemented for cookies feature extraction Error indexhas been calculated based on various extracted featuresas mentioned earlier It has been observed that proposedmorphological based threshold technique performance is forbetter compared to other threshold techniques as shown inFigure 10 Error index has been calculated by calculatingthe difference between automatic chocolate chips count andvisual count

32 Characterization of Sample on the Basis of EnvironmentalConditions Developed algorithm can also characterize vari-ous biscuit and cookie samples on the basis of various envi-ronmental conditions such as moist open controlled andpacked It has been observed from entropy calculation thatit can discriminate between various texture properties suchas open controlled frozen and packed environment condi-tions Entropy relates with the texture properties influenceddue to various environmental conditions It can be observedfrom Figure 11 that entropy can differentiate between variousenvironmental conditions

33 Samples Discrimination Based on Defects and BakingIndex Quality of biscuits and cookies also relates with theproper baking time (see Figure 12) Proper baked sample hasbeen judged based on the color extraction usingRGB andHSIcolor models It has been observed that extracted color indexcan differentiate between various biscuit and cookie samples

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 10: A Robust Machine Vision Algorithm Development for Quality ...

10 Journal of Food Processing

(a) (b)

(c) (d)

(e) (f)

120588

minus150

minus100

minus50

0

50

100

150

120579 (deg)minus80 minus60 minus40 minus20 0 20 40 60 80

(g)

Figure 8 Implemented algorithm for crack detection and identification for commercial biscuits (a) Input sample image (b) rotated image(c) grayscale converted image (d) edge detection using canny edge detection filter (e) segmented image (f) crack detected in input sampleimage (g) Hough transform response of detected crack

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 11: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 11

(a) (b) (c)

Brig

htne

ss le

vel

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(d)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(e)

Brig

htne

ss le

vel

1000

900

800

700

600

500

400

300

200

100

0

Pixel count0 50 100 150 250200 300

(f)

Figure 9 Crack feature extraction using histogram analysis (a) Biscuit sample without crack (b) biscuit sample with minor crack (c) biscuitsample with major crack (d) features corresponding to sample (a) (e) features corresponding to sample (b) (f) features corresponding tosample (c)

such as underbaked medium baked perfect baked andoverbaked Developed algorithm also differentiates betweenthe faulty and perfect biscuit and cookies samples basedon the second peak overshoot calculation extracted fromhistogram of the gray-level digital images of the various inputsamples

4 Conclusion

Quality evaluation of commercial biscuits and cookies has amajor role in the food industry The results from this studyindicate that developed robust machine vision algorithmcan depict various quality parameters such as baking stage

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 12: A Robust Machine Vision Algorithm Development for Quality ...

12 Journal of Food Processing

0

5

10

15

20

1 2 3 4 5 6Er

ror i

ndex

()

Thresholding techniques

Figure 10 Performance analysis calculation based on chocolate chips count (1198772 = 098) (1) Proposedmorphological algorithm (2) 119896-meanclustering (3)Otsursquos threshold technique (4) fuzzy based threshold technique (5)minimum error threshold technique (6) isodata thresholdtechnique

05

1015202530

1 2 3 4

Entro

py in

dex

Commercial biscuit samples

Moist Open Controlled Packed

Figure 11 Entropy index variation with different environmental conditions (1198772 = 096)

0100200300400500600700800900

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Seco

ndar

y pe

ak o

vers

hoot

Sample count

Samples with crack Samples without crack

(a)

0102030405060708090

100

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Extr

acte

d co

lor i

ndex

Commercial biscuit and cookie samples

Underbaked Medium baked Perfectly baked Overbaked

(b)

Figure 12 (a) Faulty sample discrimination using histogram analysis (1198772 = 098) (b) Baking stage extraction using implemented colormodels (1198772 = 092)

chocolate chips count influence of environmental conditionon the texture of samples solidity and various kinds ofproblems such as major and minor cracks Experiment onbiscuit and cookies products demonstrates effectiveness ofproposed threshold algorithm for proper segmentation andHough based features for crack detection and extractionDeveloped algorithm is invariant to rotation and robustfrom the effect of nonuniform color or different intensitydistributions It was discovered that the developed robustmachine vision algorithm resulted in highest correctness

classifications averaging at 95 in the sense of predictionof about various quality parameters and crack detectionTherefore this artificial technique has potential for use inroutine inspection of biscuit cookies and other bakeryproducts

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 13: A Robust Machine Vision Algorithm Development for Quality ...

Journal of Food Processing 13

Acknowledgments

Authors are grateful to CSIR-CEERI Director Dr ChandraShekhar for giving chance to develop such kind of project inCSIR-CEERI as well as allowing them to publish this workThanks are due to AEG team members who helped themin successful completion and installation of machine visionsystem for quality extraction of bakery products such asbiscuits and cookies

References

[1] T Yamaguchi S Nakamura R Saegusa and S HashimotoldquoImage-based crack detection for real concrete surfacesrdquo IEEJTransactions on Electrical and Electronic Engineering vol 3 no1 pp 128ndash135 2008

[2] Q Li W Lu and J Yang ldquoA hybrid thresholding algorithmfor cloud detection on ground-based color imagesrdquo Journal ofAtmospheric and Oceanic Technology vol 28 no 10 pp 1286ndash1296 2011

[3] S Nashat A Abdullah and M Z Abdullah ldquoA robust crackdetection method for non-uniform distributions of colouredand textured imagerdquo in Proceedings of the IEEE InternationalConference on Imaging Systems and Techniques (IST rsquo11) pp 98ndash103 Penang Malaysia 2011

[4] W-T Chang ldquoChocolate Chips Counting by Multiple ImageOperationrdquo EECS 90 Digital Image Processing 2004

[5] J Eastman ldquoAutomated Tallying of Chocolate Chips usingColor Segmentationrdquo EECS 90 Digital Image Processing 2004

[6] C Roberts and F Merat ldquoSurface Feature Detection for QualityAssurance with Cookiesrdquo EECS 90 Digital Image Processing2004

[7] S Johannsen ldquoCounting Chocolate Chips in Chocolate ChipCookiesrdquo EECS 90 Digital Image Processing 2004

[8] V Guillard B Broyart S Guilbert C Bonazzi and N GontardldquoMoisture diffusivity and transfer modelling in dry biscuitrdquoJournal of Food Engineering vol 64 no 1 pp 81ndash87 2004

[9] J C H Yeh and L G C Hamey ldquoBiscuit bake assessment by anartificial neural networkrdquo in Proceedings of the 5th AustralianConference on Artificial Neural Networks 1994

[10] M Z Abdullah L C Guan and B M N Mohd AzemildquoStepwise discriminant analysis for colour grading of oil palmusing machine vision systemrdquo Food and Bioproducts Processingvol 79 no 4 pp 223ndash231 2001

[11] K Ganesan G Abraham and S K Jayan ldquoA machine visionsystem for biscuit classification and fault detectionrdquo Interna-tional Journal of Applied Engineering Research vol 8 no 192013

[12] K Woertz C Tissen P Kleinebudde and J BreitkreutzldquoTaste sensing systems (electronic tongues) for pharmaceuticalapplicationsrdquo International Journal of Pharmaceutics vol 417no 1-2 pp 256ndash271 2011

[13] F RDiasVelasco ldquoThresholding using the ISODATAclusteringalgorithmrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 10 no 11 pp 771ndash774 1980

[14] O Nobuyuki ldquoA threshold selection method from gray-levelhistogramsrdquo IEEE Transactions on Systems Man and Cybernet-ics vol 9 no 1 pp 62ndash66 1979

[15] N Otsu ldquoA threshold selection method from gray-level on his-togramsrdquo IEEE Transactions on Systems Man and Cyberneticsvol 9 no 1 pp 62ndash66 1979

[16] J Kittler and J Illingworth ldquoMinimum error thresholdingrdquoPattern Recognition vol 19 no 1 pp 41ndash47 1986

[17] T Kanungo D M Mount N S Netanyahu C D PiatkoR Silverman and A Y Wu ldquoAn efficient k-means clusteringalgorithms analysis and implementationrdquo IEEETransactions onPattern Analysis andMachine Intelligence vol 24 no 7 pp 881ndash892 2002

[18] C V Jawahar P K Biswas and A K Ray ldquoInvestigationson fuzzy thresholding based on fuzzy clusteringrdquo PatternRecognition vol 30 no 10 pp 1605ndash1613 1997

[19] J C-H Yeh L G C Hamey T Westcott and S K Y SungldquoColour bake inspection system using hybrid artificial neuralnetworksrdquo in Proceedings of the IEEE International Conferenceon Neural Networks vol 1 pp 37ndash42 Perth Australia 1995

[20] T B Moeslund and E Granum ldquoA survey of computer vision-based human motion capturerdquo Computer Vision and ImageUnderstanding vol 81 no 3 pp 231ndash268 2001

[21] U Gonzales-Barron and F Butler ldquoA comparison of seventhresholding techniques with the k-means clustering algorithmfor measurement of bread-crumb features by digital imageanalysisrdquo Journal of Food Engineering vol 74 no 2 pp 268ndash278 2006

[22] V N Manjunath G A Kumar and P Shivakumara ldquoSkewdetection technique for binary document images based onHough transformrdquo International Journal of Information andCommunication Engineering vol 3 pp 498ndash504 2007

[23] D Bertand C Leguerneve D Marion M F Devaux and PRobert ldquoDescription of the textural appearance of bread crumbby vedio image analysisrdquo Cereal Chemistry vol 69 no 3 pp257ndash261 1992

[24] YHan andP Shi ldquoAn adaptive level-selectingwavelet transformfor texture defect detectionrdquo Image and Vision Computing vol25 no 8 pp 1239ndash1248 2007

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology

Page 14: A Robust Machine Vision Algorithm Development for Quality ...

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Anatomy Research International

PeptidesInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

International Journal of

Volume 2014

Zoology

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Molecular Biology International

GenomicsInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioinformaticsAdvances in

Marine BiologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Signal TransductionJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

Evolutionary BiologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Biochemistry Research International

ArchaeaHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Genetics Research International

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Advances in

Virolog y

Hindawi Publishing Corporationhttpwwwhindawicom

Nucleic AcidsJournal of

Volume 2014

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Enzyme Research

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Microbiology