CN116899896A - Red ginseng sorting device and sorting method based on machine vision - Google Patents
Red ginseng sorting device and sorting method based on machine vision Download PDFInfo
- Publication number
- CN116899896A CN116899896A CN202211657930.5A CN202211657930A CN116899896A CN 116899896 A CN116899896 A CN 116899896A CN 202211657930 A CN202211657930 A CN 202211657930A CN 116899896 A CN116899896 A CN 116899896A
- Authority
- CN
- China
- Prior art keywords
- gmm
- red ginseng
- sorting
- image
- machine vision
- 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.)
- Pending
Links
- 235000002789 Panax ginseng Nutrition 0.000 title claims abstract description 40
- 238000000034 method Methods 0.000 title claims abstract description 31
- 235000013399 edible fruits Nutrition 0.000 claims abstract description 38
- 238000010801 machine learning Methods 0.000 claims abstract description 14
- 238000012549 training Methods 0.000 claims description 14
- 238000009826 distribution Methods 0.000 claims description 12
- 239000013598 vector Substances 0.000 claims description 12
- 238000012804 iterative process Methods 0.000 claims description 9
- 238000000605 extraction Methods 0.000 claims description 7
- 241000208340 Araliaceae Species 0.000 claims description 6
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 6
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 6
- 238000007621 cluster analysis Methods 0.000 claims description 6
- 235000008434 ginseng Nutrition 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 6
- 230000011218 segmentation Effects 0.000 claims description 4
- 238000004458 analytical method Methods 0.000 claims description 3
- 239000003086 colorant Substances 0.000 claims description 3
- 238000009499 grossing Methods 0.000 claims description 3
- 238000003709 image segmentation Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 238000005457 optimization Methods 0.000 claims description 3
- 238000003672 processing method Methods 0.000 abstract description 3
- 241001391944 Commicarpus scandens Species 0.000 abstract description 2
- 238000009825 accumulation Methods 0.000 abstract description 2
- 230000006378 damage Effects 0.000 abstract description 2
- 230000005540 biological transmission Effects 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 description 8
- 241000220225 Malus Species 0.000 description 7
- 235000021016 apples Nutrition 0.000 description 5
- 230000012010 growth Effects 0.000 description 5
- 238000011160 research Methods 0.000 description 5
- 238000001514 detection method Methods 0.000 description 4
- IJGRMHOSHXDMSA-UHFFFAOYSA-N Atomic nitrogen Chemical compound N#N IJGRMHOSHXDMSA-UHFFFAOYSA-N 0.000 description 2
- 240000008067 Cucumis sativus Species 0.000 description 2
- 241000196324 Embryophyta Species 0.000 description 2
- 240000008042 Zea mays Species 0.000 description 2
- 235000002017 Zea mays subsp mays Nutrition 0.000 description 2
- 238000012271 agricultural production Methods 0.000 description 2
- 239000002689 soil Substances 0.000 description 2
- 241000239290 Araneae Species 0.000 description 1
- 235000004936 Bromus mango Nutrition 0.000 description 1
- 208000034656 Contusions Diseases 0.000 description 1
- 208000025962 Crush injury Diseases 0.000 description 1
- 235000009849 Cucumis sativus Nutrition 0.000 description 1
- 235000010799 Cucumis sativus var sativus Nutrition 0.000 description 1
- 101100136092 Drosophila melanogaster peng gene Proteins 0.000 description 1
- 235000007688 Lycopersicon esculentum Nutrition 0.000 description 1
- 240000007228 Mangifera indica Species 0.000 description 1
- 235000014826 Mangifera indica Nutrition 0.000 description 1
- 240000003768 Solanum lycopersicum Species 0.000 description 1
- 235000009184 Spondias indica Nutrition 0.000 description 1
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 description 1
- 235000016383 Zea mays subsp huehuetenangensis Nutrition 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 235000005822 corn Nutrition 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000003337 fertilizer Substances 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000003973 irrigation Methods 0.000 description 1
- 230000002262 irrigation Effects 0.000 description 1
- 230000002015 leaf growth Effects 0.000 description 1
- 235000009973 maize Nutrition 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 229910052757 nitrogen Inorganic materials 0.000 description 1
- 235000003715 nutritional status Nutrition 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 208000024891 symptom Diseases 0.000 description 1
- 235000013311 vegetables Nutrition 0.000 description 1
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/34—Sorting according to other particular properties
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/02—Measures preceding sorting, e.g. arranging articles in a stream orientating
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/34—Sorting according to other particular properties
- B07C5/342—Sorting according to other particular properties according to optical properties, e.g. colour
- B07C5/3422—Sorting according to other particular properties according to optical properties, e.g. colour using video scanning devices, e.g. TV-cameras
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/36—Sorting apparatus characterised by the means used for distribution
- B07C5/361—Processing or control devices therefor, e.g. escort memory
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C5/00—Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
- B07C5/36—Sorting apparatus characterised by the means used for distribution
- B07C5/361—Processing or control devices therefor, e.g. escort memory
- B07C5/362—Separating or distributor mechanisms
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B07—SEPARATING SOLIDS FROM SOLIDS; SORTING
- B07C—POSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
- B07C2501/00—Sorting according to a characteristic or feature of the articles or material to be sorted
- B07C2501/009—Sorting of fruit
Abstract
The invention discloses a red ginseng sorting device and a sorting method based on machine vision, wherein the device comprises the following components: the device comprises a feeding hopper, a conveying table, a conveying belt, a camera, a sorting steering engine, a distributing hopper and a control part; the red ginseng sorting method based on machine vision comprises the following steps: s1: the camera collects the red ginseng image on the transmission roller and transmits the red ginseng image to the MCU of the control part; s2: identifying and extracting image contour features of red ginseng; s3: extracting color characteristics of the red ginseng image; s4: establishing a machine learning model; s5: identifying the levels of different fruits by using a machine learning model; aiming at the characteristic that the red ginseng peel is easy to break, the smooth conveyor belt designed by the invention can independently discharge the red ginseng, avoid accumulation and prevent peel damage; the machine vision image processing method provided by the invention has the advantages of high identification precision for fruits and high sorting accuracy.
Description
Technical Field
The invention belongs to the technical field of machine vision, and particularly relates to a red ginseng sorting device and a sorting method based on machine vision.
Background
The earliest application of machine vision technology in the agricultural field began in the middle and late 80 s of the last century. In 1986, g.e.rehkugler et al used machine vision to detect surface bruising of apples, and classified apples by american apple classification standards, with a large error in classification results. In 1988, davenel et al used machine vision to extract apple size and crush injury characteristics to rank apples. In 1990, han.y.j. Et al measured the reflectance of crops from background soil using a spectrophotometer, separating crop images from background soil. In 1991, tarbell K.A. et al used chromaticity coordinates to overcome the effects of changes in illumination during studies of maize growth characteristics. In 1992, segineerI et al used machine vision to monitor plant leaf growth, and the results could be used as control signals for irrigation systems. In 1995, nozer et al studied a system for automatically classifying fruits by using machine vision, extracted feature quantities such as shape, size, color, etc., of fruits, and classified by using BP neural network. In 1996, ahmadI.S. and the like extract corn image color information to find that RGB values can well reflect drought and fertilizer deficiency symptoms of crops. In 2002, hiroaki, ishizawa analyzed the correlation between chemical composition of three apples of different maturity stages and their mouthfeel and spectral image data. In 2005, panitnatyimmam et al detected the shape, size, color and surface area of mangoes using computer vision techniques. In 2003, e.j.vanhenten et al developed a machine vision based robotic system for picking cucumbers in a greenhouse. In 2010, nick Sigrimis et al used a CCD camera in combination with a filter to detect the nutritional status and growth status of crops.
For the research condition of the machine vision technology in the agricultural production field, compared with other developed countries, china starts later, and research is started in the 90 th century. In 1995 Chen Xiaoguang, the image processing technology was used to analyze and distinguish the growth information of vegetable seedlings, and provide necessary information for transplanting and thinning. In 1998, li Shaokun et al applied image processing techniques to extraction of crop information and growth monitoring. In 2005, wu Congling and the like can be used for predicting the real leaf area of the plant by using a computer to nondestructively measure the leaf crown projection area of the cucumber, so that better precision is achieved. In 2008, song Yajie et al studied a nondestructive crop moisture detection model based on machine vision technology. In 2009, zhang Yuan and the like adopted a multispectral machine vision technology to detect rape nitrogen, so as to obtain detection models of different growth periods. In 2012, peng Hui and the like propose a binocular vision-based parallax segmentation algorithm for the situation that overlapping fruits are not easy to segment, and the fruits can be segmented well. In 2014, li Wenbin and other studies on the positioning and maturity of the Lingwu long dates by utilizing a machine vision technology, a Lingwu long date maturity grade identification algorithm based on the combination of hue H and red color ratio is provided, and the discrimination accuracy of the algorithm reaches 92.60%. Although the application of machine vision technology in agricultural production has been rapidly developed in recent decades, china still needs to be continuously improved compared with other developed countries.
For the agricultural product grading technology based on machine vision, part of related researches exist at home and abroad, and the existing researches have the following two problems: (1) only the identification and detection of near-circular fruits such as apples, oranges, tomatoes and the like are carried out, and related grading standards and detection methods are not available for special-shaped fruits such as newly developed plateau special agricultural products, namely red fruit ginseng and spider fruits. (2) The existing research is mainly carried out on an image processing algorithm, the classification recognition theory is researched, and the recognition and sorting linkage is rarely developed for corresponding sorting system equipment.
Disclosure of Invention
The invention provides a red ginseng sorting device and a sorting method based on machine vision, which are characterized in that red ginseng is fed through a sorting device, red ginseng images are collected by a camera in the process of conveying, the collected red ginseng images are analyzed and processed by the sorting method provided by the invention, namely an image recognition processing method, after analysis processing results are obtained, a sorting mechanical arm is controlled by an MCU processing program in a control part, and red ginseng of different grades is sorted to different sorting hoppers.
In order to achieve the technical purpose, the invention is realized by the following technical scheme:
a machine vision based red fruit ginseng sorting device comprising: the device comprises a feeding hopper, a conveying table, a conveying belt, a camera, a sorting steering engine, a distributing hopper and a control part;
the feeding hopper is arranged at the left side of the conveying table;
the conveying table is rotatably connected with a conveying belt;
a camera is arranged between the conveying table and the feeding hopper and above the conveying table;
a sorting steering engine is arranged on one side of the conveying table to finish sorting actions; a distributing hopper matched with the sorting steering engine is correspondingly arranged on the other side of the conveying table;
the side edge of the conveying table is connected with a control part, and the control part is internally integrated and connected with an MCU; and performing machine vision image processing analysis on the image acquired by the camera through the MCU, and controlling the driving of the sorting steering engine through the MCU.
Preferably, a plurality of fruit position grooves are formed in the conveyor belt, and each fruit can fall into one fixed fruit position groove;
preferably, the camera is placed in the lamp box of the light shield above the conveying table so as to obtain continuous and stable ambient light, thereby improving the recognition accuracy.
Another object of the present invention is to provide a machine vision based red ginseng sorting method, comprising the steps of:
s1: collecting red ginseng images on the conveying belt by a camera and transmitting the red ginseng images to an MCU of a control part;
s2: identifying and extracting image contour features of red ginseng:
a modified minimum graph cut (GrabCut) algorithm is used: firstly, modeling an object and a background by using a full covariance GMM (mixed gaussian model) of K gaussian components (generally k=5) for an RGB color space respectively; then dividing the pixels into background pixels and target pixels through frame selection, distributing Gaussian components in the GMM to each pixel, substituting RGB values of the pixel n into each Gaussian component in the target GMM, learning parameters of optimizing the GMM for given image data, and estimating whether each pixel belongs to the target GMM or the background GMM; finally, parameters of the GMM modeling the target and the background are better through a plurality of iterative processes, and the whole iterative process is converged to an optimal image segmentation result;
s3: extracting color features of red ginseng images: the difference of color components H of fruits in an HSV color space is utilized, and for the components H of the fruit images, the distribution characteristics of different angles of the histogram are divided into subsets with obvious differences according to different maturity levels, so that the identification of the colors of the fruits is realized;
s4: establishing a machine learning model: performing cluster analysis by using K-means, taking the mean value of the H component as an initial center point, setting K=3, and dividing the initial training set into 3 feature sets;
s5: identifying the levels of different fruits using a machine learning model: training 3 SVM classifiers with 3 feature sets and judging by using a one-to-one strategy;
preferably, the image contour feature recognition and extraction method specifically comprises the following steps:
s2.1: and (3) establishing a color model: using RGB color space, modeling the target and the background with a K gaussian component (generally k=5) full covariance GMM (mixed gaussian model), respectively, for each pixel, without a certain gaussian component from the target GMM or without a certain gaussian component from the background GMM;
s2.2: initializing: obtaining an initial set by selecting the target through a frame, namely, all pixels outside the frame are used as background pixels, and all pixels in the frame are used as pixels which are possible targets;
s2.3: iterative minimization: (1) assigning gaussian components in the GMM to each pixel, substituting RGB values of pixel n into each gaussian component in the target GMM, (2) learning parameters for optimizing the GMM for given image data, (3) estimating whether each pixel belongs to the target GMM or the background GMM by segmentation, (4) repeating (1) to (3) until the iterative process converges;
s2.4: smoothing the boundary to form a final contour;
preferably, the image color feature extraction method specifically comprises the following steps:
s3.1: converting an RGB image acquired by a camera into an HSV color space;
s3.2: dividing the detected image into different levels according to maturity, and calculating the mean value and variance of H components in each level for the distribution of the H components in different angles so as to obtain the distribution characteristics of the H components in different levels;
s3.3: in the later stage, the machine learning model is used for identifying the distribution characteristics of the H component at different levels in the process of identifying the levels of different fruits, and the training machine is divided into corresponding attribution levels according to the characteristics presented by the H component of the image;
preferably, the machine learning model building process is as follows:
s4.1: performing cluster analysis by using K-means; the process comprises the following steps: (1) taking the mean value of the H component as an initial clustering center point, taking 'small intra-cluster difference and big inter-cluster difference' as optimization targets, and setting the difference as Euclidean distance from a sample point to the mass center of a cluster where the sample point is located; (2) circularly calculating the distance from each sample point to the centroid, and distributing the sample to the centroid at the position close to the centroid to obtain K clusters; (3) for each cluster, calculating the average distance of all sample points divided into the cluster as a new centroid, and calculating again; (4) repeating the three steps until all clusters are not changed;
s4.2: in order to facilitate operation and improve sorting efficiency, the prepared initialization training set is divided into 3 clusters, namely 3 feature sets divided by H components, through a K-means algorithm;
s4.3: training an SVM classifier by using the feature set; the process comprises the following steps: (1) mapping the feature vector of the instance to some points in space as support vectors; (2) searching a hyperplane so that points closer to the hyperplane can have larger spacing; (3) distinguishing the attribution classification of the feature vector by using the obtained hyperplane;
s4.4: judging by using a one-to-one strategy; the method comprises the following steps: (1) calculating the possibility of belonging to the class by using three trained binary classifiers for the feature vectors to be classified; (3) and selecting the highest-scoring class as the class of the characteristics of the input sample to be classified, thereby realizing final judgment.
The beneficial effects of the invention are as follows:
the device provided by the invention can sort the red ginseng, and the smooth conveyor belt designed by the invention can separate the red ginseng, avoid accumulation and prevent peel damage aiming at the characteristic that the red ginseng peel is easy to break; the independent arrangement of the red ginseng does not influence the image acquisition of the camera on the red ginseng; in addition, the machine vision image processing method provided by the invention has high identification precision on fruits and high sorting accuracy.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a machine vision red ginseng sorting apparatus of the present invention;
in the drawings, the list of components represented by the various numbers is as follows:
the device comprises a 1-feeding hopper, a 2-conveying table, 201-supporting legs, a 3-conveying belt, 301-fruit position grooves, 4-cameras, 401-light shields, 5-sorting steering engines, 6-distributing hoppers and 7-control parts.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
A machine vision based red fruit ginseng sorting device comprising: the automatic sorting machine comprises a feeding hopper 1, a conveying table 2, a conveying belt 3, a camera 4, a sorting steering engine 5, a distributing hopper 6 and a control part 7;
the feeding hopper 1 is arranged at the left side of the conveying table 2;
a rotatable connection conveyor belt 3 is arranged in the conveyor table 2;
a camera 4 is arranged between the conveying table 2 and the feeding hopper 6 and above the conveying table 2;
a sorting steering engine 5 is arranged on one side of the conveying table 2 to finish sorting actions; a distributing hopper 6 matched with the sorting steering engine 5 is correspondingly arranged on the other side of the conveying table 2;
the side edge of the conveying table 2 is connected with a control part 7, and the control part 7 is internally integrated and connected with an MCU; the image acquired by the camera 4 is processed and analyzed by the MCU, and the driving of the sorting steering engine 5 is controlled by the MCU.
Preferably, a plurality of fruit position slots 301 are arranged on the conveyor belt 3, and each fruit can fall into one fixed fruit position slot 301;
preferably, the camera 4 is placed in the light box of the light shield 401 above the conveying table 2, so as to obtain continuous and stable ambient light, thereby improving the recognition accuracy.
Example 2
A red ginseng sorting method based on machine vision comprises the following steps:
s1: collecting red ginseng images on the conveying belt by a camera and transmitting the red ginseng images to an MCU of a control part;
s2: identifying and extracting image contour features of red ginseng:
a modified minimum graph cut (GrabCut) algorithm is used: firstly, modeling an object and a background by using a full covariance GMM (mixed gaussian model) of K gaussian components (generally k=5) for an RGB color space respectively; then dividing the pixels into background pixels and target pixels through frame selection, distributing Gaussian components in the GMM to each pixel, substituting RGB values of the pixel n into each Gaussian component in the target GMM, learning parameters of optimizing the GMM for given image data, and estimating whether each pixel belongs to the target GMM or the background GMM; finally, parameters of the GMM modeling the target and the background are better through a plurality of iterative processes, and the whole iterative process is converged to an optimal image segmentation result;
s3: extracting color features of red ginseng images: the difference of color components H of fruits in an HSV color space is utilized, and for the components H of the fruit images, the distribution characteristics of different angles of the histogram are divided into subsets with obvious differences according to different maturity levels, so that the identification of the colors of the fruits is realized;
s4: establishing a machine learning model: performing cluster analysis by using K-means, taking the mean value of the H component as an initial center point, setting K=3, and dividing the initial training set into 3 feature sets;
s5: identifying the levels of different fruits using a machine learning model: training 3 SVM classifiers with 3 feature sets and judging by using a one-to-one strategy;
preferably, the image contour feature recognition and extraction method specifically comprises the following steps:
s2.1: and (3) establishing a color model: using RGB color space, modeling the target and the background with a K gaussian component (generally k=5) full covariance GMM (mixed gaussian model), respectively, for each pixel, without a certain gaussian component from the target GMM or without a certain gaussian component from the background GMM;
s2.2: initializing: obtaining an initial set by selecting the target through a frame, namely, all pixels outside the frame are used as background pixels, and all pixels in the frame are used as pixels which are possible targets;
s2.3: iterative minimization: (1) assigning gaussian components in the GMM to each pixel, substituting RGB values of pixel n into each gaussian component in the target GMM, (2) learning parameters for optimizing the GMM for given image data, (3) estimating whether each pixel belongs to the target GMM or the background GMM by segmentation, (4) repeating (1) to (3) until the iterative process converges;
s2.4: smoothing the boundary to form a final contour;
preferably, the image color feature extraction method specifically comprises the following steps:
s3.1: converting an RGB image acquired by a camera into an HSV color space;
s3.2: dividing the detected image into different levels according to maturity, and calculating the mean value and variance of H components in each level for the distribution of the H components in different angles so as to obtain the distribution characteristics of the H components in different levels;
s3.3: in the later stage, the machine learning model is used for identifying the distribution characteristics of the H component at different levels in the process of identifying the levels of different fruits, and the training machine is divided into corresponding attribution levels according to the characteristics presented by the H component of the image;
preferably, the machine learning model building process is as follows:
s4.1: performing cluster analysis by using K-means; the process comprises the following steps: (1) taking the mean value of the H component as an initial clustering center point, taking 'small intra-cluster difference and big inter-cluster difference' as optimization targets, and setting the difference as Euclidean distance from a sample point to the mass center of a cluster where the sample point is located; (2) circularly calculating the distance from each sample point to the centroid, and distributing the sample to the centroid at the position close to the centroid to obtain K clusters; (3) for each cluster, calculating the average distance of all sample points divided into the cluster as a new centroid, and calculating again; (4) repeating the three steps until all clusters are not changed;
s4.2: in order to facilitate operation and improve sorting efficiency, the prepared initialization training set is divided into 3 clusters, namely 3 feature sets divided by H components, through a K-means algorithm;
s4.3: training an SVM classifier by using the feature set; the process comprises the following steps: (1) mapping the feature vector of the instance to some points in space as support vectors; (2) searching a hyperplane so that points closer to the hyperplane can have larger spacing; (3) distinguishing the attribution classification of the feature vector by using the obtained hyperplane;
s4.4: judging by using a one-to-one strategy; the method comprises the following steps: (1) calculating the possibility of belonging to the class by using three trained binary classifiers for the feature vectors to be classified; (3) and selecting the highest-scoring class as the class of the characteristics of the input sample to be classified, thereby realizing final judgment.
Claims (7)
1. Machine vision-based red fruit ginseng sorting device, which is characterized by comprising: the device comprises a feeding hopper, a conveying table, a conveying belt, a camera, a sorting steering engine, a distributing hopper and a control part;
the feeding hopper is arranged at the left side of the conveying table;
the conveying table is rotatably connected with a conveying belt;
a camera is arranged between the conveying table and the feeding hopper and above the conveying table;
a sorting steering engine is arranged on one side of the conveying table to finish sorting actions; a distributing hopper matched with the sorting steering engine is correspondingly arranged on the other side of the conveying table;
the side edge of the conveying table is connected with a control part, and the control part is internally integrated and connected with an MCU; and performing machine vision image processing analysis on the image acquired by the camera through the MCU, and controlling the driving of the sorting steering engine through the MCU.
2. The machine vision-based red fruit ginseng sorting device according to claim 1, wherein a plurality of fruit position grooves are formed in the conveyor belt.
3. The machine vision-based red fruit ginseng sorting device according to claim 1, wherein the camera is placed in a light box of a light shield above the conveying table to obtain continuous and stable ambient light, thereby improving recognition accuracy.
4. The red ginseng sorting method based on machine vision is characterized by comprising the following steps of:
s1: collecting red ginseng images on the conveying belt by a camera and transmitting the red ginseng images to an MCU of a control part;
s2: identifying and extracting image contour features of red ginseng:
an improved minimum graph cut algorithm is adopted: firstly, modeling an object and a background by using a full covariance GMM of K Gaussian components for an RGB color space respectively; then dividing the pixels into background pixels and target pixels through frame selection, distributing Gaussian components in the GMM to each pixel, substituting RGB values of the pixel n into each Gaussian component in the target GMM, learning parameters of optimizing the GMM for given image data, and estimating whether each pixel belongs to the target GMM or the background GMM; finally, parameters of the GMM modeling the target and the background are better through a plurality of iterative processes, and the whole iterative process is converged to an optimal image segmentation result;
s3: extracting color features of red ginseng images: the difference of color components H of fruits in an HSV color space is utilized, and for the components H of the fruit images, the distribution characteristics of different angles of the histogram are divided into subsets with obvious differences according to different maturity levels, so that the identification of the colors of the fruits is realized;
s4: establishing a machine learning model: performing cluster analysis by using K-means, taking the mean value of the H component as an initial center point, setting K=3, and dividing the initial training set into 3 feature sets;
s5: identifying the levels of different fruits using a machine learning model: the 3 SVM classifiers are trained with 3 feature sets and judged using a one-to-one strategy.
5. The machine vision-based red ginseng sorting method according to claim 4, wherein the image contour feature recognition and extraction method comprises the specific steps of:
s2.1: and (3) establishing a color model: using RGB color space, modeling the target and the background by using a K Gaussian component full covariance GMM respectively, wherein for each pixel, a certain Gaussian component not coming from the target GMM is not needed, and a certain Gaussian component not coming from the background GMM is needed;
s2.2: initializing: obtaining an initial set by selecting the target through a frame, namely, all pixels outside the frame are used as background pixels, and all pixels in the frame are used as pixels which are possible targets;
s2.3: iterative minimization: (1) assigning gaussian components in the GMM to each pixel, substituting RGB values of pixel n into each gaussian component in the target GMM, (2) learning parameters for optimizing the GMM for given image data, (3) estimating whether each pixel belongs to the target GMM or the background GMM by segmentation, (4) repeating (1) to (3) until the iterative process converges;
s2.4: and smoothing the boundary to form a final contour.
6. The machine vision-based red ginseng sorting method according to claim 4, wherein the image color feature extraction method specifically comprises the steps of:
s3.1: converting an RGB image acquired by a camera into an HSV color space;
s3.2: dividing the detected image into different levels according to maturity, and calculating the mean value and variance of H components in each level for the distribution of the H components in different angles so as to obtain the distribution characteristics of the H components in different levels;
s3.3: in the later stage, the machine learning model is used for identifying the distribution characteristics of the H component at different levels in the process of identifying the levels of different fruits, and the training machine is divided into corresponding attribution levels according to the characteristics presented by the H component of the image.
7. The machine vision based red ginseng sorting method of claim 4, wherein the machine learning model building process is:
s4.1: performing cluster analysis by using K-means; the process comprises the following steps: (1) taking the mean value of the H component as an initial clustering center point, taking 'small intra-cluster difference and big inter-cluster difference' as optimization targets, and setting the difference as Euclidean distance from a sample point to the mass center of a cluster where the sample point is located; (2) circularly calculating the distance from each sample point to the centroid, and distributing the sample to the centroid at the position close to the centroid to obtain K clusters; (3) for each cluster, calculating the average distance of all sample points divided into the cluster as a new centroid, and calculating again; (4) repeating the three steps until all clusters are not changed;
s4.2: in order to facilitate operation and improve sorting efficiency, the prepared initialization training set is divided into 3 clusters, namely 3 feature sets divided by H components, through a K-means algorithm;
s4.3: training an SVM classifier by using the feature set; the process comprises the following steps: (1) mapping the feature vector of the instance to some points in space as support vectors; (2) searching a hyperplane so that points closer to the hyperplane can have larger spacing; (3) distinguishing the attribution classification of the feature vector by using the obtained hyperplane;
s4.4: judging by using a one-to-one strategy; the method comprises the following steps: (1) calculating the possibility of belonging to the class by using three trained binary classifiers for the feature vectors to be classified; (3) and selecting the highest-scoring class as the class of the characteristics of the input sample to be classified, thereby realizing final judgment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211657930.5A CN116899896A (en) | 2022-12-22 | 2022-12-22 | Red ginseng sorting device and sorting method based on machine vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211657930.5A CN116899896A (en) | 2022-12-22 | 2022-12-22 | Red ginseng sorting device and sorting method based on machine vision |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116899896A true CN116899896A (en) | 2023-10-20 |
Family
ID=88361480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211657930.5A Pending CN116899896A (en) | 2022-12-22 | 2022-12-22 | Red ginseng sorting device and sorting method based on machine vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116899896A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117437217A (en) * | 2023-12-18 | 2024-01-23 | 武汉博源新材料科技集团股份有限公司 | Paper-plastic product sorting method and system based on image recognition |
-
2022
- 2022-12-22 CN CN202211657930.5A patent/CN116899896A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117437217A (en) * | 2023-12-18 | 2024-01-23 | 武汉博源新材料科技集团股份有限公司 | Paper-plastic product sorting method and system based on image recognition |
CN117437217B (en) * | 2023-12-18 | 2024-03-08 | 武汉博源新材料科技集团股份有限公司 | Paper-plastic product sorting method and system based on image recognition |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Liu et al. | A detection method for apple fruits based on color and shape features | |
Li et al. | In-field cotton detection via region-based semantic image segmentation | |
Kurtulmuş et al. | Detecting corn tassels using computer vision and support vector machines | |
Li et al. | Identifying blueberry fruit of different growth stages using natural outdoor color images | |
US9527115B2 (en) | Computer vision and machine learning software for grading and sorting plants | |
CN105718945B (en) | Apple picking robot night image recognition method based on watershed and neural network | |
Puttemans et al. | Automated visual fruit detection for harvest estimation and robotic harvesting | |
Sun et al. | Image processing algorithms for infield single cotton boll counting and yield prediction | |
CN107316289A (en) | Crop field spike of rice dividing method based on deep learning and super-pixel segmentation | |
Arefi et al. | Development of an expert system based on wavelet transform and artificial neural networks for the ripe tomato harvesting robot | |
CN116899896A (en) | Red ginseng sorting device and sorting method based on machine vision | |
Raut et al. | Assessment of fruit maturity using digital image processing | |
Concepcion II et al. | Variety classification of Lactuca sativa seeds using single-kernel RGB images and spectro-textural-morphological feature-based machine learning | |
Ong et al. | Image-based oil palm leaves disease detection using convolutional neural network | |
Ramirez et al. | Agroindustrial plant for the classification of hass avocados in real-time with ResNet-18 architecture | |
Hemalatha et al. | Automatic tomato leaf diseases classification and recognition using transfer learning model with image processing techniques | |
Chen et al. | Automatic classification and detection of oranges based on computer vision | |
Tan et al. | A framework for measuring infection level on cacao pods | |
Muladi et al. | Classification Of Eligibility Consumption Of Manalagi Apple Fruit Varieties Using Backpropagation | |
CN112529838A (en) | Tobacco leaf maturity online judging method based on image processing technology | |
Shuai et al. | Image segmentation of field rape based on template matching and K-means clustering | |
Huang et al. | Application of computer vision technology in agriculture | |
Sivaranjani et al. | Computer vision-based cashew nuts grading system using machine learning methods | |
Dai et al. | Recognition of cutting region for pomelo picking robot based on machine vision | |
Tan et al. | A method for detecting and segmenting infected part of cacao pods |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |