Corn sweetness detection method and system based on machine vision, equipment and medium

Through machine vision-based detection methods, corn images are processed and corn kernels are located, the accuracy and stability of corn sweetness detection in the prior art are solved, and more efficient and accurate sweetness detection is achieved.

CN119810822APending Publication Date: 2025-04-11SUZHOU DCCK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411627527.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art is difficult to accurately distinguish corn sweetness through characteristics such as corn surface color, and conventional 2D algorithms are difficult to process, which adds additional operation steps.

Method used

Using machine vision-based detection methods, by obtaining corn images, processing images to obtain the main area in the middle of corn, locate and obtain the width information of corn kernels, selecting the maximum width corn kernels as the analysis object, and using feature information to perform sweetness detection.

Benefits of technology

It improves the stability and accuracy of corn sweetness detection, and does not require additional operating steps. It can effectively remove incomplete or residual corn kernels in corn ears and obtain more accurate sweetness grading data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810822A_ABST
    Figure CN119810822A_ABST
Patent Text Reader

Abstract

The invention provides a corn sweetness detection method and system based on machine vision, equipment and a medium. The method comprises the following steps: acquiring image information of corn to be detected; processing the corn image to obtain a main region in the middle of the corn; positioning each corn kernel in the middle main area of the corn and acquiring width information of the corn kernel; obtaining a corn kernel with the maximum width as an actual analysis object; and realizing corn sweetness detection according to the actual feature information of the actual analysis object. Compared with a conventional 2D algorithm, the corn sweetness detection method based on machine vision provided by the invention has higher stability and accuracy, does not need additional operation steps of picking corn kernels and the like, removes incomplete and imperfect corn kernels in corncobs through data screening, is more accurate in actual sweetness grading data, and is suitable for large-scale popularization and application. And the corn sweetness detection result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to a method, system, device and medium for detecting sweetness of corn based on machine vision. Background Art

[0002] In the field of machine vision, corn kernels have small features and are difficult to process using conventional 2D algorithms. It is difficult to distinguish sweetness by differences in features such as corn surface color. Currently, the existing solution is to directly pick a kernel from the corn cob for analysis and processing. This adds an extra step of picking corn kernels, and the picking position is random, which cannot represent the actual sweetness of the entire corn cob.

[0003] Therefore, it is necessary to optimize the corn kernel sweetness detection method to improve the above problems. Summary of the invention

[0004] In order to achieve the above-mentioned purpose and other advantages of the present invention, the first object of the present invention is to provide a method for detecting corn sweetness based on machine vision, comprising the following steps: Acquire image information of corn to be detected; Process the corn image to obtain the main area in the middle of the corn; Locating each corn kernel in the corn middle main area and obtaining the width information of the corn kernel; Obtain the corn kernel with the maximum width as the actual analysis object; The sweetness detection of corn is realized according to the actual characteristic information of the actual analysis object.

[0005] Furthermore, the step of processing the corn image to obtain the main middle area of ​​the corn includes: Converting the corn image into a grayscale image; Perform denoising on the converted image; The edge detection algorithm is used to extract the edge of the corn ear from the processed image; extracting corn ear contour information from the corn ear edge using an image contour function; Obtaining a circumscribed rectangle of an ear of corn by using the outline information of the ear of corn; Cutting a central area at the center of the circumscribed rectangle of the ear of corn according to set parameters; The original color image is intercepted according to the coordinates of the central area to obtain the main middle area of ​​the corn.

[0006] Further, the step of locating each corn kernel in the middle main area of ​​the corn and obtaining the width information of the corn kernel includes: The main middle area of ​​the corn is input into the detection model, and the corresponding detection frame size under the pixel coordinates is predicted to obtain the width information of the corn kernels.

[0007] Furthermore, the detection model is constructed using a detection neural network.

[0008] Furthermore, the training of the detection model includes the following steps: Acquire corn images, and divide the corn images into a training set and a test set; Annotate the circumscribed rectangular frame of each corn kernel in the image of the training set; Inputting the labeled image into the detection neural network for training to obtain a detection model; The detection model is verified using images from the test set.

