A method, system and device for detecting the milk line ratio of a corn kernel

By using a corn kernel segmentation neural network and image processing algorithms, the accuracy and cost issues of corn kernel maturity detection were solved, and efficient and accurate calculation of the milk line ratio of corn kernels was achieved.

CN117058108BActive Publication Date: 2026-04-07CHINA AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing methods for detecting corn kernel maturity are susceptible to human factors, and hyperspectral technology equipment is expensive, while machine vision methods are easily affected by light and weather, leading to issues with detection accuracy and cost.

Method used

A neural network for corn kernel segmentation and an image processing algorithm are used to obtain a color image of a cross-section of corn, perform grayscale processing, segmentation and calculation, draw the minimum bounding rectangle, and calculate the proportion of the milk line in the corn kernel.

Benefits of technology

It improves the accuracy and speed of calculating the milk line ratio of corn kernels, reduces detection costs, and achieves efficient and accurate automatic detection of corn kernel maturity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058108B_ABST
    Figure CN117058108B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and apparatus for detecting the milk line ratio of corn kernels, relating to the field of automatic measurement of corn kernel phenotypic parameters. The invention obtains a corn grayscale image by converting a corn color image to grayscale; inputting the corn grayscale image into a corn kernel segmentation neural network to obtain a corn kernel binary image; obtaining a corn kernel grayscale image based on the corn color image and the corn kernel binary image; obtaining a corn kernel endosperm region binary image based on the corn kernel grayscale image; calculating the minimum bounding rectangle of the corn kernel based on the corn kernel binary image; drawing the endosperm region and the minimum bounding rectangle of the corn kernel in the corn kernel grayscale image to obtain the grayscale image to be calculated; and calculating the corn kernel milk line ratio based on the grayscale image to be calculated. This method effectively eliminates interference from the shape of the corn kernel itself and adjacent kernels, improving the accuracy and speed of corn kernel milk line ratio calculation, and reducing detection costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automatic measurement technology of maize kernel phenotypic parameters, and in particular to a method, system and device for detecting the milk line ratio of maize kernels. Background Technology

[0002] As corn grows and matures, its kernels gradually develop and become plump and ripe. During this process, as the internal substances of the kernel change, the milk line gradually moves from the tip of the kernel towards the base. When the milk line completely disappears, it signifies that the corn has reached its optimal harvest time. Determining the position of the milk line helps in evaluating the maturity of the corn, assessing its ripening rate, and judging its dehydration rate.

[0003] Traditional methods for judging the maturity and quality of corn kernels usually involve manual visual sorting, classifying them by observing their appearance. However, manual sorting is susceptible to errors due to factors such as visual fatigue, and the process is inefficient and lacks sustainability.

[0004] Current research has employed hyperspectral technology to detect corn kernel maturity. Hyperspectral imaging technology integrates traditional imaging and spectral techniques, enabling efficient, green, and high-resolution detection of various samples. It can detect the internal structural and chemical composition characteristics of corn kernels, achieving more efficient and accurate maturity detection. However, using hyperspectral technology requires large amounts of data and complex data analysis, and the equipment cost is relatively high.

[0005] Using machine vision to rapidly measure phenotypic parameters of maize kernels can help breeders monitor maize maturity. Current research uses drones equipped with DSLR cameras to acquire high-resolution images of maize in the field, and then employs deep learning and machine learning for feature extraction and modeling to determine maturity. However, this method is susceptible to the effects of light and weather; image quality deteriorates on cloudy or rainy days or in excessively strong sunlight, thus affecting the accuracy of the identification. Summary of the Invention

[0006] To address the problems mentioned in the background art, the present invention provides a method, system, and apparatus for detecting the milk line ratio of corn kernels, so as to improve the accuracy and speed of calculating the milk line ratio of corn kernels and reduce the detection cost.

[0007] To achieve the above objectives, the present invention provides the following solution:

[0008] On one hand, the present invention provides a method for detecting the milk line ratio of corn kernels, comprising:

[0009] Obtain a color image of a cross-sectional sample of corn as a corn color image;

