Full-automatic seed mildew detection method and device based on intelligent image analysis

Through intelligent image analysis technology, the detection of mold in seed particles is automated, the problems of low manual detection efficiency and poor accuracy are solved, the detection efficiency and accuracy are improved, and the needs of rapid batch detection are met.

CN120070431AActive Publication Date: 2025-05-30HENAN ZHONGYU ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510536260.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-05-30
Estimated Expiration
2045-04-27

AI Technical Summary

Technical Problem

In the prior art, mold detection of seed grains depends on manual naked eye observation, which has high time cost, high misjudgment rate and difficulty in meeting the needs of rapid batch detection.

Method used

Using a fully automatic detection method based on intelligent image analysis, the image of seed particles is reduced, color space segmentation, boundary enhancement and contour detection, combined with distance transformation and similar matching algorithms, automatic identification and grading of seed particles mold is achieved.

Benefits of technology

It improves the efficiency and accuracy of mold detection in seed grains, realizes standardized and objective evaluation standards, and meets the needs of rapid batch testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070431A_ABST
    Figure CN120070431A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a full-automatic seed mildew detection method and device based on intelligent image analysis, and the method comprises the steps: carrying out the noise reduction of a seed image, carrying out the binaryzation according to a color space, obtaining a seed binary image, removing the interference of a culture dish region in the seed binary image, and obtaining a seed mildew detection result; performing boundary enhancement and contour detection on the updated seed binary image to obtain a single seed binary image and a binary image of a plurality of seed aggregation regions, generating a gray level image of the binary image of the plurality of seed aggregation regions, matching the gray level image with a single seed standard form gray level image, and performing contour detection and screening on matched similar regions to obtain a single seed binary image and a plurality of seed aggregation region binary images; according to the seed mildewing detection method and device, the seed mildewing detection efficiency and accuracy can be improved based on the image processing technology and the computer vision algorithm, the seed mildewing detection efficiency can be improved, and the seed mildewing detection accuracy can be improved based on the image processing technology and the computer vision algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and particularly to a fully automatic seed grain mildew detection method and device based on intelligent image analysis. Background Art

[0002] In modern agricultural production and food safety management, the quality inspection of seed grains (such as grains, beans, etc.) has always been a crucial link. Mildew on the surface of seed grains not only affects their germination rate and edible quality, but may also pose a threat to the health of humans and livestock. Common mildew is caused by fungi, which may grow under adverse storage conditions and produce toxins harmful to the human body, such as aflatoxin. Therefore, to ensure the health and safety of seed grains, an effective mildew detection method is needed.

[0003] Traditionally, the detection of seed grain mildew mostly relies on manual visual inspection. This method is not only time-consuming and laborious, but also extremely susceptible to subjective judgment, resulting in misjudgment. This detection method not only consumes a huge amount of human resources and time costs, but may also bring inconsistent results due to the different experiences and states of observers. In addition, in large-scale production and circulation environments, manual detection usually cannot meet the requirements of rapid batch detection.

[0004] Therefore, there is an urgent need for an efficient and accurate seed grain mildew detection method, which can not only improve the speed and accuracy of detection, but also help to establish standardized and objective evaluation criteria, and promote the modernization process of agricultural production and food safety management. Summary of the Invention

[0005] Aiming at the problems in the prior art, this application provides a fully automatic seed grain mildew detection method and device based on intelligent image analysis, which can improve the efficiency and accuracy of seed grain mildew detection based on image processing technology and computer vision algorithms.

[0006] To solve at least one of the above problems, this application provides the following technical solutions: In a first aspect, this application provides a fully automatic seed grain mildew detection method based on intelligent image analysis, including: Obtain a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding noise-reduced seed grain image, perform a color space segmentation operation on the noise-reduced seed grain image according to a preset first color threshold to determine a corresponding seed grain binary image, and perform a culture dish interference removal operation on the seed grain binary image according to a set seed grain culture dish area to determine a corresponding updated seed grain binary image, where the seed grain binary image is used to separate the seed grain surface and the background area; Perform boundary enhancement operation on the updated seed binary image according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary image. Perform contour detection operation on the enhanced boundary seed binary image according to a preset contour detection algorithm to determine a corresponding plurality of effective contours. Perform seed morphology division operation on the plurality of effective contours according to a preset discrimination rule to determine the corresponding single-seed binary image and multi-seed aggregation region binary image; According to a preset distance transformation algorithm and the multi-seed aggregation region binary image, determine the corresponding first seed grayscale image. Perform border addition operation on the first seed grayscale image to determine the corresponding second seed grayscale image. Perform similarity matching operation according to the second seed grayscale image and a preset template seed grayscale image. According to the matching result obtained after the similarity matching operation, determine the corresponding potential single-seed binary image. Perform contour screening operation on the potential single-seed binary image, and perform single-seed segmentation operation on the multi-seed aggregation region binary image according to the single-seed contour obtained after the contour screening operation to determine the corresponding segmented single-seed binary image. Merge the segmented single-seed binary image and the single-seed binary image to determine the corresponding seed set. Perform mildew identification operation on the seed set according to a preset second color threshold to determine the corresponding seed mildew level.

[0007] Further, before performing the culture dish interference removal operation on the seed binary image according to the set seed culture dish region to determine the corresponding updated seed binary image, it includes: Perform binarization operation on the seed image according to a preset third color threshold to determine the corresponding contour binary image. Perform contour screening operation on the contour binary image according to a preset contour detection algorithm to determine the corresponding seed culture dish contour, where the contour binary image includes a seed culture dish contour and a seed contour; Perform polygon approximation operation and vertex extraction operation on the seed culture dish contour according to a preset polygon approximation algorithm to determine the corresponding seed culture dish polygon vertex coordinates. According to the maximum and minimum values of the seed culture dish polygon vertex coordinates, determine the corresponding seed culture dish region, where the seed culture dish region includes the seed culture dish center coordinates, the inner radius of the seed culture dish, and the outer radius of the seed culture dish.

[0008] Further, the performing boundary enhancement operation on the updated seed binary image according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary image includes: Perform noise removal operation on the updated seed binary image according to a preset erosion algorithm; Perform boundary enhancement operation on the updated seed binary image after the noise removal operation according to a preset dilation algorithm to determine the corresponding enhanced boundary seed binary image.

[0009] Further, the operation of classifying the seed grain morphology of the multiple effective contours according to a preset classification rule to determine the corresponding binary image of a single seed grain and the binary image of the multi-seed grain aggregation region includes: Traverse the multiple effective contours, and determine whether the effective contour is smaller than a preset contour area; If so, determine the corresponding binary image of a single seed grain according to the effective contour; If not, determine the corresponding binary image of the multi-seed grain aggregation region according to the effective contour.

[0010] Further, the operation of determining the corresponding first seed grain grayscale image according to the preset distance transformation algorithm and the binary image of the multi-seed grain aggregation region includes: Perform a calculation operation on the distance from each pixel point in the binary image of the multi-seed grain aggregation region to the background to determine the corresponding distance value; Determine the corresponding grayscale value according to the distance value, and determine the corresponding first seed grain grayscale image according to the grayscale value.

