Fang Jun-long,Zhang Dong,and Qiao Yi-bo
College of Electric and Information,Northeast Agricultural University,Harbin 150030,China
At present,the method of sorting and detection using machine vision has been used as a powerful tool in the research of various fields.As a result of anthropogenic and natural effects of complex factors,grading results vary from person to person.The result of image segmentation is an important basis for agricultural product quality detection and automatic classification.In 1970s,scholars at home and abroad began to research the items related to the agricultural products automatic detection of machine vision technology and had achieved certain results,but few were applied to corresponding segmentation of cucumber grading process.For example,Bayer conversion and Gamma correction were proposed to convert monochrome image into satisfactory color images,then the scientists used jump case law to split into a set of sub images (Zhao et al.,2006).The algorithm of image sequences provide a foundation for online detecting follow-up mechanical operation.In the study of peach classification,Byron et al.(1989) mapped and segmented shadow of image,with two-dimensional gaussian filtering equation completing edge detection;however,they cannot resolve the problem that stem and perianth were mistaked as defect region,misjudgment rate was as high as 25%.Mushroom image zonal marking technique based on sequential scanning methods is proposed to implement various mushroom image segmentations (Yu et al.,2006).Cucumber as target segmentation,combined with analysis of the image pixels gray and the influence to threshold selection with neighborhood mean information and pixel neighborhood size.Genetic algorithms were used to get the optimal solution of the threshold value range,eventually sought the global optimal solution (Sun,2009).Transmission image was segmented with area statistics method by using the method of tobacco biological characteristics.Results showed that accuracy was higher than that of the conventional statistical methods.0.65 pixel was more than the average of every piece of tobacco leaf pixel numbers (Ma,2007).Computer vision was used for the static apple detection and classification,finally,the performance of two segmentation methods based on category variance and information entropy was analyzed (Li,2000).Algorithm which achieved fast segmentation of images and background in fruit realtime classification was presented.This method could segment the static fruit surface defects effectively and quickly.The experimental result indicated that the method had better anti-noise performance.
Nevertheless,producing fruit image processing system was based on the study under the PC generally.The effect is good,but not easy to operate the loading and unloading and mobile,and the users'programming requirement is higher.According to the problems,this paper based on the special video processing chip TMS320DM6437 as a platform,segmented the image with DSP before classification.
Figure 1 shows the hardware platform.This paper chose Techshine EL_DM6437 development board which was specially used for video application development as core microprocessor.Utilized CCS for generating,optimizing and debugging code,enhanced TDS510USB emulator connected DSP algorithm and INTEL Pentium E5800 computer by the algorithmic simulation.In order to output terminal of displayed image,the small LCD TV in development kit was chosen to be the image acquisition.In order to develop effective segmentation algorithm,DM6437_USBTool achieved the image upload and download capabilities of output terminal.
Figure 2a displayed gray histogram of cucumber fruits images on a conveyor belt under natural light,Fig.2b showed the phenomenon that the traditional image binary segmentation produced a false target.The cucumber image was collected by a camera included fruit target and background two parts,binaryzation processing was the most appropriate method.Even if the binarization result was obvious,cucumber tail persisted long shadow.
Fig.1 Image processing hardware platform based on DM6437
Fig.2 Natural light goal of binary threshold segmentation image
Often moving target detection methods have optical flow method,frame difference method,and background subtraction method,optical flow method are more applicable to the vidicon motion conditions.Its computation is complexity and its instantaneity are not high.The features of frame difference method is simple,but require a full segmentation of moving object (Xia et al.,2010).The background image difference only fits for the still background and no reasonable approach has been designed and implemented for automatic background updating along with the background variance (Christopher et al.,1997).Single Gauss model,hidden Markov model and non-parameter model are different,but most can't provide real-time test results (Mei et al.,2007).Because the conveyor belt is still relative to the fruit,it will bring machinery and other noise,built the color model for background and foreground utilizing GMM,background subtraction method is improved.
Traditional background subtraction method treats with color video using methods of gray level transformation in pretreatment process before calling GMM.Then simple image filter processes to eliminate some noise.One of the following modeling and testing is performed.In order to improve image quality,many predecessors made great efforts in modeling and updating in the background using Gaussian mixture model,yet most interference remained and other reasons made the subsequent calculation complexity,and real time still couldn't be reached.So this paper referenced inhibiting the shadow operation in the pretreatment process,and simplified modeling of dynamic backgrounds and low speed issues.
There are two methods to solve the shadow problems of moving targets.Shadow elimination method (Chen et al.,2006) based on objective model and target shadow characteristics (Martel-Brisson et al.,2005).But it usually produced the background false detections.According to the study of the fruit green features,this research highlighted cucumber in green as color images to grayscale.Super green features as detection threshold segmentation method was used for processing.
Some studies found that if background light intensity changed sharply,r value in RGB color space component and b value component in RGB color space were very low,and the color saturation of the plant edge area increased.The algorithm deals with super green component ExG=2G–R–B of RGB color space segmentation directly.Enlarge G color space pixel values by algorithm was for easier segmenting.Concrete formula as the followings:
G(x,y),R(x,y),ang B(x,y) represent the coordinates (x,y) pixel grayscale values of the three dimensional color components,then normalization was performed.Set a threshold T on ExG for binary image segmentation.
First of all,we analyzed the original sample image of cucumber,pixel serial number showed that most of the green fruit targets were higher than the other two components,and the green component value of the corresponding conveyor belt background was less than them.The latest findings was seen by some further evidence of the result that super green features could be used in weed identification and fruit and vegetable segmentation.Secondly,we conducted researches to the huge samples of the rows which cucumber was as a major object.
Simple line pixel serial number showed that mostly red component value was higher than the blue component values in the shadow pixel range and it was the opposite in the background.
(2g+r–b) grayscale binary image shows an 2G-R-B gray instance which is implemented by C language and assemble language.According to the above RGB component features in three different cucumber sample areas,added the super green feature to the background subtraction method before pretreatment processing,used color component value of pixel for choosing appropriate threshold,finally removed shadow more effectively.Meanwhile,called application programming interface (API) function in VLIB to write the algorithm.
Fig.3 All the bank each component image RGB value of statistical situation flow chart
Fig.4 Background subtraction method and method proposed in this processing results after contrast figure
Unfortunately,there isn't a one-size-fits-all approach to objectively evaluate image segmentation algorithms.This paper mainly studied such problems as moving object extraction and shadow elimination under the motion background remained a wealth of detailed information at the same time.In the paper,the following evaluating methods were used.epis pixel number of the false target,enis pixel number of missed inspection target,Ckis the total pixel number of inspection target.
etotalis the total error rate,it will affect the effectiveness of algorithm.
Background subtraction method for dividing fruit shows the shadow from motion detection platform.(2g–r–b) grayscale binary image shows the result of observing RGB component detection algorithm based on image segmentation.The article compared the mathematical models of common background subtraction and super green improved background subtraction method segmentation effect.Found because of the high error rate taken by finite difference method for background subtraction,under the influence of background disturbance.In this paper,natural accurate segmentation of cucumber in sunlight on a moving platform is implemented to immune the effect of shadows.
Through studying on RGB component values of the original image,we found that most of g component value of fruit,r component value of shadows,and b component of the background value were higher than the other two components under natural illuminatio.So a mix of using this characteristic might be a better plan than simple background subtraction method,this design of green feature method could be applied not only for weed identification,but also for fruit and vegetable segmentation.
When we did the research for this paper,under 95% confidence,a mathematic model about G component point values was simulated,y=75.285x0.1533;the result would have instructive effects on the utilization of the algorithm and be very helpful in the further research of the object segmentation in natural light.
Byron K,Miller,Michael J.1989.A color vision system for peach grading.Transactions of the ASAE,32(4): 1484-1490.
Chen B S,Chen D S.2006.Normalized rgb color model based shadow detection.Computer Applications,26(08): 1879-1881.
Christopher R W,Ali A,Trevor D,et al.1997.Real-time tracking of the human body.Machine Intell,19(7): 780-785.
Li Q Z.2000.Study on fast acquisition and processing technology for computer vision information in apple automatic grading.China Agricultural University,Beijing.
Ma W J.2007.The study of standards for tobacco leaf image acquisition technology and rating characteristics of tobacco purchase quality.Huazhong Agricultural University,Wuhan.
Martel-Brisson N,Zaccarin A.2005.Moving cast shadow detection from a Gaussian mixture shadow model.Computer Vision and Pattern Recognition.
Mei X.2007.Moving shadow detection and removal for traffic sequences.International Journal of Automation &Computing,4(1): 38-46.
Sun J.2009.Improved 2D maximum between-cluster variance algorithm and its application to cucumber target segmentation.Transactions of the CSAE,25(10): 176-181.
Xia Y,et al.2010.Moving targets detection algorithm based on background subtraction and frames subtraction.Industrial Mechatronics and Automation,1: 122-125.
Yu G H,Luo J M,Zhao Y.2006.Region marking technique based on sequential scan and segmentation method of mushroom images.Transactions of the CSAE,22(4): 139-142.
Zhao J W,et al.2006.Software design for fruit appearance on-line inspection system.Transactions of the CSAE,22(6): 115-118.
Journal of Northeast Agricultural University(English Edition)2013年3期