[0009] Furthermore, the step of realizing corn sweetness detection according to the actual characteristic information of the actual analysis object includes: The actual characteristic information of the actual analysis object is input into the classification model to predict the classification result of corn kernel sweetness.

[0010] Furthermore, the classification model is constructed using a classification neural network; wherein the training of the classification model includes the following steps: Selecting the corn kernel with the largest width in each image of the training set; Classify the image features of the selected corn kernels according to kernel morphology and color; The classification neural network is trained through classification categories to obtain a classification model.

[0011] The second object of the present invention is to provide a corn sweetness detection system based on machine vision to implement the above method, including an image acquisition device, a light source, a rotating device, and a main controller; wherein, The light source is used to emit a light source to illuminate corn; The image acquisition device is used to acquire corn images; The rotating device is used to rotate the corn; The main controller is used to detect the sweetness of corn according to the corn image.

[0012] The third object of the present invention is to provide an electronic device, comprising: a memory on which a program code is stored; a processor connected to the memory and implementing the above method when the program code is executed by the processor.

[0013] A fourth object of the present invention is to provide a computer-readable storage medium having program instructions stored thereon, wherein the program instructions implement the above method when executed by a processor.

[0014] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method and system, device, and medium for detecting the sweetness of corn based on machine vision, the method comprising the following steps: obtaining image information of corn to be detected; processing the corn image to obtain the main middle area of ​​the corn; locating each corn kernel in the main middle area of ​​the corn and obtaining the width information of the corn kernel; obtaining the corn kernel with the maximum width as the actual analysis object; and realizing the sweetness detection of corn based on the actual feature information of the actual analysis object. The method for detecting the sweetness of corn based on machine vision provided by the present invention has higher stability and accuracy than the conventional 2D algorithm, does not need to add additional operation steps such as picking corn kernels, removes incomplete and defective corn kernels in the corn cob through data screening, and its actual sweetness grading data is more accurate, so that the detection result of the sweetness of corn is more accurate.

[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. The specific implementation of the present invention is given in detail by the following embodiments and their accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 The flowchart of the method for detecting corn sweetness based on machine vision of Example 1; Figure 2 This is a flow chart of corn image processing in Example 1; Figure 3 This is a flow chart of the detection model training of Example 1; Figure 4 This is a flow chart of the classification model training of Example 1; Figure 5 This is a schematic diagram of the main areas in the middle of corns with different sweetness levels; Figure 6 This is a schematic diagram of corn kernel positioning; Figure 7 This is a schematic diagram of corn categories; Figure 8 This is a schematic diagram of a corn sweetness detection system based on machine vision in Example 2; Fig. 9 This is a schematic diagram of an electronic device according to Embodiment 3; Fig.10 This is a schematic diagram of a computer-readable storage medium of Example 4.

[0017] In the figure: 1. Image acquisition device; 2. Light source; 3. Rotating device; 4. Corn. DETAILED DESCRIPTION

[0018] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. It should be noted that, under the premise of no conflict, the embodiments or technical features described below can be arbitrarily combined to form a new embodiment.

[0019] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.

[0020] The figure numbers in this application are only used to distinguish the various steps in the scheme, and are not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0022] Example 1 A method for detecting corn sweetness based on machine vision, such as Figure 1 As shown, the following steps are included: S1. Obtain image information of corn to be detected; like Figure 8 As shown, the corn 4 to be inspected can be mounted on the rotating device 3 , the imaging angle of the corn 4 can be adjusted by the rotating device 3 , and the image information of the surface of the corn 4 can be collected by the image acquisition device 1 and the light source 2 .

[0023] S2, processing the corn image to obtain the main middle area of ​​the corn; In some embodiments, Figure 2 As shown, the step of processing the corn image to obtain the main middle area of ​​the corn includes: S21, converting the corn image into a grayscale image; S22, performing denoising processing on the converted image; for example, using a Gaussian filtering algorithm to remove image noise.

[0024] S23, using an edge detection algorithm to extract the edge of the corn ear from the processed image; for example, using the Canny algorithm to extract the edge of the corn ear.

