CN104741325A - Fruit surface color grading method based on normalization hue histogram - Google Patents

Fruit surface color grading method based on normalization hue histogram Download PDF

Info

Publication number
CN104741325A
CN104741325A CN201510170649.2A CN201510170649A CN104741325A CN 104741325 A CN104741325 A CN 104741325A CN 201510170649 A CN201510170649 A CN 201510170649A CN 104741325 A CN104741325 A CN 104741325A
Authority
CN
China
Prior art keywords
fruit
normalization
chroma histogram
chroma
chromatic value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510170649.2A
Other languages
Chinese (zh)
Other versions
CN104741325B (en
Inventor
饶秀勤
应义斌
傅霞萍
谢丽娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201510170649.2A priority Critical patent/CN104741325B/en
Publication of CN104741325A publication Critical patent/CN104741325A/en
Application granted granted Critical
Publication of CN104741325B publication Critical patent/CN104741325B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a fruit surface color grading method based on a normalization hue histogram. The fruit surface color grading method comprises the following steps: selecting two fruits with different surface colors as samples, acquiring original digital images, and removing backgrounds, so as to obtain fruit sample images; converting the fruit sample images into HIS color space format images, and calculating to obtain normalization hue histogram vectors; drawing normalization hue histograms of the sample fruits; setting a fruit grading threshold value: collecting the images of the measured fruits, and processing and calculating to obtain normalization hue histogram vectors, and grading by virtue of calculation and comparison. According to the fruit surface color grading method, threshold values are graded by virtue of the normalization hue histogram of the fruit images, and the fruit surface color grading is carried out by comparing accumulation of different sections of different elements of normalization hue histogram vectors, so that the calculation and processing speeds are high.

Description

A kind of fruit based on normalization chroma histogram according to surface color stage division
Technical field
The present invention relates to a kind of fruit grading method, especially relate to a kind of fruit based on normalization chroma histogram according to surface color stage division.
Background technology
The surface color of fruit often affects the buying behavior of people, as the fruit as gift just requires the fruit surface solid colour in bright-coloured, the same packaging of surface color.Detecting and classification fruit color, is the effective means improving fruit commodity value.
Fruit surface color is sometimes also relevant to its inside quality.Research shows, red grape contains the matter of trampling on of abundant potassium, salicylic acid, iron, anthocyanin, and wherein salicylic acid can reduce cholesterol, and anthocyanin contributes to blood supply, strangles matter acid dilute blood, so red grape can prevent miocardial infarction and apoplexy.And green grapes is only containing potassium, iron and vitamin C, B.Therefore, red grape is of high nutritive value; Every 100g pimiento contains 200mg vitamin C, is 2 times of green chili, and pimiento is also rich in carrotene, Cobastab, dimension ox element E and folic acid, can develop immunitypty.Therefore, pimiento is worth high than green chili.
The color of fruit surface is one of its important exterior quality index, has close relationship with inside quality.If evaluate by the sense organ of people, lack objectivity and accuracy.
In the surface color context of detection of fruit, completed work mainly contains:
The people such as Tao (Tao Y, Heinemann P H, succeeded in developing NI Vision Builder for Automated Inspection for apple color detection, it can distinguish yellow and green " golden marshall apple " et al.Machine vision for color inspection ofpotatoes and apples.Trans of the ASAE.1995.38 (5): 1555-1561).
The people such as Abdullah (Abdullah M Z, Mohamad-Saleh J, Fathinul-Syahir A S, et al.Discrimination and classification of fresh-cut starfruits (Averrhoa carambola L.) using automated machine vision system.Journal of Food Engineering, 2006, 76 (4): 506-523) have developed the NI Vision Builder for Automated Inspection software detected for the handsome starfruits of gold (a kind of starfish shape fruit) surface color and fruit shape, this software utilizes HIS color space, linear discriminant function and multilayer neural network is adopted to carry out detecting the maturation of fruit, prematurity and post-mature state, the detection of 200 samples is shown, the Detection accuracy of linear discriminant function and multilayer neural network is respectively 65.3% and 90.5%.
The people such as Mendoza (Mendoza F, Dejmek P, Aguilera J M.Calibrated colormeasurements of agricultural foods using image analysis.Postharvest Biology andTechnology, 2006, 41 (3): 285-295) have studied sRGB respectively, HSV and L*a*b* color model is in the application of fruit quality detection computer vision, result shows, sRGB efficiency is higher, but be subject to background, fruit surface curvature and diffuse transmission influence, L*a*b* is more suitable for the detection for fruit surface color in computer vision system.
The people such as Yang Xiukun (Yang Xiukun, Chen Xiaoguang. carry out with Genetic Neural Network Method the research that apple color detects automatically. EI, 1997,13 (2): 173-176) obtain the chroma histogram of apple by computer vision technique and extract its surface color feature, adopting advanced genetic algorithm to establish a multilayer feedforward neural network system.
Li Qingzhong (Li Qingzhong, Zhang Man. based on the Real-Time Apple Color Grading of genetic neural network. Journal of Image and Graphics (A collects), 2000, 5 (9): 779-784) the hardware composition of apple color automatic grading system is described, determine the extracting method of apple color characteristic, genetic algorithm is utilized to achieve the learning scene of multilayer feedforward neural network identifier, achieve the real-time graded of apple color, and demonstrate the validity of method by experiment, result of the test shows, color grading recognition accuracy is more than 90%, classification apple time used is 150ms.This method needs first specified value sample, and after collection image is analyzed, training network, when fruit variety is changed, need re-start network training, user uses inconvenience, and varietal adaptation is poor.
The people such as Feng Bin (Feng Bin, Wang Maohua. based on the Computer Vision Classification of Fruit that color is fractal. EI .2002,18 (2): 141-144) when the fractal dimension utilizing fruit surface to distribute carries out classification for feature to different stain level fruit, have employed HIS model, utilize the accumulative of each chroma point and spatial characteristics.
Rao Xiuqin (Rao Xiuqin, fruit quality based on machine vision detects the key technology research with grading production line in real time, 2007, Zhejiang University) adopt HIS color model, principal component analytical method and mahalanobis distance method, achieve fruit according to surface color classification.The classification results that 800 width fruit images carry out is shown, total relative error 1.75%, fruit color can be met and detect the requirement with classification.
(the Zhao Jiewen etc. such as Zhao Jiewen, based on the defect red date Machine Vision Recognition of SVMs. agricultural mechanical journal, 2008 (03): the 113-115+147 pages .) utilize Cangzhou, Hebei Province golden jujube as research object, the defect jujube after adopting SVMs identification drying.In HIS color space, the average of extraction H and mean square deviation are as red date color feature value, and application Radial basis kernel function sets up SVMs model of cognition; And determine that the accuracy rate of identification is the highest, reaches 96.2% when parameter is C=32, σ=2.
Thus, generally will compare more modeling work in existing method and could realize according to surface color carrying out classification to fruit, process is comparatively complicated.
Summary of the invention
The deficiency in fruit quality is being detected in order to overcome prior art, the object of the invention is to propose a kind of fruit based on normalization chroma histogram according to surface color stage division, by the according to surface color classification of normalization chroma histogram, avoid more modeling work, to simplify classification process.
The technical solution used in the present invention comprises the following steps:
1) image is gathered: from the fruit of same batch, choose two fruit with different surfaces color as two sample fruit, be designated as first order fruit S1 and second level fruit S2 respectively, obtain its respective original digital image by NI Vision Builder for Automated Inspection, remove background and obtain fruit sample image;
2) calculate normalization chroma histogram vector: fruit sample image is converted into HIS color space format-pattern, then calculate fruit normalization chroma histogram vector P separately;
3) on same figure, draw the normalization chroma histogram of two sample fruit;
4) threshold value of fruit grading is set: by normalization chroma histogram obtained above, the main peak starting point chromatic value of normalization chroma histogram is designated as T1, the main peak crosspoint chromatic value of normalization chroma histogram is designated as T2, the main peak terminal chromatic value of normalization chroma histogram is designated as T3;
5) tested fruit grading: tested fruit is repeated above-mentioned steps 1) ~ 2) gather image and calculate all tested fruit normalization chroma histogram vector P separately, then relatively classification is carried out to all tested fruit by calculating.
Described step 3) the normalization chroma histogram of drawing sample fruit is specially: with the chromatic value of HIS color space format-pattern for transverse axis, with the value of normalization chroma histogram vector P for the longitudinal axis, same rectangular plots is drawn normalization chroma histogram vector P respectively that obtain two sample fruit and obtains a normalization chroma histogram;
Described step 5) by normalization chroma histogram vector P, to be undertaken calculating the process compared specific as follows: obtain the first colourity frequency accumulated value M1 by cumulative for the element of the normalization chroma histogram vector P of the chromatic value of tested fruit between main peak starting point chromatic value T1 and main peak crosspoint chromatic value T2, obtain the second colourity frequency accumulated value M2 by cumulative for the element of the normalization chroma histogram vector P of the chromatic value of tested fruit between main peak crosspoint chromatic value T2 and main peak terminal chromatic value T3; The fruit of M1>M2 is divided into first order fruit, the fruit of M1≤M2 is divided into second level fruit.
The normalization chroma histogram vector P of described each fruit specifically calculates in the following ways: the histogram vectors H being calculated its chromatic component by HIS color space format-pattern, obtain the number of times that chromatic value occurs in the HIS color space format-pattern of this fruit, adopt following formula histogram vectors H to be multiplied by 100 again divided by the sum of all pixels C of the HIS color space format-pattern of this fruit, calculate the normalization chroma histogram vector P of this fruit:
P=100H/C
Wherein, C is the sum of all pixels of the HIS color space format-pattern of this fruit.
The beneficial effect that the present invention has is:
The present invention adopts the normalization chroma histogram of fruit image to carry out classification thresholds, and compare the accumulated value of element two sections of different elements of normalization chroma histogram vector to carry out fruit according to surface color classification, computational speed is fast.
Accompanying drawing explanation
Fig. 1 is the fruit gray level image of embodiment of the present invention first order sample fruit.
Fig. 2 is the fruit gray level image of embodiment of the present invention second level sample fruit.
Fig. 3 is that the embodiment of the present invention draws the normalization chroma histogram obtained.
Fig. 4 is the NI Vision Builder for Automated Inspection schematic diagram of the embodiment of the present invention.
In figure: 2, camera lens, 3, camera support, 4, LED lamp bar, 5, lighting box, 6, computer.
Detailed description of the invention
Below in conjunction with drawings and Examples, the invention will be further described.
The present invention adopts red date as the fruit of specific embodiment, and its specific implementation process is as follows:
As shown in Figure 4, NI Vision Builder for Automated Inspection is by colorful CCD camera (DFK 23G445, The ImagingSource Europe GmbH), camera support 3, four LED lamp bar 4 (long 370mm, wide 38mm), lighting box 5 and computer 6 form, colorful CCD camera is arranged on lighting box 5 by camera support 3, inwall four limit of the lighting box 5 below colorful CCD camera is provided with four LED lamp bar 4, the camera lens 2 of colorful CCD camera towards immediately below, focal length is 12mm.
1) image is gathered.Two fruit with different surfaces color are chosen as sample from the fruit of same batch, be designated as first order fruit S1 and second level fruit S2 respectively, then NI Vision Builder for Automated Inspection is sent into respectively, obtain digital picture as depicted in figs. 1 and 2, background is removed to digital picture, obtains fruit sample image.
2) normalization chroma histogram vector is calculated.Each width fruit sample image is converted into HIS color space form, calculates the histogram vectors H of its chromatic component respectively 1and H 2record respectively chromatic value i (i=0,1 ... 255) number of times occurred in first order fruit S1 and second level fruit S2 image, uses C 1and C 2record the sum of all pixels of first order fruit S1 and second level fruit S2 respectively, use vectorial H 1and H 2be multiplied by 100 respectively again divided by C 1and C 2, obtain normalization chroma histogram vector P 1and P 2, i.e. following formula:
P 1 = 100 H 1 / C 1 P 2 = 100 H 2 / C 2
In formula, P 1represent the normalization chroma histogram vector of first order fruit S1, P 2represent the normalization chroma histogram vector of second level fruit S2, H 1represent the chroma histogram vector of first order fruit S1, H 2represent the chroma histogram vector of second level fruit S2, C 1represent the sum of all pixels of first order fruit S1, C 2represent the sum of all pixels of second level fruit S2.
3) on same figure, draw the normalization chroma histogram of two sample fruit.As shown in Figure 3, take chromatic value as transverse axis, with normalization chroma histogram vector value for the longitudinal axis, same squareness coordinate diagram is drawn the normalization chroma histogram vector P of first order fruit S1 respectively 1with the normalization chroma histogram vector P of second level fruit S2 2, obtain normalization chroma histogram as shown in Figure 3.
4) classification thresholds is set.The main peak starting point chromatic value of the normalization chroma histogram of note first order fruit S1 and the normalization chroma histogram of second level fruit S2 is T1, the main peak crosspoint chromatic value of the normalization chroma histogram of first order fruit S1 and the normalization chroma histogram of second level fruit S2 is T2, and the main peak terminal chromatic value of the normalization chroma histogram of first order fruit S1 and the normalization chroma histogram of second level fruit S2 is T3.
5) classification.Again by step 1) ~ 2) tested fruit is processed, calculate the normalization chroma histogram vector P of all tested fruit, obtain the first colourity frequency accumulated value M1 by cumulative for the element of the normalization chroma histogram vector P of chromatic value between T1 and T2, obtain the second colourity frequency accumulated value M2 by cumulative for the element of the normalization chroma histogram vector P of chromatic value between T2 and T3.Such as, for the fruit of M1>M2, be then classified as first order fruit S1, otherwise be classified as second level fruit S2.
Compared with other method, the stage division of fruit according to surface color classification need only be calculated the cumulative of element two sections of different elements of normalization chroma histogram vector by the present invention can carry out classification, the calculating carried out at MATLAB software shows, be only 0.062 second to the time that the normalization chroma histogram of red jujube image vector carries out needed for classification 1000 times as stated above, computational speed is fast.
Above-mentioned detailed description of the invention is used for explaining and the present invention is described, instead of limits the invention, and in the protection domain of spirit of the present invention and claim, any amendment make the present invention and change, all fall into protection scope of the present invention.