[0011] Further, the operation of performing a similarity matching operation on the second seed grain grayscale image and a preset template seed grain grayscale image, and determining the corresponding potential single seed grain binary image according to the matching result obtained after the similarity matching operation includes: Perform a similarity matching operation on the second seed grain grayscale image and a preset template seed grain grayscale image according to a preset normalized cosine correlation coefficient algorithm to determine the corresponding similar region, where the preset template seed grain grayscale image is the grayscale image of a single standard seed grain shape; Perform a threshold filtering operation on the similar region according to a preset potential seed grain threshold to determine the corresponding potential single seed grain binary image.

[0012] Further, the operation of performing mildew identification on the seed grain set according to a preset second color threshold to determine the corresponding seed grain mildew level includes: Perform a mildew identification operation on the seed grain set according to a preset second color threshold to determine the corresponding mildew area; Perform a mildew ratio calculation operation according to the mildew area and the total area of the seed grain set to determine the corresponding seed grain mildew level.

[0013] In a second aspect, the present application provides a fully automatic seed grain mildew detection device based on intelligent image analysis, including: The seed binary image determination module is used to obtain a seed image, perform a Gaussian filtering operation on the seed image to determine a corresponding noise-reduced seed image, perform a color space segmentation operation on the noise-reduced seed image according to a preset first color threshold to determine a corresponding seed binary image, and perform a petri dish interference removal operation on the seed binary image according to a set seed petri dish area to determine a corresponding updated seed binary image. Among them, the seed binary image is used to separate the seed surface and the background area; The seed aggregation type binary image determination module is used to perform a boundary enhancement operation on the updated seed binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed binary image, perform a contour detection operation on the enhanced boundary seed binary image according to a preset contour detection algorithm to determine a corresponding plurality of effective contours, and perform a seed morphology division on the plurality of effective contours according to a preset discrimination rule to determine a corresponding single-seed binary image and a multi-seed aggregation area binary image; The seed mildew level determination module is used to determine a corresponding first seed grayscale image according to a preset distance transformation algorithm and the multi-seed aggregation area binary image, perform a border addition operation on the first seed grayscale image to determine a corresponding second seed grayscale image, perform a similarity matching operation according to the second seed grayscale image and a preset template seed grayscale image, determine a corresponding potential single-seed binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single-seed binary image, and perform a single-seed segmentation operation on the multi-seed aggregation area binary image according to the single-seed contour obtained after the contour screening operation to determine a corresponding segmented single-seed binary image, merge the segmented single-seed binary image and the single-seed binary image to determine a corresponding seed set, and perform a mildew identification operation on the seed set according to a preset second color threshold to determine a corresponding seed mildew level.

[0014] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the full-automatic seed mildew detection method based on intelligent image analysis are implemented.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the full-automatic seed mildew detection method based on intelligent image analysis are implemented.

[0016] In a fifth aspect, the present application provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the full-automatic seed mildew detection method based on intelligent image analysis are implemented.

[0017] As can be seen from the above technical solutions, the present application provides a fully automatic seed grain mildew detection method and device based on intelligent image analysis. By denoising the seed grain image and binarizing it according to the color space, a seed grain binary image is obtained. The interference of the culture dish area in the seed grain binary image is removed, and the updated seed grain binary image is subjected to boundary enhancement and contour detection to obtain a single seed grain binary image and a multi-seed grain aggregation area binary image. A grayscale image of the multi-seed grain aggregation area binary image is generated, and this grayscale image is matched with the grayscale image of the standard shape of a single seed grain. The contours of the similar areas after matching are detected and screened, so as to divide the multi-seed grain aggregation area binary image into a single seed grain combination area binary image. The single seed grain combination area binary image is merged with the single seed grain binary image to obtain a seed grain set, and mildew detection is performed on the seed grain set. Thus, the efficiency and accuracy of seed grain mildew detection can be improved based on image processing technology and computer vision algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1 It is one of the flow charts of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 2 It is another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 3 It is yet another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 4 It is still another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 5 It is yet another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 6 It is still another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 7 It is yet another flow chart of the fully automatic seed grain mildew detection method based on intelligent image analysis in the embodiments of the present application; Figure 8 It is the structural diagram of the fully automatic seed grain mildew detection device based on intelligent image analysis in the embodiments of the present application; Figure 9 Schematic structural diagram of the electronic device in the embodiment of the present application.

[0020] Reference numerals: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed implementation manners

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0022] In the technical solutions of the present application, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.

[0023] Considering the problem that the traditional manual detection method for seed grain mildew is difficult to meet the requirements of rapid batch detection. The present application provides a full-automatic seed grain mildew detection method and device based on intelligent image analysis. By denoising the seed grain image and performing binarization according to the color space, a seed grain binary image is obtained. The interference of the culture dish area in the seed grain binary image is removed, boundary enhancement and contour detection are performed on the updated seed grain binary image to obtain a single seed grain binary image and a multi-seed grain aggregation area binary image. A grayscale image of the multi-seed grain aggregation area binary image is generated, and this grayscale image is matched with the standard shape grayscale image of a single seed grain, and contour detection and screening are performed on the similar areas after matching. In this way, the multi-seed grain aggregation area binary image is segmented into a single seed grain combination area binary image, and this single seed grain combination area binary image is merged with the single seed grain binary image to obtain a seed grain set, and mildew detection is performed on the seed grain set. Therefore, the efficiency and accuracy of seed grain mildew detection can be improved based on image processing technology and computer vision algorithms.

[0024] To improve the efficiency and accuracy of seed grain mildew detection based on image processing technology and computer vision algorithms, the present application provides an embodiment of a full-automatic seed grain mildew detection method based on intelligent image analysis. Refer to Figure 1 The full-automatic seed grain mildew detection method based on intelligent image analysis specifically includes the following contents: Step S101: Obtain the seed grain image, perform a Gaussian filtering operation on the seed grain image to determine the corresponding noise-reduced seed grain image, perform a color space segmentation operation on the noise-reduced seed grain image according to a preset first color threshold to determine the corresponding seed grain binary image, and perform a petri dish interference removal operation on the seed grain binary image according to the set seed grain petri dish area to determine the corresponding updated seed grain binary image, where the seed grain binary image is used to separate the seed grain surface and the background area; Optionally, in this embodiment, the purpose of this step is to preprocess the obtained seed grain image, including noise elimination and interference removal, to form a seed grain binarized image.

[0025] Optionally, during the preprocessing, a Gaussian filter G(x, y) is used to eliminate environmental noise and background interference, making the features of the seeds in the image more prominent. The formula of G(x, y) is as follows:

[0026] Eliminating environmental noise and background interference through Gaussian filtering makes the features of the seeds more prominent and improves the accuracy of image analysis.

[0027] Optionally, next, the image color space is converted to the HSV (hue, saturation, value) space. Such a color conversion helps to distinguish seeds from the background by color and facilitates subsequent color space segmentation operations. The set threshold range is and , thereby forming a binarized image mask in the HSV color space. This step effectively separates the seed grain surface and the background area.

