A machine vision based method for seed counting and sizing
By using a machine vision-based method and employing defect detection and intersection correction algorithms to segment adhered seeds, the problems of low efficiency and accuracy in the measurement of small-sized seeds are solved, achieving high-throughput and low-cost seed counting and size measurement.
Patent Information
- Application Number
- CN202310219375.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-03-09
AI Technical Summary
Existing technologies suffer from low efficiency, high cost, susceptibility to environmental factors, and difficulty in outdoor seed testing when measuring small-sized seeds, especially for seeds that are stuck together, which are difficult to accurately separate and count.
A machine vision-based approach is adopted to acquire seed images and use a defect-based adhering seed detection and intersection correction adhering seed segmentation algorithm, combined with binarization processing and opening operation, to achieve seed image segmentation and size measurement.
It enables batch and accurate measurement of seed quantity and size, is suitable for various indoor and outdoor scenarios, simplifies the image acquisition process, and improves the accuracy and efficiency of measurement.
Smart Images

Figure CN116152220B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and more specifically to a seed counting and size measurement method based on machine vision. Background Technology
[0002] With global economic and climate changes, food security is increasingly becoming a crucial factor in national security, and seeds are a vital foundation for ensuring food security. Measuring seed phenotypic traits is a key aspect of breeding research, and seed size and grain shape are important phenotypic traits. For smaller seeds (such as rice, corn, and wheat), high precision is required, making measurement difficult. Currently, common seed identification and statistical methods include manual measurement and instrumental measurement. Manual measurement, typically using calipers, is inefficient, time-consuming, and labor-intensive, and the results are easily influenced by subjective factors. Automated measuring instruments are often expensive, have high maintenance costs, and due to their large size, are difficult to use for outdoor seed testing. These instruments also have the problem of seed jamming, which can easily lead to mixed planting of different strains during testing. Seed size measurement methods based on image recognition or machine vision are a low-cost and convenient method for seed testing, but they are easily affected by factors such as image background, seed adhesion, placement, and lighting. Summary of the Invention
[0003] The purpose of this invention is to provide a machine vision-based method for seed counting and size measurement, which can detect the quantity and size of seeds in batches with high accuracy, thus solving the problem of difficult seed measurement.
[0004] A machine vision-based method for seed counting and size measurement includes:
[0005] Acquire multiple seed images;
[0006] Images of adhered seeds were detected using a defect-based method for detecting adhered seeds.
[0007] The stuck seed images are segmented into individual seed images using a stuck seed segmentation algorithm based on defect calculation and intersection correction.
[0008] The number of seeds and the size information of each seed are calculated from a single seed image.
[0009] After acquiring multiple seed images, the process also includes binarizing the images, specifically:
[0010] For images with minimal changes in background lighting, a fixed threshold is used for binarization to distinguish between the seed and the background. The binarization effect is optimized by adjusting the parameter stationaryThreshold.
[0011] For images with significant lighting variations, the local Otsu algorithm with adaptive thresholding is used for binarization, converting the grayscale image into a binary image. The domainBlock can be adjusted according to the resolution to ensure that each pixel in the domainBlock can accommodate the width of the seed. The offset value autoThreshold is adjusted to optimize the binarization effect.
[0012] After binarizing the image, the process also includes opening the image, specifically:
[0013] Calculate the scale ruler: Obtain all outer contours from multiple binary seed images, find the target with the largest pixel value, and obtain the scale ruler = input true length of the ruler / ruler pixels;
[0014] The formula for calculating the kernel size of the opening operation convolution is as follows;
[0015] Kernel size = kaiKernel / ruleer
[0016] Where ruler is the scale and kaiKernel is the open kernel size set by the program.
[0017] Intersections and defects include:
[0018] Define two characteristics of multiple adhered seeds, including defect characteristics: there are uneven areas on the seed outline. When the outline is covered by line segments, the depressions disappear and the filled parts become defects.
[0019] Intersection characteristics: When multiple seeds adhere together, they will inevitably form two different points, which are called intersections.
[0020] Images of adhered seeds detected using a defect-based adhering seed detection method include:
[0021] Define a defect as {start, end, deep, distance}, where start is the starting point of the defect, end is the ending point of the defect, deep is the deepest point of the defect, and distance is the distance from deep to the line connecting start and end, i.e., the defect distance.
[0022] The condition for the outline to be a cohesive seed is: defect_num ≥ ε d , ε d The usual value is 2.
[0023] Segmenting fused seed images into individual seed images using defect-based computation includes:
[0024] Calculate defects: Find the deepest point of the defect with the largest distance from the original defect. N .deep:
[0025]
[0026] Finding and point defects N .deep: The deepest recent defect M .deep, define ρ(P1,P2) as the Euclidean distance between points P1 and P2:
[0027]
[0028] If 0ρ(defect) N .deep,defect M .deep)>0.75×width∩area_avg>area*2.5area_avg is the average area, and area is the area of the currently scanned contour.
[0029] The algorithm for segmenting fused seed images into individual seed images using intersection correction includes:
[0030] The program uses a convolutional kernel of a given size to detect intersections and obtains candidate intersection points through two rounds of filtering.
[0031] By filtering the edge pixel values of the pixel value matrix scanned by the convolution kernel, the point set of binarized contour of the adhesion seed is obtained. Then, the pixel value matrix A is obtained by scanning with a kernelSize×kernelSize convolution kernel centered on each point in the point set.
[0032] Perform the first round of filtering: subsequentPixel > 7 ÷ 4 × (kernelSize - 1);
[0033] Filtering is performed using a centrally symmetric matrix to detect defects. N The pixel value matrix B is obtained by scanning with a kernelSize×kernelSize convolution kernel centered on .deep, and then the matrix is processed to be centrally symmetric B′:
[0034]
[0035] Using a kernel size × kernel size as the center of the contour edge point, the pixel value matrix C is obtained by scanning. The number of values in the pixel value matrix B′ that are equal to those in C is calculated using the formula equalKernel, and a second round of intersection filtering is performed.
[0036]
[0037] Where the function ε d It is a threshold related to the kernel size, with a default value of 0.
[0038] A comprehensive filtering mechanism based on Euclidean distance is used to filter points that meet the following conditions. i Replace with point:
[0039]
[0040] After the above filtering, the candidate intersection point set `intersectPoints` is obtained. Then, points with the same intersection point as the defect point are selected from the candidate intersection point set. N The point with the smallest Euclidean distance in deep:
[0041]
[0042] The calculation of the number of seeds and the size information of each seed based on a single seed image includes:
[0043] Obtain all contours in the processed and segmented seed image, and calculate the actual area, length, and width of the seed based on the contour attributes.
[0044] Determine whether the image is a ruler, a normal seed, a fused seed, or a fused seed that failed to segment;
[0045] Remove the scale and failed segmentation images of stuck seeds, calculate the length, width and area of normal seeds and stuck seeds, and calculate the number and average value;
[0046] The stuck seeds that failed to be segmented were re-segmented and recalculated.
[0047] The conditions for determining whether an outline is a ruler include:
[0048] length>0.9×ruler len , where ruler_len is the actual length of the input ruler.
[0049] The conditions for determining that the outline is an adhered seed of a failed cut include:
[0050] area>limitArea×area_avg or length>limitLength×length_avg or width>limitWidth×width_avg, where limitArea, limitLength, and limitWidth are the minimum area, minimum length, and minimum width set by the parameters, respectively.
[0051] This invention employs a simple image acquisition method and provides both computer and mobile applications. It is user-friendly and suitable for high-throughput measurement applications in various indoor and outdoor environments. It offers a simplified method for creating seed images, calculating confidence levels by placing multiple rulers on a background to assess the levelness of photos taken by mobile devices, thereby determining the reliability of the recognition results. The invention also provides computer and mobile applications, which are easy to use and suitable for high-throughput measurement applications in various indoor and outdoor environments. Furthermore, it develops a segmentation algorithm for adhered seeds based on defect detection and intersection correction, enabling accurate and efficient segmentation of adhered seeds in images. Attached Figure Description
[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of the present invention;
[0055] Figure 2 This is a defect feature diagram of the present invention;
[0056] Figure 3 This is a feature diagram of the intersection points of the present invention;
[0057] Figure 4 This is a diagram illustrating the process of separating the adhered seeds according to the present invention;
[0058] Figure 5 This is a model diagram of an optional simplified shooting device of the present invention;
[0059] Figure 6 This is a background image and scale diagram for the present invention;
[0060] Figure 7 The mobile device of this invention captures a seed image;
[0061] Figure 8 The computer application of this invention processes seed image diagrams;
[0062] Figure 9 Seed image processing for WeChat mini-programs according to the present invention;
[0063] Figure 10 The following diagram illustrates the seed image processing steps and their effects according to the present invention. Detailed Implementation
[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0065] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0066] Furthermore, the use of terms such as "first" and "second" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" and "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0067] A machine vision-based method for seed counting and size measurement includes:
[0068] S100, acquire multiple seed images;
[0069] S200, using a defect-based method for detecting adhered seeds to identify images of adhered seeds;
[0070] S300 uses a seed segmentation algorithm based on defect calculation and intersection correction to segment the stuck seed images into individual seed images.
[0071] S400 calculates the number of seeds and the size information of each seed based on a single seed image.
[0072] This invention employs a simple image acquisition method and provides both computer and mobile applications. It is user-friendly and suitable for high-throughput measurement applications in various indoor and outdoor environments. It offers a simplified method for creating seed images, calculating confidence levels by placing multiple rulers on a background to assess the levelness of photos taken by mobile devices, thereby determining the reliability of the recognition results. The invention also provides computer and mobile applications, which are easy to use and suitable for high-throughput measurement applications in various indoor and outdoor environments. Furthermore, it develops a segmentation algorithm for adhered seeds based on defect detection and intersection correction, enabling accurate and efficient segmentation of adhered seeds in images.
[0073] Make a background board and ruler paper according to the color of the seeds. See Figure 6 For example, in this embodiment, the rice seeds are light yellow, and a black background board and white ruler paper are made. The length of the white ruler paper is 100mm.
[0074] Spread the seeds evenly on the background board, distributing them as evenly as possible around the center ruler paper. Remove any impurities from the background. See also Figure 7 Use a mobile phone or camera to take a vertical photo to capture the seed image. Alternatively, you can use a scanner to take a photo, evenly distributing the seeds on a scanning plate, placing a ruler of a fixed length on it, and scanning to obtain the seed image.
[0075] The acquired images were measured using the GrainPheno computer-based measurement program provided in this invention. (See [link to relevant documentation]). Figure 8 And set the relevant operating parameters. The specific steps include:
[0076] Open the file input dialog box via the menu or quick toolbar, and select the image to be measured from a folder on your local disk;
[0077] Set the background color for the menu bar; in this example, it is black.
[0078] The program can be set to run in various modes, and the program content can be set in multiple modes. In this example, the "Rice" mode is used for rice seeds.
[0079] Set the length of the ruler paper to convert the calculated pixels into the actual size of the seed, in mm. In this embodiment, the length of the ruler paper is 100 mm.
[0080] Optional image cropping steps: The desktop program provides an image cropping function that can crop out areas other than the background. Open the cropping box by clicking the crop button in the quick access toolbar, drag the mouse to select the area you want to keep, and if you want to apply the cropped area to all images, check "Apply cropped area to all images." Finally, click the "Crop" button to complete the cropping.
[0081] Run the program by clicking the "Run" button. The running process and results will be displayed in the information display area of the software interface.
[0082] If using a mini-program, search for "GrainPheno" on WeChat, enter the mini-program interface, log in, edit the relevant parameters in your personal settings, then upload seed images from your phone (maximum 9 images per run), and wait for the program to return the results.
[0083] After S100 acquires multiple seed images, S110 further includes binarizing the images, specifically:
[0084] For images with minimal changes in background lighting, a fixed threshold is used for binarization to distinguish between the seed and the background. The binarization effect is optimized by adjusting the parameter stationaryThreshold.
[0085] For images with significant lighting variations, the local Otsu algorithm with adaptive thresholding is used for binarization, converting the grayscale image into a binary image. The domainBlock can be adjusted according to the resolution to ensure that each pixel in the domainBlock can accommodate the width of the seed. The offset value autoThreshold is adjusted to optimize the binarization effect.
[0086] After the program runs, it processes the image; see below. Figure 10 To clearly demonstrate the processing details, a portion of the image was cropped for display. The specific steps are as follows:
[0087] Convert the image to grayscale, and then convert the processed color image back to grayscale.
[0088] Median filtering is used to remove smaller impurities from the background.
[0089] Binarize the image to speed up the computation.
[0090] Grayscale image conversion: Processing three-channel images is complex and time-consuming, so converting them to grayscale images is recommended.
[0091] Median filtering: Median filtering can blur details and is often used to remove noise from images. However, excessive blurring may affect the accuracy of seed size measurement. Users can control the aperture size of the median filter by setting the `vagueAperture` parameter, thereby removing noise without compromising accuracy. For images with clean backgrounds, median filtering can be omitted.
[0092] After S110 performs binarization on the image, S120 further performs an opening operation on the image, specifically:
[0093] Calculate the scale ruler: Obtain all outer contours from multiple binary seed images, find the target with the largest pixel value, and obtain the scale ruler = input true length of the ruler / ruler pixels;
[0094] The formula for calculating the kernel size of the opening operation convolution is as follows;
[0095] Kernel size = kaiKernel / ruleer
[0096] Where ruler is the scale and kaiKernel is the open kernel size set by the program.
[0097] The image opening operation involves first erosion and then dilation, while simultaneously obtaining the scale length (the actual size represented by each pixel);
[0098] The segmentation algorithm of this invention is used to detect and effectively segment contiguous seeds in an image;
[0099] The length, width, and area of each seed are obtained using the minimum bounding rectangle. When there are two or more scales, the horizontal confidence of the image is calculated.
[0100] Position one ruler in the center of the device, and place the other rulers on either side of the background. This is used to measure the horizontality of the image, i.e., the reliability of the processed result. The confidence level is calculated as follows: obtain the scale length from one ruler, then obtain the measured dimensions of the other rulers. The ratio of the measured dimensions of the other rulers to their actual dimensions gives the confidence level. The confidence level measures the parallelism between the shooting device and the background when taking the photo; the closer to 100%, the more parallel. A confidence level of 95% or higher is recommended.
[0101] Intersections and defects include:
[0102] Define two characteristics of multiple adhered seeds, including defect characteristics: there are uneven areas on the seed outline. When the outline is covered by line segments, the depressions disappear and the filled parts become defects.
[0103] Intersection characteristics: When multiple seeds adhere together, they will inevitably form two different points, which are called intersections.
[0104] This invention proposes an improved adhesion segmentation algorithm for identifying and separating adhesion seeds. The algorithm consists of two parts: adhesion seed identification and segmentation, namely, an adhesion seed detection mechanism based on defects (defect detection) and an adhesion seed segmentation algorithm based on defect calculation and intersection correction.
[0105] The S200 uses a defect-based method for detecting adhered seeds to generate images of adhered seeds, including:
[0106] Define a defect as {start, end, deep, distance}, where start is the starting point of the defect, end is the ending point of the defect, deep is the deepest point of the defect, and distance is the distance from deep to the line connecting start and end, i.e., the defect distance.
[0107] The condition for the outline to be a cohesive seed is: defect_num ≥ ε d , ε d The usual value is 2.
[0108] The S300 uses defect-based calculations to segment adhered seed images into individual seed images, including:
[0109] Calculate defects: Find the deepest point of the defect with the largest distance from the original defect. N .deep:
[0110]
[0111] Finding and point defects N .deep: The deepest recent defect M .deep, define ρ(P1,P2) as the Euclidean distance between points P1 and P2:
[0112]
[0113] If 0ρ(defect) N .deep,defect M .deep)>0.75×width∩area_avg>area*2.5area_avg is the average area, and area is the area of the currently scanned contour.
[0114] The S300 uses an intersection-corrected cohesive seed segmentation algorithm to segment cohesive seed images into individual seed images, including:
[0115] The program uses a convolutional kernel of a given size to detect intersections and obtains candidate intersection points through two rounds of filtering.
[0116] By filtering the edge pixel values of the pixel value matrix scanned by the convolution kernel, the point set of binarized contour of the adhesion seed is obtained. Then, the pixel value matrix A is obtained by scanning with a kernelSize×kernelSize convolution kernel centered on each point in the point set.
[0117] Perform the first round of filtering: subsequentPixel > 7 ÷ 4 × (kernelSize - 1);
[0118] Filtering is performed using a centrally symmetric matrix to detect defects. N The pixel value matrix B is obtained by scanning with a kernelSize×kernelSize convolution kernel centered on .deep, and then the matrix is processed to be centrally symmetric B′:
[0119]
[0120] Using a kernel size × kernel size as the center of the contour edge point, the pixel value matrix C is obtained by scanning. The number of values in the pixel value matrix B′ that are equal to those in C is calculated using the formula equalKernel, and a second round of intersection filtering is performed.
[0121]
[0122] Where the function ε d It is a threshold related to the kernel size, with a default value of 0.
[0123] A comprehensive filtering mechanism based on Euclidean distance is used to filter points that meet the following conditions. i Replace with point:
[0124]
[0125] After the above filtering, the candidate intersection point set `intersectPoints` is obtained. Then, points with the same intersection point as the defect point are selected from the candidate intersection point set. N The point with the smallest Euclidean distance in deep:
[0126]
[0127] The S400 calculates the number of seeds and the size information of each seed based on a single seed image, including:
[0128] Obtain all contours in the processed and segmented seed image, and calculate the actual area, length, and width of the seed based on the contour attributes.
[0129] Determine whether the image is a ruler, a normal seed, a fused seed, or a fused seed that failed to segment;
[0130] Remove the scale and failed segmentation of the stuck seed images, calculate the length, width and area of normal seeds and stuck seeds, and calculate the number and average value;
[0131] The stuck seeds that failed to be segmented were re-segmented and recalculated.
[0132] After the program finishes running, it will output an Excel table and an image. The table records the seed number, length, width, and area information for each seed, as well as their average values. The image identifies normally identified seeds (red rectangles), abnormally identified seeds (green rectangles), a scale (blue outline), and the image's horizontal confidence level.
[0133] The conditions for determining whether an outline is a ruler include:
[0134] length>0.9×ruler len , where ruler_len is the actual length of the input ruler.
[0135] The conditions for determining that the outline is an adhered seed of a failed cut include:
[0136] area>limitArea×area_avg or length>limitLength×length_avg or width>limitWidth×width_avg, where limitArea, limitLength, and limitWidth are the minimum area, minimum length, and minimum width set by the parameters, respectively.
[0137] This invention employs a simple image acquisition method and provides both computer and mobile applications. It is user-friendly and suitable for high-throughput measurement applications in various indoor and outdoor environments. It offers a simplified method for creating seed images, calculating confidence levels by placing multiple rulers on a background to assess the levelness of photos taken by mobile devices, thereby determining the reliability of the recognition results. The invention also provides computer and mobile applications, which are easy to use and suitable for high-throughput measurement applications in various indoor and outdoor environments. Furthermore, it develops a segmentation algorithm for adhered seeds based on defect detection and intersection correction, enabling accurate and efficient segmentation of adhered seeds in images.
[0138] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for seed counting and size measurement based on machine vision, characterized in that, include: Acquire multiple seed images; Images of adhered seeds were detected using a defect-based method for detecting adhered seeds. The stuck seed images are segmented into individual seed images using a stuck seed segmentation algorithm based on defect calculation and intersection correction. Calculate the number of seeds and the size information of each seed based on a single seed image; The segmentation of the adhered seed images into individual seed images using defect-based calculation includes: Calculate defects: Find the deepest point of the defect with the largest defect distance. : ; Finding and Points The most recent and deepest flaws Let ρ(P1, P2) be the Euclidean distance between points P1 and P2. ; if ; It is the average area. It is the area of the currently scanned contour.
2. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, After acquiring multiple seed images, the process further includes binarizing the images, specifically: For images with minimal changes in background lighting, a fixed threshold is used for binarization to distinguish between the seed and the background. The binarization effect is optimized by adjusting the parameter stationaryThreshold. For images with significant lighting variations, the local Otsu algorithm with adaptive thresholding is used for binarization, converting the grayscale image into a binary image. The domainBlock is adjusted according to the resolution to ensure that each pixel in the domainBlock can accommodate the width of the seed, and the offset value autoThreshold is adjusted to optimize the binarization effect.
3. The seed counting and size measurement method based on machine vision according to claim 2, characterized in that, After binarizing the image, the process further includes performing an opening operation on the image, specifically: Calculate the scale ruler: Obtain all outer contours from multiple binary seed images, find the target with the largest pixel value, and obtain the scale ruler = input true length of the ruler / ruler pixels; The formula for calculating the kernel size of the opening operation convolution is as follows; Kernel size = kaiKernel / ruler Where ruler is the scale and kaiKernel is the open kernel size set by the program.
4. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The intersections and defects include: Define two characteristics of multiple adhered seeds, including defect characteristics: there are uneven areas on the seed outline. When the outline is covered by line segments, the depressions disappear and the filled parts become defects. Intersection characteristics: When multiple seeds adhere together, they will inevitably form two different points, which are called intersections.
5. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The images of adhered seeds detected using the defect-based adhering seed detection method include: Defining defects , As the starting point of the defect, As the defect endpoint, The deepest point of the defect for arrive and The distance of the connecting line is the defect distance; The outline represents the conditions for adhered seeds: , The value is 2.
6. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The method of segmenting adhered seed images into individual seed images using a seed segmentation algorithm based on defect calculation and intersection correction includes: The program uses a convolutional kernel of a given size to detect intersections and obtains candidate intersection points through two rounds of filtering. By filtering the edge pixel values of the pixel value matrix scanned by the convolution kernel, the point set of the binarized contour of the adhesion seed is obtained. Then, for each point in that set... Used as a center The convolution kernel is scanned to obtain the pixel value matrix A; Perform the first round of filtering: ; Filtering is performed using a centrally symmetric matrix. Centered use The convolution kernel scan yields the pixel value matrix. And perform central symmetry processing on the matrix. : ; With the outline edge point Used as a center The convolution kernel scan yields the pixel value matrix. The pixel value matrix is calculated using the following formula. and Number of equal values And perform a second round of intersection filtering; ; Where the function It is a threshold related to the kernel size, with a default value of 0. ; A comprehensive filtering mechanism based on Euclidean distance is adopted, and points are filtered out if the following conditions are met. use replace: ; After the above filtering, the candidate intersection point set is obtained. Then, select points from the candidate intersection point set that are related to the point. The point with the smallest Euclidean distance: 。 7. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The calculation of the number of seeds and the size information of each seed based on a single seed image includes: Obtain all contours in the processed and segmented seed image, and calculate the actual area, length, and width of the seed based on the contour attributes. Determine whether the image is a ruler, a normal seed, a fused seed, or a fused seed that failed to segment; Remove the scale and failed segmentation of the stuck seed images, calculate the length, width and area of normal seeds and stuck seeds, and calculate the number and average value; The stuck seeds that failed to be segmented were re-segmented and recalculated.
8. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The conditions for determining whether an outline is a ruler include: ,in The actual length of the scale is input.
9. The seed counting and size measurement method based on machine vision according to claim 1, characterized in that, The conditions for determining that the outline is an adhered seed of a failed cut include: ,in These are the minimum area, minimum length, and minimum width parameters.
Citation Information
Patent Citations
Machine vision-based tile size detection method
CN106643549A
Crop seed automatic counting method based on machine vision
CN115187788A