[0010] A grayscale image of corn is obtained by converting a color image of corn to grayscale.

[0011] The grayscale image of corn is input into the corn kernel segmentation neural network to obtain the binary image of corn kernels;

[0012] A grayscale image of corn kernels is obtained based on a color image of corn and a binary image of corn kernels.

[0013] Binary images of the endosperm region of corn kernels were obtained based on grayscale images of corn kernels.

[0014] Calculate the minimum bounding rectangle of the corn kernels based on the binary image of the corn kernels;

[0015] Based on the binary image of the corn kernel endosperm region, the endosperm region of the corn kernel is drawn in the grayscale image of the corn kernel, and the minimum bounding rectangle of the corn kernel is drawn in the grayscale image of the corn kernel to obtain the grayscale image to be calculated.

[0016] The proportion of milk lines in corn kernels is calculated based on the grayscale image to be calculated.

[0017] Optionally, the step of converting the color image of corn to grayscale to obtain a grayscale image of corn specifically includes:

[0018] Formula I gray The expression (i,j) = G(i,j) × 0.5 + B(i,j) is used to convert the color image of corn to grayscale, resulting in a grayscale image of corn. Here, (i,j) represents the row and column coordinates of a pixel; G(i,j) and B(i,j) are the G and B color component values ​​at pixel (i,j) in the color image of corn, respectively. gray (i,j) represents the grayscale value at pixel (i,j) in the converted corn grayscale image.

[0019] Optionally, before inputting the grayscale image of corn into the corn kernel segmentation neural network to obtain a binary image of corn kernels, the method further includes:

[0020] Each corn kernel is labeled in a grayscale image of corn to construct a corn kernel segmentation dataset;

[0021] A UNet segmentation neural network was trained using a corn kernel segmentation dataset. After training, a corn kernel segmentation neural network was obtained. The input of the corn kernel segmentation neural network is a grayscale image of corn kernels, and the output is a binary image of corn kernels.

[0022] Optionally, obtaining the grayscale image of corn kernels based on the corn color image and the binary image of corn kernels specifically includes:

[0023] A logical AND operation is performed between the binary image of corn kernels and the color image of corn to obtain the color image of corn kernels.

[0024] Calculate the S component of the color image of corn kernels in the HSV color space to obtain the grayscale image of corn kernels.

[0025] Optionally, obtaining a binary image of the corn kernel endosperm region based on the grayscale image of the corn kernel specifically includes:

[0026] The segmentation threshold of the grayscale image of corn kernels is obtained by using the Otsu's method.

[0027] The grayscale image of corn kernels is segmented according to the segmentation threshold to obtain a binary image containing the endosperm region;

[0028] A morphological opening operation is performed on the binary image containing the endosperm region, and the largest connected region in the image is preserved to obtain a binary image of the endosperm region of the maize kernel.

[0029] Optionally, the step of calculating the minimum bounding rectangle of the corn kernels based on the binary image of the corn kernels specifically includes:

[0030] Based on the binary image of corn kernels, the minimum bounding rectangle of the corn kernels is calculated using the rotating caliper algorithm.

[0031] Optionally, the step of calculating the milk line ratio of corn kernels based on the grayscale image to be calculated specifically includes:

[0032] Based on the minimum bounding rectangle of corn kernels in the grayscale image to be calculated, calculate and draw the center line of the minimum bounding rectangle in the width direction, with a length of L1;

[0033] Calculate the length L2 of the overlap between the centerline and the endosperm region;

[0034] The ratio of L2 to L1 is used to calculate the milk line ratio of corn kernels.

[0035] On the other hand, the present invention also provides a corn kernel milk line ratio detection system, comprising:

[0036] The corn color image acquisition module is used to acquire color images of corn cross-section samples as corn color images;

[0037] The image grayscale processing module is used to perform grayscale processing on the color image of corn to obtain a grayscale image of corn;

[0038] The corn kernel segmentation module is used to input a grayscale image of corn into a corn kernel segmentation neural network to obtain a binary image of corn kernels.