[0028] Specifically, according to the set HSV threshold range, the pixels in the image are classified into two categories: Target area: The pixel points that meet the set threshold range are marked as 1, indicating that they belong to the seed grain area.

[0029] Background area: The pixel points that do not meet the threshold range are marked as 0, indicating that they belong to the background.

[0030] By setting an appropriate HSV threshold range, the seed grain and the background area can be effectively distinguished to generate a binarized image mask, which becomes the basis for subsequent analysis and processing. For example, removing background interference, reducing noise, and ensuring accurate identification of subsequent seed grains and mildew areas.

[0031] Optionally, when identifying the seed grains, the glass wall of the petri dish may reflect the color of the seed grain surface. When separating the seed grains from the background by HSV, this may cause part of the petri dish to be connected to the seed grains, thus affecting the calculation of the subsequent mildew ratio. To solve this problem, it is necessary to identify the geometric parameters of the petri dish from the original image, including the center coordinates and the inner and outer radii.

[0032] Specifically, first, the initial image is converted to the HSV color space and binarized according to the specified color range to create an initial mask. The binary image created within this color range contains the outlines of the seeds and the seed culture dish.

[0033] Next, all the outlines in the image are detected using the contour finding function of OpenCV, sorted from largest to smallest by area, and the smaller noise outlines are removed. It can be understood that the area of the culture dish is larger and the area of the seeds is smaller. By removing the outlines with smaller areas, the outline of the culture dish can be obtained.

[0034] For the filtered valid outlines (i.e., the outline of the culture dish), calculate its polygon approximation and extract the coordinates of all vertices, find the minimum and maximum values in the coordinates, and calculate the center coordinates and outer radius of the culture dish based on this. Finally, the inner radius is calculated by simple adjustment.

[0035] With these data, based on the center point coordinates, inner radius, and outer radius, the interference in the culture dish area can be removed from the initial mask mask, thereby obtaining a new binary image mask mask1. This image mask mask1 only includes the correct outlines of the seeds, ensuring the accuracy of subsequent analysis.

[0036] Step S102: Perform boundary enhancement operations on the updated binary seed image according to a preset morphological algorithm to determine the corresponding enhanced boundary binary seed image. Perform contour detection operations on the enhanced boundary binary seed image according to a preset contour detection algorithm to determine the corresponding multiple valid contours. Perform seed morphology division operations on the multiple valid contours according to a preset discrimination rule to determine the corresponding single-seed binary image and multi-seed aggregation area binary image; Optionally, in this embodiment, the purpose of this step is to perform morphological processing and contour detection on the binary image mask mask1 to distinguish the single-seed outline and the multi-seed aggregation area outline.

[0037] Optionally, in this embodiment, perform boundary enhancement operations on the updated binary seed image according to a preset morphological algorithm to determine the corresponding enhanced boundary binary seed image.

[0038] Specifically, use the new binary image mask1 to enhance the boundaries of the seeds through morphological operations. The morphological erosion and dilation processes are defined by the following formulas respectively: Erosion: , This formula represents the erosion processing of image A using convolution template B. By performing convolution calculation between template B and image A, the minimum value of the pixel points in the area covered by B is obtained, and this minimum value is used to replace the pixel value of the reference point. The erosion operation helps to remove small noise points in the image.

[0039] Dilation: , This formula represents the dilation processing of image A using convolution kernel B, whose shape can be square or circular. By performing convolution calculation between template B and image A, the maximum value of the pixel points in the area covered by B is obtained, and this value is used to replace the pixel value of the reference point to achieve the dilation of the image. The dilation operation helps to enhance the prominent boundaries in the image.

[0040] The combination of these morphological operations (i.e., erosion and dilation) is to effectively remove small noise in the image and significantly improve the boundary clarity of the seeds, thus facilitating subsequent accurate contour detection and generating the improved binary image mask2.

[0041] Optionally, in this embodiment, contour detection operation is performed on the enhanced boundary seed binary map according to a preset contour detection algorithm to determine corresponding multiple effective contours.

[0042] Specifically, the contour detection function of OpenCV is used to detect the contours in the binary image mask2 of the seeds, and the detected contours are sorted in descending order according to the area. Then, all the contours are traversed, and the noise contours with an area smaller than the set threshold are filled with 0 to purify the target area. Contour detection can identify the boundaries of the seeds, provide a more accurate seed area, and facilitate subsequent identification of the mildew area.

[0043] Optionally, in this embodiment, seed morphology classification operation is performed on the multiple effective contours according to a preset classification rule to determine corresponding single-seed binary map and multi-seed aggregation area binary map.

[0044] Specifically, continue to traverse the remaining contours and classify them based on the area.

[0045] The purpose of this process is to identify the areas of single seeds and multi-seed aggregations: if the area of the contour is less than the set single-seed threshold, it is regarded as a single seed, and the corresponding mask and contour are generated and stored in ; otherwise, these contours with larger areas are regarded as areas of multi-seed aggregations, and the corresponding masks are generated, and a new is synthesized from these large-area masks. This classification helps subsequent image analysis and processing.

[0046] Step S103: According to the preset distance transformation algorithm and the multiple-grain aggregation region binary images, determine the corresponding first grain grayscale image, perform a border addition operation on the first grain grayscale image to determine the corresponding second grain grayscale image, perform a similarity matching operation based on the second grain grayscale image and the preset template grain grayscale image, determine the corresponding potential single-grain binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single-grain binary image, and perform a single-grain segmentation operation on the multiple-grain aggregation region binary image according to the single-grain contour obtained after the contour screening operation to determine the corresponding segmented single-grain binary image, perform a merging operation on the segmented single-grain binary image and the single-grain binary image to determine the corresponding grain set, and perform a mildew identification operation on the grain set according to the preset second color threshold to determine the corresponding grain mildew level.

[0047] Optionally, in this embodiment, the purpose of this step is to perform grain segmentation on the region of multiple-grain aggregation to obtain a single-grain combination region, and merge it with the single-grain set in step S102 to obtain an updated grain set.

[0048] Optionally, in this embodiment, first, create an elliptical structuring element and use this structuring element to perform a morphological closing operation on the input image The closing operation helps to eliminate noise and fill small internal holes, making the grain regions in the image more complete and coherent.

[0049] Secondly, calculate the distance from each non-zero pixel in the image to the nearest zero pixel. The result of the distance transformation generates a grayscale image representing the distance from each pixel point to the background. To avoid the influence of edge effects on subsequent calculations, a border of a certain size is added to the image after the distance transformation. This operation of expanding the boundary is particularly important when matching specific structures or shapes, ensuring that during the template matching process, inaccurate matching results will not occur due to being close to the boundary.

[0050] It can be understood that by adding a border, pixels outside the image edge can be simulated, reducing edge effects. In terms of effect, by expanding the boundary of the image, it can be ensured that even if a part of the template is located at the edge of the original image, sufficient information can be found in the expanded image for accurate matching. In practical applications, the edge part of the image may become unstable due to various reasons (such as light changes, noise, etc.). By adding a border, the environment outside the image edge can be simulated to a certain extent, improving the robustness of the algorithm to these unstable factors.