Claims (4)

1., based on a fruit according to surface color stage division for normalization chroma histogram, it is characterized in that the step of the method is as follows:
1) gather image: from the fruit of same batch, choose two fruit with different surfaces color as two sample fruit, obtain its respective original digital image by NI Vision Builder for Automated Inspection, remove background and obtain fruit sample image;
2) calculate normalization chroma histogram vector: fruit sample image is converted into HIS color space format-pattern, then calculate fruit normalization chroma histogram vector P separately;
3) on same figure, draw the normalization chroma histogram of two sample fruit;
4) threshold value of fruit grading is set: by normalization chroma histogram obtained above, the main peak starting point chromatic value of normalization chroma histogram is designated as T1, the main peak crosspoint chromatic value of normalization chroma histogram is designated as T2, the main peak terminal chromatic value of normalization chroma histogram is designated as T3;
5) tested fruit grading: all tested fruit is all repeated above-mentioned steps 1) ~ 2) gather image and process calculates respective normalization chroma histogram vector P, then relatively classification is carried out to all tested fruit by calculating.
2. a kind of fruit based on normalization chroma histogram according to claim 1 according to surface color stage division, it is characterized in that: described step 3) the normalization chroma histogram of drawing sample fruit is specially: with the chromatic value of HIS color space format-pattern for transverse axis, with the value of normalization chroma histogram vector P for the longitudinal axis, same rectangular plots is drawn normalization chroma histogram vector P respectively that obtain two sample fruit and obtains a normalization chroma histogram.
3. a kind of fruit based on normalization chroma histogram according to claim 1 according to surface color stage division, it is characterized in that: described step 5) by normalization chroma histogram vector P, to be undertaken calculating the process compared specific as follows: obtain the first colourity frequency accumulated value M1 by cumulative for the element of the normalization chroma histogram vector P of the chromatic value of tested fruit between main peak starting point chromatic value T1 and main peak crosspoint chromatic value T2, the second colourity frequency accumulated value M2 is obtained by cumulative for the element of the normalization chroma histogram vector P of the chromatic value of tested fruit between main peak crosspoint chromatic value T2 and main peak terminal chromatic value T3, the fruit of M1>M2 is divided into first order fruit, otherwise tested fruit is divided into second level fruit.
4. a kind of fruit based on normalization chroma histogram according to claim 1 according to surface color stage division, it is characterized in that: the normalization chroma histogram vector P of described each fruit specifically calculates in the following ways: the histogram vectors H being calculated its chromatic component by HIS color space format-pattern, obtain the number of times that chromatic value occurs in the HIS color space format-pattern of this fruit, adopt following formulae discovery to obtain the normalization chroma histogram vector P of this fruit:
P=100H/C
Wherein, C is the sum of all pixels of the HIS color space format-pattern of this fruit.
CN201510170649.2A 2015-04-13 2015-04-13 Fruit surface color grading method based on normalization hue histogram Active CN104741325B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510170649.2A CN104741325B (en) 2015-04-13 2015-04-13 Fruit surface color grading method based on normalization hue histogram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510170649.2A CN104741325B (en) 2015-04-13 2015-04-13 Fruit surface color grading method based on normalization hue histogram