[0039] A grayscale image acquisition module for corn kernels is used to obtain grayscale images of corn kernels based on color images of corn and binary images of corn kernels.

[0040] The endosperm region binary image acquisition module is used to obtain a binary image of the endosperm region of corn kernels based on the grayscale image of corn kernels;

[0041] The minimum bounding rectangle calculation module is used to calculate the minimum bounding rectangle of corn kernels based on the binary image of corn kernels.

[0042] The grayscale image acquisition module is used to draw the endosperm region of the corn kernel in the grayscale image of the corn kernel based on the binary image of the endosperm region of the corn kernel, and draw the minimum bounding rectangle of the corn kernel in the grayscale image of the corn kernel to obtain the grayscale image to be calculated.

[0043] The corn kernel milk line ratio calculation module is used to calculate the corn kernel milk line ratio based on the grayscale image to be calculated.

[0044] On the other hand, the present invention also provides a corn kernel milk line ratio detection device, including: a dark box, a color camera, a supplementary light, a sample conveyor belt, and electronic equipment;

[0045] The sample conveyor belt is used to transport corn cross-section samples; the dark box is located above the sample conveyor belt; the color camera and the supplementary light are placed inside the dark box; the electronic device is connected to the color camera; when the corn cross-section sample is transported to the area below the color camera, the color camera captures a color image of the corn cross-section sample and sends it to the electronic device; the supplementary light is used for illumination during the image acquisition process.

[0046] The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the corn kernel milk line ratio detection method.

[0047] Optionally, the memory is a non-transitory computer-readable storage medium.

[0048] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0049] This invention provides a method, system, and apparatus for detecting the milk line ratio of corn kernels. The method involves acquiring a color image of a cross-sectional sample of corn as the corn color image; converting the corn color image to grayscale to obtain a corn grayscale image; inputting the corn grayscale image into a corn kernel segmentation neural network to obtain a corn kernel binary image; obtaining a corn kernel grayscale image based on the corn color image and the corn kernel binary image; obtaining a corn kernel endosperm region binary image based on the corn kernel grayscale image; calculating the minimum bounding rectangle of the corn kernel based on the corn kernel binary image; drawing the endosperm region of the corn kernel in the corn kernel grayscale image based on the corn kernel endosperm region binary image, and drawing the minimum bounding rectangle of the corn kernel in the corn kernel grayscale image to obtain the grayscale image to be calculated; and calculating the corn kernel milk line ratio based on the grayscale image to be calculated. This method effectively eliminates interference from the shape of the corn kernel itself and adjacent kernels, improving the accuracy and speed of corn kernel milk line ratio calculation, and reducing detection costs. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart of a method for detecting the milk line ratio of corn kernels according to the present invention;

[0052] Figure 2 This is a schematic diagram of the structure of a corn kernel milk line ratio detection device according to the present invention;

[0053] Figure 3 This is a schematic diagram illustrating the implementation process of the corn kernel milk line ratio detection method in an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of a corn grayscale image in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of corn grayscale image segmentation and annotation in an embodiment of the present invention;

[0056] Figure 6 This is a schematic diagram of a binary image of corn kernels in an embodiment of the present invention;

[0057] Figure 7 This is a schematic diagram of a binary image of the endosperm region of a corn kernel in an embodiment of the present invention;

[0058] Figure 8 This is a schematic diagram of the minimum bounding rectangle surrounding the corn kernels in an embodiment of the present invention;

[0059] Figure 9 This is a schematic diagram of the center line of the smallest circumscribed rectangle of the corn kernel and its overlapping part with the endosperm region in an embodiment of the present invention. Detailed Implementation

[0060] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0061] The purpose of this invention is to provide a method, system, and apparatus for detecting the milk line ratio of corn kernels, so as to improve the accuracy and speed of calculating the milk line ratio of corn kernels and reduce the detection cost.

[0062] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] Figure 1 This is a flowchart of a method for detecting the milk line ratio in corn kernels according to the present invention. See also... Figure 1 A method for detecting the milk line ratio in corn kernels, comprising:

[0064] Step 1: Obtain a color image of a cross-sectional sample of corn as a corn color image.

[0065] This invention uses corn as the research object and acquires color images of corn cross-section samples using machine vision in an indoor environment. The color images are then used to automatically calculate the milk line ratio of corn kernels. The color images of the corn cross-section samples can be acquired using the corn kernel milk line ratio detection device of this invention. Figure 2 As shown, the corn kernel milk line ratio detection device includes: a dark box, a color camera, two supplementary lights, a sample conveyor belt, and an electronic device; the electronic device can be a computer, tablet, mobile phone, or other similar device. The sample conveyor belt is used to transport corn cross-section samples; the dark box is located above the sample conveyor belt; the color camera and the supplementary lights are placed inside the dark box; the electronic device is connected to the color camera; when the corn cross-section sample is transported to below the color camera, the color camera acquires a color image of the corn cross-section sample and sends it to the electronic device; the two supplementary lights are used for illumination during the image acquisition process. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the corn kernel milk line ratio detection method.

[0066] Step 2: Convert the color image of corn to grayscale to obtain a grayscale image of corn.

[0067] This invention uses two supplementary lights on the left and right as light sources inside a dark box, a vertically shooting color camera at the top, and a black sample conveyor belt at the bottom. When the sample conveyor belt is activated, it transports the corn cross-section sample directly below the color camera, acquires a color image of the corn, and then transmits the image to a computer for processing and saving.

[0068] Using the red (R), green (G), and blue (B) components in the RGB color space of the original corn color image, the corn color image is converted using formula (1) to generate the corresponding grayscale image:

[0069] I gray (i,j)=G(i,j)×0.5+B(i,j) (1)

[0070] Where (i,j) are the row and column coordinates of the pixel; G(i,j) and B(i,j) are the G and B color component values ​​at pixel (i,j) in the corn color image, respectively; I gray (i,j) represents the grayscale value at pixel (i,j) in the converted corn grayscale image.

[0071] Step 3: Input the grayscale image of corn into the corn kernel segmentation neural network to obtain a binary image of the corn kernel.

[0072] Each corn kernel is individually labeled in a corn grayscale image to construct a corn kernel segmentation dataset; a UNet segmentation neural network is trained using the corn kernel segmentation dataset, and the corn kernel segmentation neural network is obtained after training; the input of the corn kernel segmentation neural network is the corn grayscale image, and the output is the corn kernel binary image.

[0073] When using it, simply input the grayscale image of corn into the trained corn kernel segmentation neural network to obtain a binary image of the corn kernels.

[0074] Step 4: Obtain the grayscale image of corn kernels based on the color image of corn and the binary image of corn kernels.

[0075] By performing a logical AND operation between the binary image of corn kernels and the color image of corn, the color image of corn kernels can be obtained. Then, based on the color image of corn kernels, the S component of the color image of corn kernels in the HSV(Hue, Saturation, Value) color space is calculated to obtain the grayscale image of corn kernels.

[0076] Step 5: Obtain a binary image of the corn kernel endosperm region based on the grayscale image of the corn kernel;

[0077] The segmentation threshold of the grayscale image of corn kernels was obtained using the Otsu's method (maximum inter-class variance). Based on this threshold, the grayscale image was segmented to obtain a binary image containing the endosperm region. Then, a square structuring element was applied to this binary image to perform a morphological "opening" operation to remove noise points and retain the largest connected regions, thus obtaining the binary image of the corn kernel endosperm region. In this binary image, white pixels represent the endosperm region of the corn kernel (grayscale value 1), and black pixels represent the background (grayscale value 0).

[0078] Step 6: Calculate the minimum bounding rectangle of the corn kernels based on the binary image of the corn kernels.

[0079] Based on the binary image of corn kernels, the rotating caliper algorithm is used. By traversing the points on the convex hull of the binary image of corn kernels, and then rotating these points, the area of ​​the bounding rectangle at each angle is calculated. The angle and rectangle corresponding to the smallest area are found and used as the minimum bounding rectangle of the corn kernel.

[0080] Step 7: Based on the binary image of the corn kernel endosperm region, draw the endosperm region of the corn kernel in the grayscale image of the corn kernel, and draw the minimum bounding rectangle of the corn kernel in the grayscale image of the corn kernel to obtain the grayscale image to be calculated.

[0081] Step 8: Calculate the milk line ratio of corn kernels based on the grayscale image to be calculated.

[0082] The center point of the minimum bounding rectangle is calculated based on the coordinates of its four vertices. The centerline of the minimum bounding rectangle, with a length of L1, is then drawn. The portion where the centerline of the minimum bounding rectangle intersects or overlaps with the drawn corn kernel endosperm region is the corn kernel endosperm line. The length L2 of the corn kernel endosperm line is calculated. The ratio of the corn kernel endosperm line length (M) to the length L1 of the minimum bounding rectangle's centerline is the corn kernel endosperm line ratio, calculated using the following formula:

[0083] M = L2 / L1 (2)

[0084] As can be seen, the method of this invention uses corn as the research object, the detection process is convenient and easy to operate, and does not require complex data analysis. It uses corn color images to achieve efficient, accurate, and automatic calculation of the milk line ratio of corn kernels, providing an accurate basis for the quantitative measurement of corn kernel maturity. Moreover, the detection process of this invention does not require expensive equipment, greatly reducing the detection cost.

[0085] The following specific embodiment illustrates the implementation process of the method of the present invention, such as... Figure 3 As shown, the color image acquired in this embodiment only contains the cross-section of the corn. The corn color image is converted to grayscale to obtain a grayscale image of the corn, as shown below. Figure 4As shown in the image, the grayscale image of corn was annotated, labeling each corn kernel. The annotation results are as follows. Figure 5 As shown.

[0086] After annotating all the corn grayscale images, the UNet neural network is trained. The resulting corn kernel segmentation neural network can be used to segment individual corn kernels into binary images. Inputting the corn grayscale images into the trained corn kernel segmentation neural network can produce individual binary images of the corn kernels, such as... Figure 6 As shown, a logical AND operation is performed between the binary image of corn kernels and the color image of corn to obtain the color image of corn kernels.

[0087] The S channel of a color image of corn kernels is extracted separately in the HSV color space to obtain a grayscale image of the corn kernels. The segmentation threshold of 0.6588 is calculated using the Otsu's method, and the grayscale image of the corn kernels is converted into a binary image containing the endosperm region. In this embodiment, a square structuring element is used to perform an opening operation on the binary image containing the endosperm region. First, a square structuring element with a side length of 5 pixels is used to perform an erosion operation on the image, and then a square structuring element with a side length of 7 pixels is used to perform a dilation operation on the image to eliminate the interference of scattered noise. Next, the largest connected region in the binary image is determined. In this embodiment, the largest connected region has 69978 pixels, and retaining this region is the corn kernel endosperm region. The result is as follows. Figure 7 As shown.

[0088] Based on the processed binary image of the corn kernel endosperm region, the endosperm region is drawn in the grayscale image of the corn kernel. Then, the minimum bounding rectangle of the corn kernel in this embodiment is calculated using the rotating caliper algorithm. The coordinates of the four corner points of this rectangle are (437.63, 423.28), (43.73, 476.99), (-15.63, 41.68), and (378.27, -12.04), respectively. This minimum bounding rectangle is then drawn in the grayscale image of the corn kernel, and the result is as follows. Figure 8 As shown in the dashed box.

[0089] Based on the minimum bounding rectangle of the corn kernel, its centerline is calculated and drawn. In this embodiment, the coordinates of the two points of the centerline are (181.3, 14.82) and (240.7, 450.1). The length L1 of the centerline can be calculated as 439.34 pixels using these coordinates. After the centerline is drawn, the overlapping part with the corn kernel endosperm region is the corn kernel endosperm line in this embodiment. The coordinates of the two intersection points are (203.4, 177.0) and (240.0, 445.0). The length L2 of the endosperm line can be calculated as 270.48 pixels using these coordinates. The centerline and endosperm line are drawn as follows... Figure 9As shown. The ratio of the nipple line, M = L2 / L1, can be calculated using the nipple line length L2 and the center line length L1.

[0090] In this embodiment, the milk line ratio was calculated to be 61.56%, thus achieving the final calculation of the corn milk line ratio. The method of this invention can effectively eliminate interference from the shape of the corn kernels themselves and adjacent kernels, improving the accuracy and speed of corn milk line ratio calculation.

[0091] Based on the method provided by this invention, this invention also provides a corn kernel milk line ratio detection system, comprising:

[0092] The corn color image acquisition module is used to acquire color images of corn cross-section samples as corn color images;

[0093] The image grayscale processing module is used to perform grayscale processing on the color image of corn to obtain a grayscale image of corn;

[0094] The corn kernel segmentation module is used to input a grayscale image of corn into a corn kernel segmentation neural network to obtain a binary image of corn kernels.

[0095] A grayscale image acquisition module for corn kernels is used to obtain grayscale images of corn kernels based on color images of corn and binary images of corn kernels.

[0096] The endosperm region binary image acquisition module is used to obtain a binary image of the endosperm region of corn kernels based on the grayscale image of corn kernels;

[0097] The minimum bounding rectangle calculation module is used to calculate the minimum bounding rectangle of corn kernels based on the binary image of corn kernels.

[0098] The grayscale image acquisition module is used to draw the endosperm region of the corn kernel in the grayscale image of the corn kernel based on the binary image of the endosperm region of the corn kernel, and draw the minimum bounding rectangle of the corn kernel in the grayscale image of the corn kernel to obtain the grayscale image to be calculated.

[0099] The corn kernel milk line ratio calculation module is used to calculate the corn kernel milk line ratio based on the grayscale image to be calculated.

[0100] Furthermore, the present invention also provides a corn kernel milk line ratio detection device, comprising: a dark box, a color camera, a supplementary light, a sample conveyor belt, and electronic equipment. The sample conveyor belt is used to transport corn cross-section samples; the dark box is located above the sample conveyor belt; the color camera and the supplementary light are placed inside the dark box; the electronic equipment is connected to the color camera; when the corn cross-section sample is transported to below the color camera, the color camera acquires a color image of the corn cross-section sample and sends it to the electronic equipment; the supplementary light is used for illumination during the image acquisition process. The electronic equipment may include: a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor can call a computer program in the memory to execute the corn kernel milk line ratio detection method.

[0101] Furthermore, when the computer program in the aforementioned memory is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-transitory computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0103] Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. Furthermore, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method for detecting the milk line ratio in corn kernels, characterized in that, include: Obtain a color image of a cross-sectional sample of corn as a corn color image; A grayscale image of corn is obtained by converting a color image of corn to grayscale. The grayscale image of corn is input into the corn kernel segmentation neural network to obtain the binary image of corn kernels; A grayscale image of corn kernels is obtained based on a color image of corn and a binary image of corn kernels. Binary images of the endosperm region of corn kernels were obtained based on grayscale images of corn kernels. Calculate the minimum bounding rectangle of the corn kernels based on the binary image of the corn kernels; Based on the binary image of the corn kernel endosperm region, the endosperm region of the corn kernel is drawn in the grayscale image of the corn kernel, and the minimum bounding rectangle of the corn kernel is drawn in the grayscale image of the corn kernel to obtain the grayscale image to be calculated. The proportion of milk lines in corn kernels is calculated based on the grayscale image to be calculated.

2. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, The process of converting a color image of corn to grayscale to obtain a grayscale image of corn specifically includes: Formula I gray The formula (i, j) = G(i, j) × 0.5 + B(i, j) is used to convert the color image of corn to grayscale, resulting in a grayscale image of corn; where (i, j) are the row and column coordinates of the pixel; G(i, j) and B(i, j) are the G and B color component values ​​at pixel (i, j) in the color image of corn, respectively; gray (i, j) represents the grayscale value at pixel (i, j) in the converted corn grayscale image.

3. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, Before inputting the grayscale image of corn into the corn kernel segmentation neural network to obtain the binary image of corn kernels, the process also includes: Each corn kernel is labeled in a grayscale image of corn to construct a corn kernel segmentation dataset; A UNet segmentation neural network was trained using a corn kernel segmentation dataset. After training, a corn kernel segmentation neural network was obtained. The input of the corn kernel segmentation neural network is a grayscale image of corn kernels, and the output is a binary image of corn kernels.

4. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, The process of obtaining a grayscale image of corn kernels based on a color image of corn and a binary image of corn kernels specifically includes: A logical AND operation is performed between the binary image of corn kernels and the color image of corn to obtain the color image of corn kernels. Calculate the S component of the color image of corn kernels in the HSV color space to obtain the grayscale image of corn kernels.

5. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, The process of obtaining a binary image of the corn kernel endosperm region based on a grayscale image of the corn kernel specifically includes: The segmentation threshold of the grayscale image of corn kernels is obtained by using the Otsu's method. The grayscale image of corn kernels is segmented according to the segmentation threshold to obtain a binary image containing the endosperm region; A morphological opening operation is performed on the binary image containing the endosperm region, and the largest connected region in the image is preserved to obtain a binary image of the endosperm region of the maize kernel.

6. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, The step of calculating the minimum bounding rectangle of corn kernels based on the binary image of corn kernels specifically includes: Based on the binary image of corn kernels, the minimum bounding rectangle of the corn kernels is calculated using the rotating caliper algorithm.

7. The method for detecting the milk line ratio of corn kernels according to claim 1, characterized in that, The step of calculating the milk line ratio of corn kernels based on the grayscale image to be calculated specifically includes: Based on the minimum bounding rectangle of corn kernels in the grayscale image to be calculated, calculate and draw the center line of the minimum bounding rectangle in the width direction, with a length of L1; Calculate the length L2 of the overlap between the centerline and the endosperm region; The ratio of L2 to L1 is used to calculate the milk line ratio of corn kernels.

8. A corn kernel milk line ratio detection system, characterized in that, include: The corn color image acquisition module is used to acquire color images of corn cross-section samples as corn color images; The image grayscale processing module is used to perform grayscale processing on the color image of corn to obtain a grayscale image of corn; The corn kernel segmentation module is used to input a grayscale image of corn into a corn kernel segmentation neural network to obtain a binary image of corn kernels. A grayscale image acquisition module for corn kernels is used to obtain grayscale images of corn kernels based on color images of corn and binary images of corn kernels. The endosperm region binary image acquisition module is used to obtain a binary image of the endosperm region of corn kernels based on the grayscale image of corn kernels; The minimum bounding rectangle calculation module is used to calculate the minimum bounding rectangle of corn kernels based on the binary image of corn kernels. The grayscale image acquisition module is used to draw the endosperm region of the corn kernel in the grayscale image of the corn kernel based on the binary image of the endosperm region of the corn kernel, and draw the minimum bounding rectangle of the corn kernel in the grayscale image of the corn kernel to obtain the grayscale image to be calculated. The corn kernel milk line ratio calculation module is used to calculate the corn kernel milk line ratio based on the grayscale image to be calculated.

9. A device for detecting the milk line ratio of corn kernels, characterized in that, include: Dark box, color camera, supplementary lighting, sample conveyor belt, and electronic equipment; The sample conveyor belt is used to transport corn cross-section samples; The dark chamber is located above the sample conveyor belt; the color camera and the supplementary light are placed inside the dark chamber; the electronic device is connected to the color camera. When the corn cross-section sample is transported to the area below the color camera, the color camera captures a color image of the corn cross-section sample and sends it to an electronic device; the supplementary light is used for illumination during the image acquisition process; The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the corn kernel milk line ratio detection method as described in any one of claims 1 to 7.

10. The corn kernel milk line ratio detection device according to claim 9, characterized in that, The memory of the electronic device is a non-transitory computer-readable storage medium.

Citation Information

Patent Citations

  • Corn ear image grain segmentation method

    CN103020970A

  • Band ratio method based maize embryo segmentation method in high-spectral reflection image

    CN105931223A