[0025] S24, using an image contour function to extract the contour information of the corn ear from the edge of the corn ear; for example, using a findContours function to extract the contour information of the corn ear.

[0026] S25, obtaining a circumscribed rectangle of an ear of corn according to the outline information of the ear of corn; S26, intercepting a central area at the center of the circumscribed rectangle of the ear of corn according to the set parameters; that is, intercepting the central area by setting a certain width and height at the center of the circumscribed rectangle.

[0027] S27, intercepting the original color image according to the coordinates of the central area to obtain the main area in the middle of the corn, the main areas in the middle of the corns with different sweetness are as follows: Figure 5 shown.

[0028] S3, locating each corn kernel in the middle main area of ​​the corn and obtaining the width information of the corn kernel; In some embodiments, the step of locating each corn kernel in the middle main area of ​​the corn and obtaining the width information of the corn kernel comprises: The main area in the middle of the corn is input into the detection model, and the corresponding detection frame size under the pixel coordinates is predicted to obtain the width information of the corn kernel. The positioning result of the corn kernel is as follows: Figure 6 shown.

[0029] Optionally, the detection model is constructed using a detection neural network. Specifically, Figure 3 As shown, the training of the detection model includes the following steps: S31, obtaining corn images, and dividing the corn images into a training set and a test set; Among them, the corn image used to train the detection model can also be obtained through Figure 8 The data are collected by the device shown, and the collection principle is the same, which will not be repeated here.

[0030] S32, marking the circumscribed rectangular frame of each corn kernel in the image of the training set; S33, inputting the labeled image into the detection neural network for training to obtain a detection model; S34. Verify the detection model through the images of the test set to determine the feasibility and stability of the detection model.

[0031] S4. Obtain corn kernels with the largest width as actual analysis objects. Specifically, the corn kernels with the largest width can be obtained by sorting data and used as actual analysis objects.

[0032] S5. Implement corn sweetness detection based on actual characteristic information of the actual analysis object.

[0033] In some embodiments, the step of detecting the sweetness of corn based on the actual characteristic information of the actual analysis object includes: The actual characteristic information of the actual analysis object is input into the classification model to predict the classification result of the sweetness of corn kernels, and the classification result is used as the basis for judging the sweetness. The actual characteristic information of the actual analysis object includes but is not limited to information such as color, width, brightness, and shape.

[0034] Optionally, the classification model is constructed using a classification neural network; wherein, Figure 4 As shown, the training of the classification model includes the following steps: S500, selecting a corn kernel with the maximum width in each image of the training set; S510, classifying the image features of the selected corn kernels according to kernel shape and color, for example, into categories such as Sweet Single No. 8, Dynasty, and Crisp King, etc. Figure 7 As shown; S520: Train the classification neural network by classification categories to obtain a classification model.

[0035] The present embodiment provides a method for detecting the sweetness of corn based on machine vision, the method comprising the following steps: obtaining image information of corn to be detected; processing the corn image to obtain the main middle area of ​​the corn; locating each corn kernel in the main middle area of ​​the corn and obtaining the width information of the corn kernel; obtaining the corn kernel with the maximum width as the actual analysis object; and realizing the sweetness detection of corn based on the actual characteristic information of the actual analysis object. The method for detecting the sweetness of corn based on machine vision provided by the present embodiment has higher stability and accuracy than the conventional 2D algorithm, does not require the addition of additional operation steps such as picking corn kernels, and removes incomplete and defective corn kernels in the corn cob through data screening, so that the actual sweetness grading data is more accurate, making the corn sweetness detection result more accurate.

[0036] Example 2 Based on the same concept, this embodiment also provides a corn sweetness detection system based on machine vision, which is used to implement the corn sweetness detection method based on machine vision provided in Example 1. For a detailed description of the corn sweetness detection method based on machine vision provided in Example 1, please refer to the corresponding description in Example 1, which will not be repeated here.

[0037] It is understandable that the corn sweetness detection system based on machine vision provided in this embodiment includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in this embodiment, this embodiment can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of this embodiment.

[0038] A corn sweetness detection system based on machine vision, such as Figure 8 As shown, it includes an image acquisition device 1, a light source 2, a rotating device 3, and a main controller; wherein, The light source is used to emit a light source to illuminate the corn 4; The image acquisition device is used to acquire corn images; for example, the image acquisition device can be a line scan camera or the like.

[0039] The rotating device is used to rotate the corn; The main controller is used to detect the sweetness of corn according to the corn image.

[0040] In some embodiments, the master controller may include the following process: An image acquisition module, used to acquire image information of the corn to be detected; A corn middle main area obtaining module is used to process the corn image and obtain the corn middle main area; A width information acquisition module, used for locating each corn kernel in the middle main area of ​​the corn and acquiring the width information of the corn kernel; An actual analysis object selection module is used to obtain the corn kernel with the maximum width as the actual analysis object; The corn sweetness detection module is used to detect the sweetness of corn according to the actual characteristic information of the actual analysis object.

[0041] In one embodiment, the corn middle main area obtaining module processes the corn image in the following manner to obtain the corn middle main area: Converting the corn image into a grayscale image; Perform denoising on the converted image; The edge detection algorithm is used to extract the edge of the corn ear from the processed image; extracting corn ear contour information from the corn ear edge using an image contour function; Obtaining a corn ear circumscribed rectangle through the corn ear outline information; Cutting a central area at the center of the circumscribed rectangle of the ear of corn according to set parameters; The original color image is intercepted according to the coordinates of the central area to obtain the main middle area of ​​the corn.

[0042] In one embodiment, the width information acquisition module locates each corn kernel in the middle main area of ​​the corn and acquires the width information of the corn kernel in the following manner: The main middle area of ​​the corn is input into the detection model, and the corresponding detection frame size under the pixel coordinates is predicted to obtain the width information of the corn kernels.

[0043] In one implementation, the detection model of the width information acquisition module is constructed using a detection neural network.

[0044] In one implementation, the width information acquisition module trains the detection model in the following manner: Acquire corn images, and divide the corn images into a training set and a test set; Annotate the circumscribed rectangular frame of each corn kernel in the image of the training set; Inputting the labeled image into the detection neural network for training to obtain a detection model; The detection model is verified using images from the test set.

[0045] In one embodiment, the corn sweetness detection module implements corn sweetness detection according to actual characteristic information of the actual analysis object in the following manner: The actual characteristic information of the actual analysis object is input into the classification model to predict the classification result of corn kernel sweetness.

[0046] In one embodiment, the classification model of the corn sweetness detection module is constructed using a classification neural network; wherein the training of the classification model comprises the following steps: Selecting the corn kernel with the largest width in each image of the training set; Classify the image features of the selected corn kernels according to kernel morphology and color; The classification neural network is trained through classification categories to obtain a classification model.

[0047] Regarding the main controller in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0048] It should be noted that the principle and workflow of the corn sweetness detection system based on machine vision provided in this embodiment are similar to those of the corn sweetness detection method based on machine vision provided in Example 1. The relevant details can be referred to the above description and will not be repeated here.

[0049] The present embodiment provides a corn sweetness detection system based on machine vision, which includes an image acquisition device, a light source, a rotating device, and a main controller. The corn sweetness detection method based on machine vision provided by the present embodiment has higher stability and accuracy than the conventional 2D algorithm, does not require additional operation steps such as picking corn kernels, and removes incomplete and defective corn kernels in corn ears through data screening. The actual sweetness grading data is more accurate, making the corn sweetness detection result more accurate.

[0050] Example 3 An electronic device, such as Fig. 9 As shown, it includes: a memory on which program codes are stored; a processor connected to the memory, and when the program codes are executed by the processor, a method for detecting corn sweetness based on machine vision is implemented. For a detailed description of the method, reference can be made to the corresponding description in the above method embodiment, which will not be repeated here.

[0051] Example 4 A computer readable storage medium such as Fig.10 As shown, program instructions are stored thereon, and when the program instructions are executed by the processor, a method for detecting corn sweetness based on machine vision is implemented. For a detailed description of the method, reference may be made to the corresponding description in the above method embodiment, and no further description is given here.

[0052] The number of devices and processing scales described here are used to simplify the description of the present invention. Applications, modifications and variations of the present invention will be obvious to those skilled in the art.

[0053] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and implementation modes. They can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

[0054] The apparatus, electronic device, non-volatile computer storage medium and method provided in the embodiments of this specification correspond to each other, and therefore, the apparatus, electronic device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, electronic device and non-volatile computer storage medium will not be repeated here.

[0055] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software units for implementing the method and structures within the hardware component.

[0056] The systems, devices or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions in various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or more software and / or hardware.

[0057] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0058] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0059] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0060] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0061] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0062] The specification may be described in the general context of computer-executable instructions executed by a computer, such as program units. Generally, program units include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program units may be located in local and remote computer storage media, including storage devices.

[0063] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0064] The above description is only an embodiment of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of one or more embodiments of this specification.

Claims

1. A method for detecting corn sweetness based on machine vision, characterized in that: The following steps are involved: Acquire image information of corn to be detected; Process the corn image to obtain the main area in the middle of the corn; Locating each corn kernel in the corn middle main area and obtaining the width information of the corn kernel; Obtain the corn kernel with the maximum width as the actual analysis object; The sweetness detection of corn is realized according to the actual characteristic information of the actual analysis object.

2. A method for detecting corn sweetness based on machine vision as claimed in claim 1, characterized in that: The step of processing the corn image to obtain the main middle area of ​​the corn includes: Converting the corn image into a grayscale image; Perform denoising on the converted image; The edge detection algorithm is used to extract the edge of the corn ear from the processed image; extracting corn ear contour information from the corn ear edge using an image contour function; Obtaining a corn ear circumscribed rectangle through the corn ear outline information; Cutting a central area at the center of the circumscribed rectangle of the ear of corn according to set parameters; The original color image is intercepted according to the coordinates of the central area to obtain the main middle area of ​​the corn.

3. A method for detecting corn sweetness based on machine vision as claimed in claim 2, characterized in that: The step of locating each corn kernel in the middle main area of ​​the corn and obtaining the width information of the corn kernel comprises: The main middle area of ​​the corn is input into the detection model, and the corresponding detection frame size under the pixel coordinates is predicted to obtain the width information of the corn kernels.

4. A method for detecting corn sweetness based on machine vision as claimed in claim 3, characterized in that: The detection model is constructed using a detection neural network.

5. A method for detecting corn sweetness based on machine vision as claimed in claim 4, characterized in that: The training of the detection model includes the following steps: Acquire corn images, and divide the corn images into a training set and a test set; Annotate the circumscribed rectangular frame of each corn kernel in the image of the training set; Inputting the labeled image into the detection neural network for training to obtain a detection model; The detection model is verified using images from the test set.

6. A method for detecting corn sweetness based on machine vision as claimed in claim 5, characterized in that: The step of realizing corn sweetness detection according to the actual characteristic information of the actual analysis object comprises: The actual characteristic information of the actual analysis object is input into the classification model to predict the classification result of corn kernel sweetness.

7. A method for detecting corn sweetness based on machine vision as claimed in claim 6, characterized in that: The classification model is constructed using a classification neural network; wherein the training of the classification model includes the following steps: Selecting the corn kernel with the largest width in each image of the training set; Classify the image features of the selected corn kernels according to kernel morphology and color; The classification neural network is trained through classification categories to obtain a classification model.

8. A corn sweetness detection system based on machine vision, implementing the method according to any one of claims 1 to 7, characterized in that: It includes an image acquisition device, a light source, a rotating device, and a main controller; wherein, The light source is used to emit a light source to illuminate corn; The image acquisition device is used to acquire corn images; The rotating device is used to rotate the corn; The main controller is used to detect the sweetness of corn according to the corn image.

9. An electronic device, characterized in that: include: A memory having program code stored therein; A processor connected to the memory, and when the program code is executed by the processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: Program instructions are stored thereon, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.