[0051] Then, create an elliptical template kernel, which can be a standard seed shape (such as an ellipse) or an average shape obtained by processing known seed images. Process the template with the same distance transformation pattern to generate a distance transformation grayscale image of the template. Use the template matching function to search for the region in the extended distance map that is most similar to the prepared template. The normalized cosine correlation coefficient method is used in the template matching process, which is screened through similarity metrics to find the possible elliptical seed regions in the image.

[0052] Next, after identifying the similar regions, binarize the matching results by setting a threshold filter to generate a binary image representing the potential seed centers in the image. Each point above the threshold is regarded as a possible target region. Identify all the contour lines on the generated binary image and use these as the possible seed boundaries. However, not all the identified contours meet our expectations for the seeds. To eliminate false detections and noise, it is also necessary to traverse the contours and calculate the area of their bounding rectangles. Any contour smaller than a given threshold is regarded as irrelevant small noise and filled with black to remove it. This process ensures that the output set of contours truly represents the possible regions of multiple seed combinations.

[0053] Finally, merge the processed and filtered set of seeds and the single-seed set in step S102 to obtain an updated set of seeds.

[0054] Optionally, in this embodiment, for each seed in the above seed set, a method based on color threshold is used to segment the mildew area. Set the color range of the mildew area in the HSV color space, and then calculate the area of the mildew area (the number of pixels AM in the mildew area) and the total area of the seeds (the number of pixels AT in the seed area) respectively. The final mildew ratio Ratio = is calculated.

[0055] This ratio reflects the degree to which the seeds are eroded by mildew and can be used for subsequent quality assessment and grading.

[0056] This example demonstrates how this embodiment realizes the detection of seeds and the identification of the mildew area based on image processing technology and computer vision algorithms.

[0057] As can be seen from the above description, the fully automatic seed mildew detection method based on intelligent image analysis provided by the embodiments of the present application can denoise the seed image and perform binarization according to the color space to obtain a binary seed image, remove the interference of the petri dish area in the binary seed image, perform boundary enhancement and contour detection on the updated binary seed image to obtain a single-seed binary image and a multi-seed aggregation area binary image, generate a grayscale image of the multi-seed aggregation area binary image, match the grayscale image with the standard morphological grayscale image of a single seed, and perform contour detection and screening on the similar areas after matching, so as to segment the multi-seed aggregation area binary image into a single-seed combination area binary image, merge the single-seed combination area binary image with the single-seed binary image to obtain a seed set, and perform mildew detection on the seed set. Therefore, the efficiency and accuracy of seed mildew detection can be improved based on image processing technology and computer vision algorithms.

[0058] In an embodiment of the fully automatic seed mildew detection method based on intelligent image analysis of the present application, refer to Figure 2 , the following specific content may also be included: Step S201: Perform a binarization operation on the seed image according to a preset third color threshold to determine a corresponding contour binary image, and perform a contour screening operation on the contour binary image according to a preset contour detection algorithm to determine a corresponding seed petri dish contour, where the contour binary image includes a seed petri dish contour and a seed contour; Step S202: Perform a polygon approximation operation and a vertex extraction operation on the seed petri dish contour according to a preset polygon approximation algorithm to determine corresponding seed petri dish polygon vertex coordinates, and determine a corresponding seed petri dish area according to the maximum and minimum values of the seed petri dish polygon vertex coordinates, where the seed petri dish area includes a seed petri dish center coordinate, an inner radius of the seed petri dish, and an outer radius of the seed petri dish.

[0059] Optionally, in this embodiment, when analyzing the seed image, the interference of the petri dish may affect the detection of seeds and the calculation of the mildew ratio. Especially when the glass surface of the petri dish reflects the surface color of the seeds, it is easy to misidentify it as part of the seeds. This step is to exclude the interference of the glass wall of the petri dish.

[0060] Optionally, the technical means for excluding interference in this step is to calculate the morphology of the petri dish through image processing technology and remove the interference of the petri dish area on the basis of the initial mask mask.

[0061] First, convert the original image to the HSV (hue, saturation, value) color space. The HSV color space can better distinguish seeds and the background, especially by the hue value to distinguish the seed surface and the petri dish glass area. In this space, by setting appropriate thresholds for hue, saturation, and value, the seeds can be effectively separated from the background, and at the same time, the area of the petri dish can be recognized.

[0062] Secondly, use the contour detection function of OpenCV to find all the contours in the image. Contours are the boundaries of objects in the image, and through the contours, the boundaries of seeds and petri dishes can be detected. The results after contour detection will be sorted by area and screened from large to small. Since the petri dish is usually larger while the seeds are relatively smaller, those small noise contours (seed contours) can be removed by the area size, thus obtaining the target contour, that is, the contour of the petri dish.

[0063] Then, use polygon approximation (cv2.approxPolyDP()) on the screened target contour to simplify the contour into a polygon form. Through polygon approximation, the vertex coordinates of the contour can be effectively obtained. After extracting these vertex coordinates, the minimum and maximum values among these coordinates can be found, and based on this, the bounding rectangle of the petri dish can be calculated, and further the center coordinates and outer radius of the petri dish can be determined. According to the known outer radius, by simple adjustment or based on the known relationship between the inner and outer radii, the inner radius of the petri dish can be calculated.

[0064] It can be understood that using the calculated center coordinates, inner radius, and outer radius, a region is generated on the initial mask of the image to remove the interference region related to the petri dish. In this way, it can be ensured that subsequent analyses (such as seed detection, mildew ratio calculation, etc.) are not affected by the petri dish area.

[0065] For example, assume we have a seed image with multiple seeds distributed in a petri dish. Due to the light reflected by the petri dish glass, there may be a situation where the seeds are connected to the petri dish in the image. We need to remove the interference of the petri dish through the above steps, and the specific process is as follows: Convert to the HSV color space: Assume the color of the seeds in the image is yellow, and the color of the petri dish glass is transparent blue. By setting the HSV range of yellow (for example, the hue is 30 - 40, the saturation is 50 - 255, and the value is 50 - 255), the seed area can be effectively separated from the background.

[0066] Contour detection: After detecting all the contours in the image using cv2.findContours(), a large contour (i.e., the glass area of the petri dish) and several small contours (seeds) were found. We sorted them in descending order of area, removed the smaller contours, and only retained the larger contour, representing the area of the petri dish.

[0067] Polygon approximation and vertex extraction: Perform polygon approximation on the contour of the petri dish to obtain its vertex coordinates, calculate the minimum and maximum values, and thus obtain the boundaries of the circumscribed rectangle.

[0068] Calculate geometric parameters: Based on the vertex coordinates, calculate the outer radius and inner radius of the petri dish, and then obtain its center coordinates.

[0069] Remove interference: Finally, using the calculated center coordinates and radius, generate a new mask to remove the petri dish area from the image, leaving only the pure seed area to ensure accurate subsequent analysis.

[0070] Through step S202, this embodiment obtains the seed petri dish area, laying a foundation for accurately counting the mildew of seeds by excluding the interference of the petri dish glass subsequently.

[0071] In an embodiment of the full-automatic seed mildew detection method based on intelligent image analysis of the present application, see Figure 3 , and it may specifically include the following content: Step S301: Perform noise removal operation on the updated seed binary image according to a preset erosion algorithm; Step S302: Perform boundary enhancement operation on the updated seed binary image after the noise removal operation according to a preset dilation algorithm to determine the corresponding enhanced boundary seed binary image.

[0072] Optionally, in this embodiment, this step performs morphological processing on the preprocessed seed binary image to remove small noises in the image.

[0073] Specifically, for morphological erosion, first, a structuring element (usually a small rectangle or circle) needs to be selected. This structuring element defines the "neighborhood" of the erosion operation. For each pixel point in the image, it is compared with the structuring element. If all the pixel points within the structuring element have values greater than or equal to the value of the central pixel point (for binary images, usually 1), then the value of this pixel point is retained; otherwise, the value of this pixel point is set to 0 (for binary images, that is, it becomes the background). Perform the above operations on the entire image until all pixel points have been processed.

[0074] It can be understood that the erosion operation will remove small noise points in the image because small noise points are usually surrounded by larger target areas around them and thus are removed during the erosion process. At the same time, the target boundary will also shrink due to erosion.

[0075] Specifically, for morphological dilation, similarly, a structuring element needs to be selected. For each pixel point in the image, it is compared with the structuring element. If the value of any pixel point within the structuring element is greater than the value of the central pixel point (for a binary image, that is, there is a pixel point with a value of 1 within the structuring element), then the value of the central pixel point is set to 1 (for a binary image, that is, it is changed to a target). The above operation is performed on the entire image until all pixel points have been processed.

[0076] It can be understood that the dilation operation will enhance the boundary of the target in the image because it will expand the target area outwards, fill small internal holes, and make the connection between targets closer.

[0077] Optionally, in this embodiment, the erosion operation is performed first, and then the dilation operation. This helps to remove small noise points while keeping the basic shape of the target unchanged.

[0078] Through step S302, this embodiment realizes the enhancement processing of the preprocessed binary image, laying a foundation for accurately identifying the seed grain morphology in the subsequent process.

[0079] In an embodiment of the full-automatic seed grain mildew detection method based on intelligent image analysis of the present application, referring to Figure 4 , it may specifically include the following content: Step S401: Traverse the multiple valid contours and determine whether the valid contour is smaller than a preset contour area; Step S402: If so, determine the corresponding single-seed grain binary map according to the valid contour; Step S403: If not, determine the corresponding multi-seed grain aggregation area binary map according to the valid contour.

[0080] Optionally, this embodiment applies a seed grain discrimination rule to distinguish the aggregated morphology of seed grains.

[0081] Specifically, traverse the seed grain contours in the binary map and classify them based on the area.

[0082] Identify the area of a single seed grain and the aggregation of multiple seed grains: If the area of the contour is smaller than the set single-seed grain threshold, it is regarded as a single seed grain, and the corresponding mask and contour are generated and stored in ; Otherwise, these contours with larger areas are regarded as areas where multiple seed grains are aggregated, and the corresponding masks are generated. A new This classification helps with subsequent image analysis and processing.

[0083] Through step S403, this embodiment successfully classifies the seeds by morphology, laying a foundation for subsequent segmentation of multi-seed aggregation regions, identification of single-seed morphology, and improvement of seed detection accuracy.

[0084] In one embodiment of the full-automatic seed mildew detection method based on intelligent image analysis of this application, refer to Figure 5 , and it may specifically include the following content: Step S501: Calculate the distance from each pixel point in the binary image of the multi-seed aggregation region to the background to determine the corresponding distance value; Step S502: Determine the corresponding gray value according to the distance value, and determine the corresponding first seed gray image according to the gray value.

[0085] Optionally, in this embodiment, in a binary image, the target region is usually marked as a non-zero value (such as 1), while the background region is marked as a zero value (0). Distance transformation can help us determine the distance from each pixel point in the target region to the nearest background region.

[0086] By calculating the distance from each non-zero pixel to the nearest zero pixel, we can obtain a gray image, where the gray value of each pixel represents this distance. The farther the distance, the lower the gray value (if using the standard Euclidean distance); the closer the distance, the higher the gray value.

[0087] It can be understood that the gray image can help identify the boundaries of the seeds and provide important information for subsequent seed segmentation and mildew region identification.

[0088] Optionally, the distance transformation can adopt the Euclidean distance transformation.

[0089] Optionally, the distance transformation can also adopt the Manhattan distance.

[0090] Optionally, the distance transformation can also adopt the chessboard distance transformation.

[0091] Through step S502, this embodiment successfully determines the gray image of the multi-seed aggregation region, laying a solid foundation for subsequent helping to identify and segment the seeds, and distinguishing the mildew region from the healthy region.

[0092] In one embodiment of the full-automatic seed mildew detection method based on intelligent image analysis of this application, refer to Figure 6 , and it may specifically include the following content: Step S601: Perform a similarity matching operation on the second type of grain grayscale image and the preset template grain grayscale image according to the preset normalized cosine correlation coefficient algorithm to determine the corresponding similar region, where the preset template grain grayscale image is a grayscale image of a single standard grain shape; Step S602: Perform a threshold filtering operation on the similar region according to the preset potential grain threshold to determine the corresponding potential single-grain binary image.

[0093] Optionally, in this embodiment, the purpose of this step is to identify a specific shape (elliptical grain) in the image.

[0094] Specifically, first, create an elliptical template, which represents the target shape we want to find in the image. The template kernel is a small image or mask that contains the features we want to match. In this embodiment, the template can be a standard grain shape (such as an ellipse) or an average shape obtained by processing known grain images.

[0095] Second, perform a distance transformation on the created elliptical template to generate a template grayscale image.

[0096] Then, use the template matching function to search for the region in the second grayscale image obtained after expanding the boundary that is most similar to the template distance map. Among them, the template matching function uses the normalized cosine correlation coefficient method, which screens through similarity metrics to find possible elliptical grain regions in the image. According to the results of the similarity metrics, determine the region that best matches the template. These regions are considered potential grain regions.

[0097] Specifically, after the above steps, set a threshold according to the matching results to distinguish the true grain regions from noise or mis-matched regions. Binarize the matching results according to the threshold to generate a binary image, where the true grain regions are marked as 1 (or white) and other regions are marked as 0 (or black). Finally, we obtain a binary image in which each point above the threshold is regarded as a possible target region, that is, the potential center of the grain.

[0098] Through step S602, in this embodiment, the single-grain contour recognition of the multi-grain aggregation region is successfully obtained, and the potential single-grain binary image is obtained, laying a solid foundation for subsequent grain segmentation.

[0099] In an embodiment of the full-automatic grain mildew detection method based on intelligent image analysis of the present application, see Figure 7 , and it may specifically include the following content: Step S701: Perform a mildew recognition operation on the grain set according to the preset second color threshold to determine the corresponding mildew area; Step S702: Perform a mildew ratio calculation operation based on the mildew area and the total area of the seed set to determine the corresponding seed mildew level.

[0100] Optionally, in this embodiment, in the HSV color space, set the color range of the mildew area, and then calculate the area of the mildew area (the number of pixels AM in the mildew area) and the total seed area (the number of pixels AT in the seed area) respectively. The final mildew ratio Ratio = is calculated.

[0101] This ratio reflects the degree to which the seeds are eroded by mildew and can be used for subsequent quality assessment and grading.

[0102] Through step S702, in this embodiment, mildew detection is successfully performed on the seed set and the mildew quality level is obtained.

[0103] In order to improve the efficiency and accuracy of seed mildew detection based on image processing technology and computer vision algorithms, this application provides an embodiment of an automatic seed mildew detection device based on intelligent image analysis for implementing all or part of the content of the automatic seed mildew detection method based on intelligent image analysis. See Figure 8 The automatic seed mildew detection device based on intelligent image analysis specifically includes the following: A seed binary image determination module 10, configured to obtain a seed image, perform a Gaussian filtering operation on the seed image to determine a corresponding noise-reduced seed image, perform a color space segmentation operation on the noise-reduced seed image according to a preset first color threshold to determine a corresponding seed binary image, and perform a petri dish interference removal operation on the seed binary image according to a set seed petri dish area to determine a corresponding updated seed binary image, where the seed binary image is used to separate the seed surface and the background area; A seed aggregation type binary image determination module 20, configured to perform a boundary enhancement operation on the updated seed binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed binary image, perform a contour detection operation on the enhanced boundary seed binary image according to a preset contour detection algorithm to determine a corresponding plurality of effective contours, and perform a seed morphology division operation on the plurality of effective contours according to a preset discrimination rule to determine a corresponding single-seed binary image and a multi-seed aggregation area binary image; The seed mold level determination module 30 is configured to determine a corresponding first seed grayscale image according to a preset distance transformation algorithm and the multi-seed aggregation region binary image, perform a border addition operation on the first seed grayscale image to determine a corresponding second seed grayscale image, perform a similarity matching operation according to the second seed grayscale image and a preset template seed grayscale image, determine a corresponding potential single-seed binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single-seed binary image, and perform a single-seed segmentation operation on the multi-seed aggregation region binary image according to the single-seed contour obtained after the contour screening operation to determine a corresponding segmented single-seed binary image, merge the segmented single-seed binary image and the single-seed binary image to determine a corresponding seed set, and perform a mold identification operation on the seed set according to a preset second color threshold to determine a corresponding seed mold level.

[0104] As can be seen from the above description, the fully automatic seed mold detection device based on intelligent image analysis provided by the embodiments of the present application can denoise the seed image and perform binarization according to the color space to obtain a seed binary image, remove the interference of the petri dish area in the seed binary image, perform boundary enhancement and contour detection on the updated seed binary image to obtain a single-seed binary image and a multi-seed aggregation region binary image, generate a grayscale image of the multi-seed aggregation region binary image, match the grayscale image with a single-seed standard form grayscale image, and perform contour detection and screening on the similar regions after matching, so as to segment the multi-seed aggregation region binary image into a single-seed combination region binary image, merge the single-seed combination region binary image with the single-seed binary image to obtain a seed set, and perform mold detection on the seed set, thereby being able to improve the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.

[0105] From the hardware level, in order to improve the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms, the embodiments of the present application provide an electronic device for implementing all or part of the content in the fully automatic seed mold detection method based on intelligent image analysis. The electronic device specifically includes the following content: Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the fully automatic seed and grain mildew detection method based on intelligent image analysis and related equipment such as core business systems, user terminals and related databases; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the fully automatic seed and grain mildew detection method based on intelligent image analysis and the embodiment of the fully automatic seed and grain mildew detection method based on intelligent image analysis in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0106] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0107] In practical applications, part of the fully automatic seed mold detection method based on intelligent image analysis can be executed on the electronic device side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0108] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0109] Figure 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0110] In one embodiment, the function of the full-automatic seed grain mildew detection method based on intelligent image analysis can be integrated into the central processing unit 9100. Among them, the central processing unit 9100 can be configured to perform the following controls: Step S101: Obtain a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding noise-reduced seed grain image, perform a color space segmentation operation on the noise-reduced seed grain image according to a preset first color threshold to determine a corresponding seed grain binary image, and perform a culture dish interference removal operation on the seed grain binary image according to a set seed grain culture dish area to determine a corresponding updated seed grain binary image. Among them, the seed grain binary image is used to separate the seed grain surface and the background area; Step S102: Perform a boundary enhancement operation on the updated seed grain binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed grain binary image, perform a contour detection operation on the enhanced boundary seed grain binary image according to a preset contour detection algorithm to determine a corresponding plurality of effective contours, and perform a seed grain morphology division operation on the plurality of effective contours according to a preset discrimination rule to determine a corresponding single seed grain binary image and a multi-seed grain aggregation area binary image; Step S103: Determine a corresponding first seed grain grayscale image according to a preset distance transformation algorithm and the multi-seed grain aggregation area binary image, perform a border addition operation on the first seed grain grayscale image to determine a corresponding second seed grain grayscale image, perform a similarity matching operation according to the second seed grain grayscale image and a preset template seed grain grayscale image, determine a corresponding potential single seed grain binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single seed grain binary image, and perform a single seed grain segmentation operation on the multi-seed grain aggregation area binary image according to the single seed grain contour obtained after the contour screening operation to determine a corresponding segmented single seed grain binary image, merge the segmented single seed grain binary image and the single seed grain binary image to determine a corresponding seed grain set, and perform a mildew identification operation on the seed grain set according to a preset second color threshold to determine a corresponding seed grain mildew level.

[0111] As can be seen from the above description, the electronic device provided in the embodiments of the present application performs noise reduction on the seed grain image and binarizes it according to the color space to obtain a seed grain binary image, removes the interference of the culture dish area in the seed grain binary image, performs boundary enhancement and contour detection on the updated seed grain binary image to obtain a single-seed grain binary image and a multi-seed grain aggregation area binary image, generates a grayscale image of the multi-seed grain aggregation area binary image, matches the grayscale image with the standard shape grayscale image of a single seed grain, and performs contour detection and screening on the similar areas after matching, so as to divide the multi-seed grain aggregation area binary image into a single-seed grain combination area binary image, merge the single-seed grain combination area binary image with the single-seed grain binary image to obtain a seed grain set, and perform mildew detection on the seed grain set, thereby being able to improve the efficiency and accuracy of seed grain mildew detection based on image processing technology and computer vision algorithms.

[0112] In another embodiment, the fully automatic seed grain mildew detection method based on intelligent image analysis can be separately configured from the central processing unit 9100. For example, the fully automatic seed grain mildew detection method based on intelligent image analysis can be configured as a chip connected to the central processing unit 9100, and the functions of the fully automatic seed grain mildew detection method based on intelligent image analysis are realized through the control of the central processing unit.

[0113] As Figure 9 shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It should be noted that the electronic device 9600 does not necessarily have to include Figure 9 all the components shown in Figure 9 ; in addition, the electronic device 9600 may further include

[0114] components not shown in Figure 9 ; reference may be made to the prior art.

[0115] Among them, the memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above information related to failures can be stored, and in addition, programs for executing relevant information can also be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0116] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to supply power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0117] The memory 9140 may be a solid-state memory, for example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that stores information even when power is off, can be selectively erased and has more data, and an example of this memory is sometimes referred to as an EPROM, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 that is used to store application programs and function programs or the processes for operating the electronic device 9600 through the central processing unit 9100.

[0118] The memory 9140 may also include a data storage unit 9143 that is used to store data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the communication functions of the electronic device and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).

[0119] The communication module 9110 is a transmitter / receiver that transmits and receives signals via the antenna 9111. The communication module 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.

[0120] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module 9110 is also coupled to the speaker 9131 and the microphone 9132 via the audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby implementing normal telecommunication functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is also coupled to the central processing unit 9100, so that recording can be performed on the local machine through the microphone 9132 and the sound stored on the local machine can be played through the speaker 9131.

[0121] An embodiment of the present application also provides a computer-readable storage medium capable of implementing all steps of the fully automatic seed grain mildew detection method based on intelligent image analysis with the execution subject being a server or a client in the above embodiments. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, all steps of the fully automatic seed grain mildew detection method based on intelligent image analysis with the execution subject being a server or a client in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented: Step S101: Obtain a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding noise-reduced seed grain image, perform a color space segmentation operation on the noise-reduced seed grain image according to a preset first color threshold to determine a corresponding seed grain binary image, and perform a culture dish interference removal operation on the seed grain binary image according to a set seed grain culture dish area to determine a corresponding updated seed grain binary image, where the seed grain binary image is used to separate the seed grain surface and the background area; Step S102: Perform a boundary enhancement operation on the updated seed grain binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed grain binary image, perform a contour detection operation on the enhanced boundary seed grain binary image according to a preset contour detection algorithm to determine a corresponding plurality of effective contours, and perform a seed grain morphology division operation on the plurality of effective contours according to a preset discrimination rule to determine a corresponding single seed grain binary image and a multi-seed grain aggregation area binary image; Step S103: Determine a corresponding first seed grain grayscale image according to a preset distance transformation algorithm and the multi-seed grain aggregation area binary image, perform a border addition operation on the first seed grain grayscale image to determine a corresponding second seed grain grayscale image, perform a similarity matching operation according to the second seed grain grayscale image and a preset template seed grain grayscale image, determine a corresponding potential single seed grain binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single seed grain binary image, and perform a single seed grain segmentation operation on the multi-seed grain aggregation area binary image according to the single seed grain contour obtained after the contour screening operation to determine a corresponding segmented single seed grain binary image, merge the segmented single seed grain binary image and the single seed grain binary image to determine a corresponding seed grain set, and perform a mildew identification operation on the seed grain set according to a preset second color threshold to determine a corresponding seed grain mildew level.

[0122] As can be seen from the above description, the computer-readable storage medium provided by the embodiments of the present application denoises the seed grain image and performs binarization according to the color space to obtain a seed grain binary map, removes the interference of the culture dish area in the seed grain binary map, performs boundary enhancement and contour detection on the updated seed grain binary map to obtain a single seed grain binary map and a multi-seed grain aggregation area binary map, generates a grayscale image of the multi-seed grain aggregation area binary map, matches the grayscale image with the standard form grayscale image of a single seed grain, and performs contour detection and screening on the similar areas after matching, thereby splitting the multi-seed grain aggregation area binary map into a single seed grain combination area binary map, merging the single seed grain combination area binary map with the single seed grain binary map to obtain a seed grain set, and performing mildew detection on the seed grain set, so that the efficiency and accuracy of seed grain mildew detection can be improved based on image processing technology and computer vision algorithms.

[0123] An embodiment of the present application also provides a computer program product capable of implementing all steps of the fully automatic seed grain mildew detection method based on intelligent image analysis in which the execution subject in the above embodiment is a server or a client. When the computer program / instructions are executed by a processor, the steps of the fully automatic seed grain mildew detection method based on intelligent image analysis are implemented. For example, the computer program / instructions implement the following steps: Step S101: Obtain a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding denoised seed grain map, perform a color space segmentation operation on the denoised seed grain map according to a preset first color threshold to determine a corresponding seed grain binary map, and perform a culture dish interference removal operation on the seed grain binary map according to a set seed grain culture dish area to determine a corresponding updated seed grain binary map, wherein the seed grain binary map is used to separate the seed grain surface and the background area; Step S102: Perform a boundary enhancement operation on the updated seed grain binary map according to a preset morphological algorithm to determine a corresponding enhanced boundary seed grain binary map, perform a contour detection operation on the enhanced boundary seed grain binary map according to a preset contour detection algorithm to determine a corresponding plurality of effective contours, and perform a seed grain morphology division operation on the plurality of effective contours according to a preset discrimination rule to determine a corresponding single seed grain binary map and a multi-seed grain aggregation area binary map; Step S103: Determine the corresponding first type of seed grayscale image according to the preset distance transformation algorithm and the multiple-grain aggregation region binary images. Perform a border addition operation on the first type of seed grayscale image to determine the corresponding second type of seed grayscale image. Perform a similarity matching operation according to the second type of seed grayscale image and the preset template seed grayscale image. According to the matching result obtained after the similarity matching operation, determine the corresponding potential single-seed binary image. Perform a contour screening operation on the potential single-seed binary image, and perform a single-seed segmentation operation on the multiple-grain aggregation region binary images according to the single-seed contour obtained after the contour screening operation to determine the corresponding segmented single-seed binary image. Merge the segmented single-seed binary image and the single-seed binary image to determine the corresponding seed set. Perform a mildew identification operation on the seed set according to the preset second color threshold to determine the corresponding seed mildew level.

[0124] As can be seen from the above description, the computer program product provided by the embodiments of the present application denoises the seed image and binarizes it according to the color space to obtain a seed binary image, removes the interference of the petri dish area in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image to obtain a single-seed binary image and a multiple-grain aggregation region binary image, generates a grayscale image of the multiple-grain aggregation region binary image, matches the grayscale image with the standard single-seed morphology grayscale image, and performs contour detection and screening on the similar regions after matching, so as to segment the multiple-grain aggregation region binary image into a single-seed combination region binary image, merge the single-seed combination region binary image with the single-seed binary image to obtain a seed set, and perform mildew detection on the seed set. Therefore, it can improve the efficiency and accuracy of seed mildew detection based on image processing technology and computer vision algorithms.

[0125] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a device, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can 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 code.

[0126] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (devices), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce a means for implementing the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0127] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0129] Specific embodiments are applied in the present invention to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A fully automatic seed mold detection method based on intelligent image analysis, characterized in that: The method comprises: Acquire a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding denoised seed grain image, perform a color space segmentation operation on the denoised seed grain image according to a preset first color threshold to determine a corresponding seed grain binary image, perform a culture dish interference removal operation on the seed grain binary image according to a set seed grain culture dish area to determine a corresponding updated seed grain binary image, wherein the seed grain binary image is used to separate the seed grain surface and the background area; Performing a boundary enhancement operation on the updated seed grain binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed grain binary image, performing a contour detection operation on the enhanced boundary seed grain binary image according to a preset contour detection algorithm to determine a corresponding plurality of valid contours, performing a seed grain morphology division operation on the plurality of valid contours according to a preset distinction rule to determine a corresponding single seed grain binary image and a plurality of grain aggregation region binary image; According to the preset distance transformation algorithm and the binary image of the multiple grain aggregation area, the corresponding first grain grayscale image is determined, a border adding operation is performed on the first grain grayscale image, the corresponding second grain grayscale image is determined, a similarity matching operation is performed on the second grain grayscale image and the preset template seed grain grayscale image, and according to the matching result obtained after the similarity matching operation, the corresponding potential single grain binary image is determined, a contour screening operation is performed on the potential single grain binary image, and a single grain segmentation operation is performed on the binary image of the multiple grain aggregation area according to the single grain contour obtained after the contour screening operation to determine the corresponding segmented single grain binary image, the segmented single grain binary image and the single grain binary image are merged to determine the corresponding seed grain set, and a mildew recognition operation is performed on the seed grain set according to the preset second color threshold to determine the corresponding seed grain mildew level.

2. The fully automatic seed mold detection method based on intelligent image analysis according to claim 1, characterized in that: Before performing a culture dish interference removal operation on the seed grain binary image according to the set seed grain culture dish area to determine the corresponding updated seed grain binary image, the method includes: Binarizing the seed grain image according to a preset third color threshold to determine a corresponding contour binary map, and performing a contour screening operation on the contour binary map according to a preset contour detection algorithm to determine a corresponding seed grain culture dish contour, wherein the contour binary map includes a seed grain culture dish contour and a seed grain contour; According to a preset polygonal approximation algorithm, polygonal approximation operation and vertex extraction operation are performed on the outline of the seed grain culture dish to determine the corresponding seed grain culture dish polygon vertex coordinates, and according to the maximum and minimum values ​​of the seed grain culture dish polygon vertex coordinates, the corresponding seed grain culture dish area is determined, wherein the seed grain culture dish area includes the seed grain culture dish center coordinates, the seed grain culture dish inner radius and the seed grain culture dish outer radius.

3. The fully automatic seed mildew detection method based on intelligent image analysis according to claim 1, characterized in that: The step of performing a boundary enhancement operation on the updated seed binary image according to a preset morphological algorithm to determine a corresponding enhanced boundary seed binary image includes: Performing a noise removal operation on the updated seed binary image according to a preset corrosion algorithm; A boundary enhancement operation is performed on the updated seed binary image after the noise removal operation according to a preset expansion algorithm to determine a corresponding enhanced boundary seed binary image.

4. The fully automatic seed mildew detection method based on intelligent image analysis according to claim 1, characterized in that: The step of performing a seed grain morphology division operation on the plurality of effective contours according to a preset differentiation rule to determine a corresponding single seed grain binary image and a plurality of grain aggregation region binary image comprises: Traversing the multiple valid contours, and determining whether the valid contour is smaller than a preset contour area; If yes, then determine the corresponding single seed binary image according to the effective contour; If not, the corresponding binary images of the various particle aggregation regions are determined according to the effective contour.

5. The fully automatic seed mold detection method based on intelligent image analysis according to claim 1, characterized in that: The step of determining the corresponding first particle grayscale image according to the preset distance transformation algorithm and the plurality of particle aggregation region binary images comprises: Calculate the distance between each pixel point and the background in the binary image of the plurality of particle aggregation regions to determine the corresponding distance value; A corresponding grayscale value is determined according to the distance value, and a corresponding first particle grayscale image is determined according to the grayscale value.

6. The fully automatic seed mold detection method based on intelligent image analysis according to claim 1, characterized in that: The performing of a similarity matching operation based on the second seed grain grayscale image and the preset template seed grain grayscale image, and determining a corresponding potential single seed grain binary image based on a matching result obtained after the similarity matching operation, comprises: Performing a similarity matching operation on the second seed grain grayscale image and the preset template seed grain grayscale image according to a preset normalized cosine correlation coefficient algorithm to determine a corresponding similar area, wherein the preset template seed grain grayscale image is a grayscale image of a single standard seed grain shape; A threshold filtering operation is performed on the similar area according to a preset potential seed grain threshold to determine a corresponding potential single seed grain binary image.

7. The fully automatic seed mold detection method based on intelligent image analysis according to claim 1, characterized in that: The step of performing a mildew identification operation on the seed grain set according to the preset second color threshold to determine the corresponding seed grain mildew level includes: Performing a mold identification operation on the seed set according to a preset second color threshold to determine a corresponding mold area; A moldy proportion calculation operation is performed according to the moldy area and the total area of ​​the seed grain set to determine the corresponding seed grain moldy grade.

8. A fully automatic seed mold detection device based on intelligent image analysis, characterized in that: The device comprises: A seed grain binary image determination module is used to obtain a seed grain image, perform a Gaussian filtering operation on the seed grain image to determine a corresponding denoised seed grain image, perform a color space segmentation operation on the denoised seed grain image according to a preset first color threshold to determine a corresponding seed grain binary image, perform a culture dish interference removal operation on the seed grain binary image according to a set seed grain culture dish area to determine a corresponding updated seed grain binary image, wherein the seed grain binary image is used to separate the seed grain surface and the background area; a seed grain aggregation type binary image determination module, configured to perform a boundary enhancement operation on the updated seed grain binary image according to a preset morphological algorithm, determine a corresponding enhanced boundary seed grain binary image, perform a contour detection operation on the enhanced boundary seed grain binary image according to a preset contour detection algorithm, determine a corresponding plurality of valid contours, perform seed grain morphology division on the plurality of valid contours according to preset distinction rules, and determine a corresponding single seed grain binary image and a plurality of grain aggregation region binary image; A module for determining the mildew grade of grains is used to determine the corresponding first type of grain grayscale image according to a preset distance transformation algorithm and the binary image of the multiple grain aggregation area, perform a border adding operation on the first type of grain grayscale image, determine the corresponding second type of grain grayscale image, perform a similarity matching operation on the second type of grain grayscale image and the preset template seed grain grayscale image, determine the corresponding potential single type of grain binary image according to the matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single type of grain binary image, and perform a single type of grain segmentation operation on the binary image of the multiple grain aggregation area according to the single type of grain contour obtained after the contour screening operation, determine the corresponding segmented single type of grain binary image, merge the segmented single type of grain binary image and the single type of grain binary image, determine the corresponding seed grain set, perform a mildew identification operation on the seed grain set according to a preset second color threshold, and determine the corresponding seed grain mildew grade.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the fully automatic seed mold detection method based on intelligent image analysis described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the fully automatic seed mold detection method based on intelligent image analysis as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Maize kernel phenotype measuring method and system

    CN106971393A

  • Improved adhesion particle target segmentation method based on concave point matching

    CN110246140A

  • Wheat scab detection method based on multi-angle field high-definition imaging

    CN110736750A

  • Rice grain segmentation method, terminal and storage medium

    CN112150487A

  • Improved ResNet-based wheat imperfect grain online detection method

    CN113869251A