Garlic seed shoot tip image recognition method
Through curve approximation to discrete data point fitting and curvature value calculation, the garlic seed bud tip identification process is simplified, solving the problems of low garlic seed identification efficiency and high equipment performance requirements in the existing technology, and achieving fast and accurate garlic seed bud tips. Recognition,applicable to multi-pose and different varieties of garlic,images.
Patent Information
- Application Number
- CN202410813574.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-06
AI Technical Summary
When faced with garlic seeds with different shapes and multiple postures, the existing garlic sprout tip recognition methods are difficult to balance the requirements of high recognition rate, fast speed and low equipment cost. In particular, the deep learning method has a large amount of calculation and requires equipment performance. High, and the recognition effect is not good for specific shapes and curved garlic species.
Use the fitting method of curve approximation to discrete data points to fit the outer contour curve of garlic seeds, recalculate the curvature value, sort the outer contour points using the point closest to the center, and judge the bud tip point through the characteristics of maximum curvature and large root curvature, simplifying Reduce the amount of computation and improve recognition efficiency.
It achieves fast and accurate identification of garlic seed shoot tips, is suitable for garlic seed images of different varieties and multi-poses, reduces the requirements for equipment computing performance, and is suitable for practical applications of garlic planting machines.
Smart Images

Figure CN118608801A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of intelligent agricultural machinery, and in particular to a method for identifying images of garlic seed bud tips. Background Art
[0002] The methods of machine vision recognition of garlic sprouts at home and abroad are mainly divided into a method of comparing the area of the garlic sprout outline and the designated area at the root, a method based on the maximum curvature value at the garlic sprout outline, and a deep learning method. There are many varieties of garlic, and the shapes and collected contour sprout features are diverse, resulting in poor recognition effect of the method of comparing the sprout tip and the designated area at the root for garlic with irregular center of gravity distribution. The method based on the maximum curvature value at the garlic sprout tip is not good for garlic with short and relatively curved sprout tips. Although the deep learning method performs well, it has a large amount of calculation and high requirements for equipment computing performance. The existing methods for identifying garlic sprouts are difficult to take into account the practical application requirements of high recognition rate, fast speed, and low equipment cost. In order to improve the adaptability to garlic seeds with different shapes and multi-postures, the present invention provides a garlic sprout tip image recognition method suitable for garlic planting machine application. Summary of the invention
[0003] The object of the present invention is to provide a method for identifying a garlic seed bud tip image, by which the bud tip position can be identified quickly and accurately.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows: A method for identifying garlic seed bud tip images comprises the following steps: Step 1: Obtain the garlic seed image to be identified, grayscale the garlic seed image, perform Gamma grayscale correction, and Gaussian filter noise reduction to generate a binary garlic seed image and perform a closed operation. The outer contour point sequence of the largest connected area is retained. This point sequence is the garlic seed outer contour point sequence. The garlic seed outer contour point sequence is fitted according to the curve approximation discrete data point fitting method to obtain the parameter equation of the garlic seed outer contour curve. The parameter variables are taken separately. Get the fitted garlic seed outer contour point sequence , is a positive integer and , is the average number of points in the outer contour point sequence of the same type of garlic dataset collected, and the sequence for .
[0005] Step 2: Use the garlic seed outer contour point sequence generated in step 1 Calculate the coordinates of each point, calculate the coordinates of the center of the garlic seed outer contour and the distance between the center and each outer contour point, and start from the outer contour point with the smallest distance from the center, and reorder the outer contour point sequence clockwise , generating the sequence .
[0006] Step 3: Calculate the curvature method based on the discrete point data, and rearrange the outer contour point sequence in step 2 R 1 i In, from m The outer contour points start at every interval g-1 The curvature of the contour points is calculated from the outer contour points K i , m is a positive integer and , is a positive integer and , generate a sequence of curvature estimates ,sequence for .
[0007] Step 4: The curvature estimation sequence obtained in step 3 ,make , , , , j Take ,Compare , , , and The size of is the maximum curvature value of the group and j or , As the effective curvature value is retained, thus obtaining the effective curvature sequence , compare sequences The curvature values in the equation are as follows to get the maximum value And in the sequence The serial number in , the second largest value And in the sequence The serial number in , and the third largest value And in the sequence The serial number in .
[0008] Step 5: The effective curvature value obtained in step 4 , and And in the sequence The serial number in and Make a judgment: 1) When When The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0009] 2) When When and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; otherwise, the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0010] Preferably, the curve approximation fitting method of discrete data points in step 1 includes using a Bezier curve to fit the outer contour points of the garlic seeds. Fitting is performed, and the Bezier curve equation is: , where is the parameter variable; is the outer contour point of garlic seeds after fitting. ; For garlic Outer contour points, ; is the Bernstein basis function, and its calculation formula is: .
[0011] Preferably, the method for calculating the curvature of the outer contour point according to the discrete point data in step 3 includes using im , i and i+m The coordinates of the outer contour points , and Calculate outer contour points Curvature K i There are two situations: 1) When When , the outer contour points are calculated by the three-point circumscribed circle method The curvature is calculated as follows: , where , , , , is a positive integer and .
[0012] 2) When When the outer contour point The curvature value is equal to 0.
[0013] The beneficial effects that the present invention can achieve are: The present invention proposes a method for identifying a garlic seed bud tip image. The method judges the garlic seed bud tip based on the characteristics that the curvature at the bud tip of the garlic seed image contour is the largest and the curvature at the root presents two adjacent larger values. The entire calculation process of the bud tip recognition only requires a simple calculation of the coordinates of the contour point, and the calculation amount is small, the efficiency is high, and the requirements on the computing performance resources of the equipment are low. The method has strong applicability to garlic seeds of different varieties and garlic seed images obtained in multiple postures, and is easy to be implemented on a garlic planting machine based on machine vision.
[0014] The present invention proposes to use a fitting method of curve approximation discrete data points to fit the outer contour curve of garlic seeds, and re-take a discrete point sequence on the fitted outer contour curve of garlic seeds, and then calculate the curvature of each point, which can effectively eliminate the situation that the tiny jagged curvature of the outer contour of garlic seeds is greater than the curvature of the bud tip and the root, and can highlight the characteristics of the larger curvature of the bud tip and the root of the outer contour of garlic seeds.
[0015] The present invention proposes to divide the garlic seed contour area by reordering the outer contour point sequence with the point closest to the center of the garlic outer contour as the starting point, and only use the garlic seed contour points with larger curvature in the specified area to judge the garlic seed bud tip, so as to achieve a fast and accurate effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0017] Figure 1 A flow chart of a method for identifying garlic seed bud tip images provided by an embodiment of the present invention; Figure 2 The two garlic seeds are input images in Example 1 of the present invention; Figure 3 The corresponding embodiment of the present invention 1 Figure 1 Schematic diagram of the outer contours of garlic seeds extracted from two garlic seed images after image preprocessing; Figure 4 The corresponding embodiment of the present invention 1 Figure 1 Schematic diagram of the contours of two garlic seeds after the outer contours are fitted; Figure 5 The corresponding embodiment of the present invention 1 Figure 1 Schematic diagram of the effective curvature values of two garlic seed outer contour points; Figure 6 The corresponding embodiment of the present invention 1 Figure 1 Schematic diagram of the results of identifying the sprout tips of two garlic seeds. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present invention more clear, it should be understood that the specific implementation methods described herein are only used to explain the present invention and are not intended to limit the present invention.
[0019] Example 1 First, randomly select no less than 200 garlic seeds of the same variety as the garlic seeds to be identified, collect the image of each garlic seed, perform grayscale processing, Gamma grayscale correction, and Gaussian filter noise reduction on the garlic seed image, generate a binary garlic seed image and perform closed operation processing, retain the outer contour point sequence of the largest connected area, obtain the garlic seed outer contour point sequence data set, and calculate the average number of points in the outer contour point sequence of a single garlic seed in this data set. .
[0020] Step 1: Obtain the garlic seed image to be identified, grayscale the garlic seed image, perform Gamma grayscale correction, and Gaussian filter noise reduction to generate a binary garlic seed image and perform a closed operation. The outer contour point sequence of the largest connected area is retained. The largest connected area is the outer contour point sequence of the garlic seed. The outer contour point sequence of the garlic seed is fitted according to the fitting method of the curve approximating discrete data points to obtain the parametric equation of the garlic seed outer contour curve. The parameter variables are taken separately. Get the fitted garlic seed outer contour point sequence , ,sequence for .
[0021] Step 2: Use the garlic seed outer contour point sequence generated in step 1 Calculate the coordinates of each point, calculate the coordinates of the center of the garlic seed outer contour and the distance between the center and each outer contour point, and start from the outer contour point with the smallest distance from the center, and reorder the outer contour point sequence clockwise , generating the sequence .
[0022] Step 3: Calculate the curvature method based on the discrete point data, and rearrange the outer contour point sequence in step 2 R 1 i In, from m The outer contour points start at every interval g -1 outer contour point to calculate the curvature of the contour point K i , , , generate a sequence of curvature estimates ,sequence for .
[0023] Step 4: The curvature estimation sequence obtained in step 3 ,make , , , , j Take ,Compare , , , and The size of is the maximum curvature value of the group and or , As the effective curvature value is retained, thus obtaining the effective curvature sequence , compare sequences The curvature values in the equation are as follows to get the maximum value And in the sequence The serial number in , the second largest value And in the sequence The serial number in , and the third largest value And in the sequence The serial number in .
[0024] Step 5: The effective curvature value obtained in step 4 , and And in the sequence The serial number in and Make a judgment: 1) When When The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0025] 2) When When and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; otherwise, the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0026] In step 1, the outer contour points of the garlic seeds are shaped by using Bezier curves. Fitting is performed, and the Bezier curve equation is: , where is the parameter variable; is the outer contour point of garlic seeds after fitting. ; For garlic Outer contour points, ; is the Bernstein basis function, and its calculation formula is: .
[0027] In step 3, the method for calculating the curvature of the outer contour point according to the discrete point data specifically includes using the im , i and i+m The coordinates of the outer contour points , and Calculate outer contour points Curvature K i There are two situations: 1) When When , the outer contour points are calculated by the three-point circumscribed circle method The curvature is calculated as follows: , where , , , , is a positive integer and .
[0028] 2) When When the outer contour point The curvature value is equal to 0.
[0029] Example 2 First, randomly select no less than 200 garlic seeds of the same variety as the garlic seeds to be identified, collect the image of each garlic seed, perform grayscale processing, Gamma grayscale correction, and Gaussian filter noise reduction on the garlic seed image, generate a binary garlic seed image and perform closed operation processing, retain the outer contour point sequence of the largest connected area, obtain the garlic seed outer contour point sequence data set, and calculate the average number of points in the outer contour point sequence of a single garlic seed in this data set. .
[0030] Step 1: Obtain the garlic seed image to be identified, grayscale the garlic seed image, perform Gamma grayscale correction, and Gaussian filter noise reduction to generate a binary garlic seed image and perform a closed operation. The outer contour point sequence of the largest connected area is retained. The largest connected area is the outer contour point sequence of the garlic seed. The outer contour point sequence of the garlic seed is fitted according to the fitting method of the curve approximating discrete data points to obtain the parametric equation of the garlic seed outer contour curve. The parameter variables are taken separately. Get the fitted garlic seed outer contour point sequence , ,sequence for .
[0031] Step 2: Use the garlic seed outer contour point sequence generated in step 1 Calculate the coordinates of each point, calculate the coordinates of the center of the garlic seed outer contour and the distance between the center and each outer contour point, and start from the outer contour point with the smallest distance from the center, and reorder the outer contour point sequence clockwise , generating the sequence .
[0032] Step 3: Calculate the curvature method based on the discrete point data, and rearrange the outer contour point sequence in step 2 R 1 i In, from m The outer contour points start at every interval g-1 The curvature of the contour points is calculated from the outer contour points K i , , , generate a sequence of curvature estimates ,sequence for .
[0033] Step 4: The curvature estimation sequence obtained in step 3 ,make , , , , j Take ,Compare , , , and The size of is the maximum curvature value of the group and or , As the effective curvature value is retained, thus obtaining the effective curvature sequence , compare sequences The curvature values in the equation are as follows to get the maximum value And in the sequence The serial number in , the second largest value And in the sequence The serial number in , and the third largest value And in the sequence The serial number in .
[0034] Step 5: The effective curvature value obtained in step 4 , and And in the sequence The serial number in and Make a judgment: 1) When When The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0035] 2) When When and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; otherwise, the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0036] In step 1, the outer contour points of the garlic seeds are shaped by using Bezier curves. Fitting is performed, and the Bezier curve equation is: , where is the parameter variable; is the outer contour point of garlic seeds after fitting. ; For garlic Outer contour points, ; is the Bernstein basis function, and its calculation formula is: .
[0037] In step 3, the method for calculating the curvature of the outer contour point according to the discrete point data specifically includes using the im , i and i+m The coordinates of the outer contour points , and Calculate outer contour points Curvature K i There are two situations: 1) When When , the outer contour points are calculated by the three-point circumscribed circle method The curvature is calculated as follows: , where , , , , is a positive integer and .
[0038] 2) When When the outer contour point The curvature value is equal to 0.
[0039] Example 3 First, randomly select no less than 200 garlic seeds of the same variety as the garlic seeds to be identified, collect the image of each garlic seed, perform grayscale processing, Gamma grayscale correction, and Gaussian filter noise reduction on the garlic seed image, generate a binary garlic seed image and perform closed operation processing, retain the outer contour point sequence of the largest connected area, obtain the garlic seed outer contour point sequence data set, and calculate the average number of points in the outer contour point sequence of a single garlic seed in this data set. .
[0040] Step 1: Obtain the garlic seed image to be identified, grayscale the garlic seed image, perform Gamma grayscale correction, and Gaussian filter noise reduction to generate a binary garlic seed image and perform a closed operation. The outer contour point sequence of the largest connected area is retained. The largest connected area is the outer contour point sequence of the garlic seed. The outer contour point sequence of the garlic seed is fitted according to the fitting method of the curve approximating discrete data points to obtain the parametric equation of the garlic seed outer contour curve. The parameter variables are taken separately. Get the fitted garlic seed outer contour point sequence , ,sequence for .
[0041] Step 2: Use the garlic seed outer contour point sequence generated in step 1 Calculate the coordinates of each point, calculate the coordinates of the center of the garlic seed outer contour and the distance between the center and each outer contour point, and start from the outer contour point with the smallest distance from the center, and reorder the outer contour point sequence clockwise , generating the sequence .
[0042] Step 3: Calculate the curvature method based on the discrete point data, and rearrange the outer contour point sequence in step 2 R 1 i In, from m The outer contour points start at every interval g-1 The curvature of the contour points is calculated from the outer contour points K i , , ,sequence for .
[0043] Step 4: The curvature estimation sequence obtained in step 3 ,make , , , ,j Take ,Compare , , , and The size of is the maximum curvature value of the group and or , As the effective curvature value is retained, thus obtaining the effective curvature sequence , compare sequences The curvature values in the equation are as follows to get the maximum value And in the sequence The serial number in , the second largest value And in the sequence The serial number in , and the third largest value And in the sequence The serial number in .
[0044] Step 5: The effective curvature value obtained in step 4 , and And in the sequence The serial number in and Make a judgment: 1) When When The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0045] 2) When When and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; otherwise, the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as bud tip points.
[0046] In step 1, the outer contour points of the garlic seeds are shaped by using Bezier curves. Fitting is performed, and the Bezier curve equation is: , where is the parameter variable; is the outer contour point of garlic seeds after fitting. ; For garlic Outer contour points, ; is the Bernstein basis function, and its calculation formula is: .
[0047] In step 3, the method for calculating the curvature of the outer contour point according to the discrete point data specifically includes using the im , i and i+m The coordinates of the outer contour points , and Calculate outer contour points Curvature K i There are two situations: 1) When When , the outer contour points are calculated by the three-point circumscribed circle method The curvature is calculated as follows: , where , , , , is a positive integer and .
[0048] 2) When When the outer contour point The curvature value is equal to 0.
Claims
1. A method for identifying garlic seed bud tip images, characterized in that: The following steps are involved: Step 1: Obtain the garlic seed image to be identified, grayscale the garlic seed image, perform Gamma grayscale correction, and Gaussian filter noise reduction to generate a binary garlic seed image and perform a closed operation. The outer contour point sequence of the largest connected area is retained. The largest connected area is the outer contour point sequence of the garlic seed. The outer contour point sequence of the garlic seed is fitted according to the fitting method of the curve approximating discrete data points to obtain the parametric equation of the garlic seed outer contour curve. The parameter variables are taken separately. Get the fitted garlic seed outer contour point sequence , is a positive integer and , is the average number of points in the outer contour point sequence of the same type of garlic dataset collected, and the sequence for ; Step 2: Use the garlic seed outer contour point sequence generated in step 1 The coordinates of each point are calculated, and the coordinates of the center of the garlic seed outer contour and the distance between the center and each outer contour point are calculated. The outer contour point with the smallest distance to the center is used as the starting point, and the sequence of outer contour points is reordered clockwise. , generating the sequence ; Step 3: Calculate the curvature method based on the discrete point data, and rearrange the outer contour point sequence in step 2 R 1 i In, from m The outer contour points start at every interval g-1 The curvature of the outer contour points is calculated K i , m is a positive integer and , is a positive integer and , generate a sequence of curvature estimates ,sequence for ; Step 4: The curvature estimation sequence obtained in step 3 ,make , , , , j Take ,Compare , , , and The size of is the maximum curvature value of the group and j or , As the effective curvature value, we can get the effective curvature sequence , compare sequences The curvature values in the equation are as follows to get the maximum value And in the sequence The serial number in , the second largest value And in the sequence The serial number in , and the third largest value And in the sequence The serial number in ; Step 5: The effective curvature value obtained in step 4 , and And in the sequence The serial number in and Make a judgment: 1) When When The serial number is The outer contour points of the garlic seeds are output as the bud tip points; 2) When When and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and All less than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; if and Both greater than ,and , then the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as the bud tip points; otherwise, the corresponding sequence The serial number is The outer contour points of the garlic seeds are output as bud tip points.
2. The garlic seed bud tip image recognition method according to claim 1, characterized in that, The curve approximation method of discrete data points described in step 1 includes using Bezier curve to fit the outer contour points of garlic seeds. Fitting is performed, and the Bezier curve equation is: , where is the parameter variable; is the outer contour point of garlic seeds after fitting. ; For garlic Outer contour points, ; is the Bernstein basis function, and its calculation formula is: .
3. The garlic seed bud tip image recognition method according to claim 1, characterized in that, The method for calculating the curvature of the outer contour point according to the discrete point data described in step 3 includes using the im , i and i+m The coordinates of the outer contour points , and Calculate outer contour points Curvature K i There are two situations: 1) When When , the outer contour points are calculated by the three-point circumscribed circle method The curvature is calculated as follows: , In the formula, , , , , is a positive integer and ; 2) When When the outer contour point The curvature value is equal to 0.