Publications (2)

Publication Number Publication Date
CN104741325A true CN104741325A (en) 2015-07-01
CN104741325B CN104741325B (en) 2017-04-12

Family

ID=53581905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510170649.2A Active CN104741325B (en) 2015-04-13 2015-04-13 Fruit surface color grading method based on normalization hue histogram

Country Status (1)

Country Link
CN (1) CN104741325B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520426A (en) * 1991-07-15 1993-01-29 Sumitomo Heavy Ind Ltd Fruit hue judgement device using neural network
US5799105A (en) * 1992-03-06 1998-08-25 Agri-Tech, Inc. Method for calibrating a color sorting apparatus
US5813542A (en) * 1996-04-05 1998-09-29 Allen Machinery, Inc. Color sorting method
US6901163B1 (en) * 1998-05-19 2005-05-31 Active Silicon Limited Method of detecting objects
WO2005099916A1 (en) * 2004-04-16 2005-10-27 At Engineering Sdn Bhd Methods and system for color recognition and enhancing monochrome image recognition
CN101125333A (en) * 2007-09-24 2008-02-20 浙江大学 Fruit classifying method according to surface color

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0520426A (en) * 1991-07-15 1993-01-29 Sumitomo Heavy Ind Ltd Fruit hue judgement device using neural network
US5799105A (en) * 1992-03-06 1998-08-25 Agri-Tech, Inc. Method for calibrating a color sorting apparatus
US5813542A (en) * 1996-04-05 1998-09-29 Allen Machinery, Inc. Color sorting method
US6901163B1 (en) * 1998-05-19 2005-05-31 Active Silicon Limited Method of detecting objects
WO2005099916A1 (en) * 2004-04-16 2005-10-27 At Engineering Sdn Bhd Methods and system for color recognition and enhancing monochrome image recognition
CN101125333A (en) * 2007-09-24 2008-02-20 浙江大学 Fruit classifying method according to surface color

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何东健等: "果实表面颜色计算机视觉分级技术研究", 《农业工程学报》 *

Also Published As

Publication number Publication date
CN104741325B (en) 2017-04-12

Similar Documents

Publication Publication Date Title
Rupanagudi et al. A cost effective tomato maturity grading system using image processing for farmers
Sahu et al. Defect identification and maturity detection of mango fruits using image analysis
Gavhale et al. Unhealthy region of citrus leaf detection using image processing techniques
Xu et al. Use of leaf color images to identify nitrogen and potassium deficient tomatoes
Arjenaki et al. Online tomato sorting based on shape, maturity, size, and surface defects using machine vision
Lee et al. Rapid color grading for fruit quality evaluation using direct color mapping
Liu et al. A method of segmenting apples at night based on color and position information
Septiarini et al. Image-based processing for ripeness classification of oil palm fruit
CN101085442B (en) Method for treating and classifying orange image based on RGB composite model
CN108181316B (en) Bamboo strip defect detection method based on machine vision
Sahu et al. Identification and classification of mango fruits using image processing
CN102890092B (en) Characteristic angle cosine value method for detecting defects of honey peach brown rot
CN109615635A (en) The method and device of quality sorting is carried out to strawberry based on image recognition
Arefi et al. Wheat class identification using computer vision system and artificial neural networks
CN104952754B (en) Silicon chip method for separating after plated film based on machine vision
Wang et al. Vision-based judgment of tomato maturity under growth conditions
Vyas et al. Quality inspection and classification of mangoes using color and size features
Pavithra et al. Machine vision based automatic sorting of cherry tomatoes
Song et al. Wood materials defects detection using image block percentile color histogram and eigenvector texture feature
Khadabadi et al. Disease detection in vegetables using image processing techniques: A review
CN111401121A (en) Method for realizing citrus segmentation based on super-pixel feature extraction
CN104741325A (en) Fruit surface color grading method based on normalization hue histogram
Monavar et al. Detection of red ripe tomatoes on stem using Image Processing Techniques
Choi et al. Detecting and counting citrus fruit on the ground using machine vision
Ignacio et al. A YOLOv5-based deep learning model for in-situ detection and maturity grading of mango

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant