Full-automatic seed kernel sprout detection method and device based on intelligent image analysis
By processing seed images using intelligent image analysis methods, the problems of low efficiency and poor accuracy in traditional manual inspection are solved, achieving efficient and accurate detection of seed mold, which is suitable for modern agriculture and food safety management.
Patent Information
- Application Number
- CN202510536260.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-04-27
AI Technical Summary
Traditional seed mold detection relies on manual observation, which is inefficient, inaccurate, and cannot meet the needs of rapid batch testing. It is also easily affected by subjective factors.
Intelligent image analysis methods are employed, using techniques such as Gaussian filtering, color space segmentation, morphological algorithms, and contour detection to identify and segment seed images, generate single-seed binary images, and perform mold identification.
It improves the efficiency and accuracy of seed mold detection, achieves standardized and objective assessment, and is applicable to modern agriculture and food safety management.
Smart Images

Figure CN120070431B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, specifically to a fully automated method and apparatus for detecting seed mold based on intelligent image analysis. Background Technology
[0002] In modern agricultural production and food safety management, the quality inspection of seeds (such as grains and beans) has always been a crucial step. Mold on the surface of seeds not only affects their germination rate and edible quality but can also pose a threat to human and livestock health. Common mold is caused by fungi, which can proliferate under unfavorable storage conditions and produce toxins harmful to humans, such as aflatoxin. Therefore, ensuring the health and safety of seeds requires an effective method for mold detection.
[0003] Traditionally, the detection of seed mold has relied heavily on manual visual inspection. This method is not only time-consuming and labor-intensive, but also highly susceptible to subjective judgment, leading to misjudgments. This detection approach consumes enormous human and time resources and can produce inconsistent results due to differences in the observer's experience and condition. Furthermore, in large-scale production and distribution environments, manual inspection is often insufficient to meet the demands of rapid, batch testing.
[0004] Therefore, there is an urgent need for an efficient and accurate method for detecting seed mold, 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 of agricultural production and food safety management. Summary of the Invention
[0005] To address the problems in the existing technology, this application provides a fully automated method and apparatus for detecting seed mold based on intelligent image analysis, which can improve the efficiency and accuracy of seed mold 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 solution:
[0007] In a first aspect, this application provides a fully automated method for detecting seed mold based on intelligent image analysis, comprising:
[0008] A seed image is acquired, and a Gaussian filter operation is performed on the seed image to determine the corresponding denoised seed image. A color space segmentation operation is performed on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image. A culture dish interference removal operation is performed on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image. The seed binary image is used to separate the seed surface and the background area.
[0009] The updated seed binary image is subjected to boundary enhancement operation according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary image. The enhanced boundary seed binary image is subjected to contour detection operation according to a preset contour detection algorithm to determine multiple effective contours. The multiple effective contours are subjected to seed morphology division operation according to a preset differentiation rule to determine the corresponding single seed binary image and multi-seed aggregation region binary image.
[0010] Based on a preset distance transformation algorithm and the binary images of the multiple particle aggregation regions, a corresponding first type of particle grayscale image is determined. A border is added to the first type of particle grayscale image to determine a corresponding second type of particle grayscale image. A similarity matching operation is performed between the second type of particle grayscale image and a preset template particle grayscale image. Based on the matching result obtained after the similarity matching operation, a corresponding potential single-type particle binary image is determined. A contour filtering operation is performed on the potential single-type particle binary image, and a single-type particle segmentation operation is performed on the binary images of the multiple particle aggregation regions based on the single-type particle contour obtained after the contour filtering operation. A corresponding segmented single-type particle binary image is determined. The segmented single-type particle binary image and the single-type particle binary image are merged to determine a corresponding particle set. A mold identification operation is performed on the particle set based on a preset second color threshold to determine the corresponding particle mold level.
[0011] Further, before performing a culture dish interference removal operation on the seed culture dish binary image according to the set seed culture dish area and determining the corresponding updated seed culture dish binary image, the process includes:
[0012] The seed image is binarized according to a preset third color threshold to determine the corresponding contour binary image. The contour binary image is then filtered according to a preset contour detection algorithm to determine the corresponding seed culture dish contour. The contour binary image includes the seed culture dish contour and the seed contour.
[0013] The outline of the seed culture dish is approximated and vertex is extracted according to a preset polygon approximation algorithm to determine the corresponding vertex coordinates of the seed culture dish polygon. The corresponding seed culture dish region is determined according to the maximum and minimum values of the vertex coordinates of the seed culture dish polygon. The seed culture dish region includes the center coordinates of the seed culture dish, the inner radius of the seed culture dish, and the outer radius of the seed culture dish.
[0014] Further, the step of performing boundary enhancement operation on the updated seed binary map according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary map includes:
[0015] The updated seed grain binary image is subjected to noise removal operation according to the preset corrosion algorithm;
[0016] According to the preset dilation algorithm, the updated seed binary map after the noise removal operation is subjected to boundary enhancement operation to determine the corresponding enhanced boundary seed binary map.
[0017] Further, the step of performing seed morphology segmentation on the multiple valid contours according to preset differentiation rules to determine the corresponding single-seed binary image and multi-seed aggregation region binary image includes:
[0018] Traverse the multiple valid contours and determine whether the area of each valid contour is smaller than the area of a preset contour.
[0019] If so, then determine the corresponding binary image of a single grain based on the effective contour;
[0020] If not, then determine the corresponding binary map of multiple particle aggregation regions based on the effective contour.
[0021] Further, determining the corresponding first type of particle grayscale image based on the preset distance transformation algorithm and the binary images of the various particle aggregation regions includes:
[0022] The distance from each pixel in the binary image of the various particle aggregation regions to the background is calculated to determine the corresponding distance value.
[0023] The corresponding grayscale value is determined based on the distance value, and the corresponding first type of grain grayscale image is determined based on the grayscale value.
[0024] Further, the step of performing a similarity matching operation based on the second type of grain grayscale image and the preset template grain grayscale image, and determining the corresponding potential single-grain binary image based on the matching result obtained after the similarity matching operation, includes:
[0025] The grayscale image of the second type of grain and the grayscale image of the preset template grain are similarly matched according to the preset normalized cosine correlation coefficient algorithm to determine the corresponding similar regions. The grayscale image of the preset template grain is a grayscale image of a single standard grain shape.
[0026] Based on a preset potential seed threshold, a threshold filtering operation is performed on the similar regions to determine the corresponding potential single seed binary map.
[0027] Further, the step of performing mold identification on the seed set according to a preset second color threshold to determine the corresponding seed mold level includes:
[0028] The seed set is subjected to mold identification operation according to a preset second color threshold to determine the corresponding mold area;
[0029] The mold rate is calculated based on the moldy area and the total area of the seed set to determine the corresponding seed mold level.
[0030] Secondly, this application provides a fully automated seed mold detection device based on intelligent image analysis, comprising:
[0031] The seed binary image determination module is used to acquire a seed image, perform a Gaussian filtering operation on the seed image to determine the corresponding denoised seed image, perform a color space segmentation operation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, and perform a culture dish interference removal operation on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image. The seed binary image is used to separate the seed surface and the background area.
[0032] The seed aggregation type binary map determination module is used to perform boundary enhancement operation on the updated seed binary map according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary map, perform contour detection operation on the enhanced boundary seed binary map according to a preset contour detection algorithm to determine multiple corresponding effective contours, and perform seed morphology division on the multiple effective contours according to a preset differentiation rule to determine the corresponding single seed binary map and multi-seed aggregation region binary map.
[0033] The seed mold level determination module is used to determine the corresponding first type of grain grayscale image based on a preset distance transformation algorithm and the binary image of the multi-grain aggregation region; add a border to the first type of grain grayscale image to determine the corresponding second type of grain grayscale image; perform a similarity matching operation between the second type of grain grayscale image and a preset template grain grayscale image; determine the corresponding potential single-grain binary image based on the matching result obtained after the similarity matching operation; perform a contour filtering operation on the potential single-grain binary image; perform a single-grain segmentation operation on the multi-grain aggregation region binary image based on the single-grain contour obtained after the contour filtering operation; determine the corresponding segmented single-grain binary image; merge the segmented single-grain binary image and the single-grain binary image to determine the corresponding seed set; and perform a mold identification operation on the seed set based on a preset second color threshold to determine the corresponding seed mold level.
[0034] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the fully automated seed mold detection method based on intelligent image analysis.
[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the fully automated seed mold detection method based on intelligent image analysis.
[0036] Fifthly, this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the fully automated seed mold detection method based on intelligent image analysis.
[0037] As can be seen from the above technical solution, this application provides a fully automatic seed mold detection method and device based on intelligent image analysis. By denoising the seed image and binarizing it according to the color space, a seed binary image is obtained. Interference from the petri dish region in the seed binary image is removed. Boundary enhancement and contour detection are performed on the updated seed binary image to obtain a single seed binary image and a multi-seed aggregation region binary image. A grayscale image of the multi-seed aggregation region binary image is generated. This grayscale image is matched with a single seed standard morphology grayscale image, and contour detection and filtering are performed on the matched similar regions. This divides the multi-seed aggregation region binary image into a single seed combination region binary image. The single seed combination region binary image is merged with the single seed binary image to obtain a seed set. Mold detection is then performed on the seed set. This improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is one of the flowcharts of the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application;
[0040] Figure 2 This is the second flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0041] Figure 3 This is the third flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0042] Figure 4 This is the fourth flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0043] Figure 5 This is the fifth flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0044] Figure 6This is the sixth flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0045] Figure 7 This is the seventh flowchart illustrating the fully automated seed mold detection method based on intelligent image analysis in the embodiments of this application.
[0046] Figure 8 This is a structural diagram of the fully automated seed mold detection device based on intelligent image analysis in the embodiments of this application;
[0047] Figure 9 This is a schematic diagram of the structure of the electronic device in the embodiments of this application.
[0048] Figure label:
[0049] 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 storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0052] Considering the limitations of traditional manual methods for detecting seed mold, which are insufficient for rapid batch detection, this application provides a fully automated seed mold detection method and apparatus based on intelligent image analysis. The method involves denoising the seed image and binarizing it according to the color space to obtain a seed binary image. Interference from the petri dish region is removed from the seed binary image. Boundary enhancement and contour detection are then performed on the updated seed binary image to obtain a single seed binary image and a multi-seed aggregation region binary image. A grayscale image of the multi-seed aggregation region binary image is generated. This grayscale image is matched with a standard single-seed seed morphology grayscale image, and contour detection and filtering are performed on the matched similar regions. This segmentation of the multi-seed aggregation region binary image into a single-seed seed combination region binary image is then performed. The single-seed seed combination region binary image is merged with the single-seed seed binary image to obtain a seed set. Mold detection is then performed on the seed set. This approach improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.
[0053] To improve the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms, this application provides an embodiment of a fully automated seed mold detection method based on intelligent image analysis. See [link to embodiment]. Figure 1 The fully automated seed mold detection method based on intelligent image analysis specifically includes the following:
[0054] Step S101: Obtain a seed image, perform Gaussian filtering on the seed image to determine the corresponding denoised seed image, perform color space segmentation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, perform culture dish interference removal on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image, wherein the seed binary image is used to separate the seed surface and the background area;
[0055] Optionally, in this embodiment, the purpose of this step is to preprocess the acquired seed image, including noise reduction and interference removal, to form a seed binarized image.
[0056] Optionally, during preprocessing, a Gaussian filter G(x, y) is used to eliminate environmental noise and background interference, making the characteristics of the seeds in the image more prominent. The specific formula for G(x, y) is as follows:
[0057]
[0058] Gaussian filtering eliminates environmental noise and background interference, making the characteristics of the seeds more prominent and improving the accuracy of image analysis.
[0059] Optionally, the image color space is then converted to HSV (Hue, Saturation, Lightness) space. This color conversion helps distinguish seed grains from the background by color and facilitates subsequent color space segmentation operations. The threshold range is set to [...]. ]and[ This process creates a binary image mask in the HSV color space, effectively separating the seed surface from the background area.
[0060] Specifically, based on the set HSV threshold range, pixels in the image are classified into two categories:
[0061] Target region: Pixels that meet the set threshold range are marked as 1, indicating that they belong to the seed region.
[0062] Background area: Pixels that do not meet the threshold range are marked as 0, indicating that they belong to the background.
[0063] By setting an appropriate HSV threshold range, seed grains and background areas can be effectively distinguished, generating a binary image mask. This mask becomes the basis for subsequent analysis and processing. For example, it can remove background interference, reduce noise, and ensure accurate identification of seed grains and moldy areas.
[0064] Optionally, when identifying the seed culture, the glass wall of the petri dish may reflect the color of the seed surface. This could cause some petri dishes to adhere to the seed when separating the seed from the background using HSV, thus affecting the subsequent calculation of the mold rate. 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 inner and outer radii.
[0065] Specifically, first, the initial image is converted to the HSV color space and binarized according to a specified color range to create an initial mask. The binary image created within this color range contains the seed outline and the seed culture dish outline.
[0066] Next, OpenCV's contour detection function is used to detect all contours in the image and sort them by area from largest to smallest, removing smaller, noisy contours. Understandably, the petri dish area is larger than the seed grain area; removing smaller contours yields the petri dish contour.
[0067] For the selected valid outlines (i.e., the petri dish outlines), calculate their polygonal approximation and extract the coordinates of all vertices. Find the minimum and maximum values of the coordinates to calculate the center coordinates and outer radius of the petri dish. Finally, calculate the inner radius through simple adjustments.
[0068] With this data, by using the center point coordinates, inner radius, and outer radius, interference in the culture dish area can be removed based on the initial mask, resulting in a new binary image mask mask1. This image mask mask1 only includes the correct seed outline, ensuring the accuracy of subsequent analysis.
[0069] Step S102: Perform boundary enhancement operation on the updated seed binary map according to the preset morphological algorithm to determine the corresponding enhanced boundary seed binary map; perform contour detection operation on the enhanced boundary seed binary map according to the preset contour detection algorithm to determine the corresponding multiple effective contours; perform seed morphology division operation on the multiple effective contours according to the preset differentiation rules to determine the corresponding single seed binary map and multiple seed aggregation region binary map.
[0070] Optionally, in this embodiment, the purpose of this step is to perform morphological processing and contour detection on the binarized image mask mask1 to distinguish between the contours of a single seed grain and the contours of multiple grain aggregation regions.
[0071] Optionally, in this embodiment, a boundary enhancement operation is performed on the updated seed binary map according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary map.
[0072] Specifically, the boundaries of the seed grains are enhanced using a new binarized image mask1 through morphological operations. Morphological erosion and dilation are defined by the following formulas:
[0073] corrosion: ,
[0074] This formula indicates that image A is eroded using convolution template B. By convolving template B with image A, the minimum pixel value of the area covered by B is obtained, and this minimum value is used to replace the pixel value of the reference point. Erosion helps remove tiny noise points in an image.
[0075] Expansion: ,
[0076] This formula describes the process of dilating image A using a convolution kernel B, which can be square or circular. By convolving image A with template B, the maximum pixel value within the area covered by B is calculated, and this value replaces the pixel value of the reference point, thus achieving image dilation. Dilation helps to enhance salient boundaries in an image.
[0077] The combination of these morphological operations (i.e., erosion and dilation) is intended to effectively remove small noise in the image and significantly improve the clarity of the seed grain boundaries, thereby facilitating subsequent accurate contour detection and generating an improved binarized image mask2.
[0078] Optionally, in this embodiment, a contour detection operation is performed on the enhanced boundary seed binary map according to a preset contour detection algorithm to determine multiple corresponding valid contours.
[0079] Specifically, OpenCV's contour detection function is used to detect contours in the binary image mask2 of the seed grains. The detected contours are then sorted in descending order of area. Next, all contours are iterated over, and noisy contours with areas smaller than a set threshold are filled with 0 to clean up the target area. Contour detection can identify seed grain boundaries, providing more accurate seed grain regions and facilitating subsequent identification of moldy areas.
[0080] Optionally, in this embodiment, the seed morphology is divided into multiple effective contours according to a preset differentiation rule to determine the corresponding single seed binary image and multiple seed aggregation region binary image.
[0081] Specifically, continue traversing the preserved outlines and classify them based on area.
[0082] The purpose of this process is to identify regions with single seed grains and aggregates of multiple grains: if the area of the contour is smaller than a set threshold for a single seed grain, it is considered a single seed grain, and a corresponding mask and contour are generated and stored. Otherwise, these larger contour areas will be treated as regions where multiple seed grains aggregate, and corresponding masks will be generated. New seed grains will then be synthesized from these large-area masks. This classification is helpful for subsequent image analysis and processing.
[0083] Step S103: Based on the preset distance transformation algorithm and the binary image of the multi-particle aggregation region, determine the corresponding first type of particle grayscale image, add a border to the first type of particle grayscale image, determine the corresponding second type of particle grayscale image, perform a similarity matching operation between the second type of particle grayscale image and the preset template particle grayscale image, determine the corresponding potential single-particle binary image based on the matching result obtained after the similarity matching operation, perform a contour filtering operation on the potential single-particle binary image, and perform a single-particle segmentation operation on the multi-particle aggregation region binary image based on the single-particle contour obtained after the contour filtering operation, determine the corresponding segmented single-particle binary image, merge the segmented single-particle binary image and the single-particle binary image to determine the corresponding particle set, and perform a mold identification operation on the particle set based on the preset second color threshold to determine the corresponding particle mold level.
[0084] Optionally, in this embodiment, the purpose of this step is to target the regions of multi-particle polymerization. Seed segmentation is performed to obtain single seed combination regions, which are then compared with the single seed set in step S102. The seeds are merged to obtain the updated seed set.
[0085] Optionally, in this embodiment, an elliptical structuring element is first created, and this structuring element is used to process the input image. Perform morphological closing operations. Closing operations help eliminate noise and fill in small internal holes, making the seed regions in the image more complete and coherent.
[0086] Next, the distance from each non-zero pixel in the image to its nearest zero pixel is calculated. The distance transformation results in a grayscale image representing the distance of each pixel to the background. To avoid edge artifacts affecting subsequent calculations, a bounding box of a certain size is added to the distance-transformed image. This boundary expansion operation is particularly important when matching specific structures or shapes, ensuring that the template matching process is not inaccurate due to proximity to the boundary.
[0087] Understandably, adding a border can simulate pixels outside the image edges, reducing edge artifacts. In terms of effectiveness, expanding the image boundary ensures that even if 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 portions of an image may become unstable due to various reasons (such as changes in lighting, noise, etc.). Adding a border can simulate the environment outside the image edges to some extent, improving the algorithm's robustness to these unstable factors.
[0088] Next, an elliptical template kernel is created. This template can be a standard seed shape (such as an ellipse) or an average shape obtained by processing a known seed image. The template is then grayscaled using the same distance transformation mode to generate a distance-transformed grayscale image of the template. A template matching function is used to search for the region in the expanded distance image that is most similar to the prepared template. The template matching process uses the normalized cosine correlation coefficient method, which filters for possible elliptical seed regions in the image based on similarity metrics.
[0089] Next, after identifying similar regions, the matching results are binarized by setting a threshold filter, generating a binary map representing the potential seed centers in the image. Every point above the threshold is considered a possible target region. All contour lines are identified on the generated binary map and used as possible seed boundaries. However, not all identified contours match our expectations for seed regions. To eliminate false detections and noise, the contours are traversed, and the area of their boundary rectangles is calculated. Any contour smaller than a given threshold is considered irrelevant noise and is removed by filling it with black. This process ensures that the output contour set truly represents the possible combinations of seed regions.
[0090] Finally, the processed and screened seed set and the single seed set from step S102 are combined. The seeds are merged to obtain the updated seed set.
[0091] Optionally, in this embodiment, for each seed in the aforementioned seed set, a color threshold-based method is used to segment the moldy region. The color range of the moldy region is set in the HSV color space, and then the area of the moldy region (number of pixels in the moldy region AM) and the total seed area (number of pixels in the seed region AT) are calculated respectively. The final mold ratio Ratio = The calculation yielded the result.
[0092] This ratio reflects the degree to which the seeds have been damaged by mold and can be used for subsequent quality assessment and grading.
[0093] This example demonstrates how this embodiment uses image processing technology and computer vision algorithms to detect seeds and identify moldy areas.
[0094] As described above, the fully automated seed mold detection method based on intelligent image analysis provided in this application can obtain a seed binary image by denoising the seed image and binarizing it according to the color space. It removes interference from the petri dish region in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image, and obtains a single seed binary image and a multi-seed aggregation region binary image. A grayscale image of the multi-seed aggregation region binary image is generated, and this grayscale image is matched with a single seed standard morphology grayscale image. Contour detection and filtering are performed on the matched similar regions to segment the multi-seed aggregation region binary image into a single seed combination region binary image. The single seed combination region binary image is then merged with the single seed binary image to obtain a seed set, and mold detection is performed on the seed set. This improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.
[0095] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 2 It can also specifically include the following:
[0096] Step S201: Binarize the seed image according to a preset third color threshold to determine the corresponding contour binary image; perform contour filtering on the contour binary image according to a preset contour detection algorithm to determine the corresponding seed culture dish contour; wherein the contour binary image includes the seed culture dish contour and the seed contour.
[0097] Step S202: Perform polygon approximation and vertex extraction operations on the outline of the seed culture dish according to the preset polygon approximation algorithm to determine the corresponding vertex coordinates of the seed culture dish polygon. Based on the maximum and minimum values of the vertex coordinates of the seed culture dish polygon, determine the corresponding seed culture dish region, wherein the seed culture dish region includes the center coordinates of the seed culture dish, the inner radius of the seed culture dish, and the outer radius of the seed culture dish.
[0098] Optionally, in this embodiment, when performing seed image analysis, interference from the petri dish may affect the detection of the seed and the calculation of the mold rate, especially when the glass surface of the petri dish reflects the color of the seed surface, it is easy to mistakenly take it as part of the seed. This step is to eliminate interference from the glass wall of the petri dish.
[0099] Optionally, the technique for eliminating interference in this step is to use image processing technology to calculate the morphology of the petri dish and remove interference from the petri dish area based on the initial mask.
[0100] First, the original image is converted to the HSV (Hue, Saturation, Brightness) color space. The HSV color space can better distinguish between seeds and background, especially by differentiating the seed surface and the glass area of the culture dish through hue values. In this space, by setting appropriate thresholds for hue, saturation, and brightness, seeds can be effectively separated from the background, while the areas of the culture dish can be identified.
[0101] Secondly, OpenCV's contour detection function is used to find all contours in the image. Contours are the boundaries of objects in an image, and they can be used to detect the boundaries of the seed grains and the culture dish. The contour detection results are sorted by area, from largest to smallest. Because the culture dish is usually large while the seed grains are relatively small, smaller noise contours (seed grain contours) can be eliminated by area size, thus obtaining the target contour, i.e., the contour of the culture dish.
[0102] Then, a polygon approximation (cv2.approxPolyDP()) is applied to the filtered target contour to simplify it into a polygonal form. This polygon approximation effectively obtains the vertex coordinates of the contour. After extracting these vertex coordinates, the minimum and maximum values are found, allowing the calculation of the circumscribed rectangle of the petri dish, further determining the center coordinates and outer radius of the petri dish. Based on the known outer radius, the inner radius of the petri dish is calculated through simple adjustments or based on the known relationship between the inner and outer radii.
[0103] Understandably, by using the calculated center coordinates, inner radius, and outer radius, a region is generated on the initial mask of the image to remove interfering areas related to the petri dish. This ensures that subsequent analyses (such as seed detection and mold rate calculation) are not affected by the petri dish area.
[0104] For example, suppose we have an image of seed culture containing multiple seeds distributed in a petri dish. However, due to the light reflected from the glass of the petri dish, the seeds may appear to be attached to the dish surface in the image. We need to remove this interference from the petri dish using the steps described above. The specific process is as follows:
[0105] Convert to HSV color space:
[0106] Assuming the seed grains in the image are yellow, while the glass of the petri dish is a transparent blue, we can effectively separate the seed grain area from the background by setting the HSV range of yellow (e.g., hue 30-40, saturation 50-255, brightness 50-255).
[0107] Contour detection:
[0108] After using cv2.findContours() to detect all contours in the image, we found one large contour (i.e., the glass area of the petri dish) and several small contours (seeds). We sorted them by area from largest to smallest, removed the smaller contours, and kept only the larger contours, which represent the area of the petri dish.
[0109] Polygon approximation and vertex extraction:
[0110] The outline of the petri dish is approximated by a polygon to obtain its vertex coordinates. The minimum and maximum values are then calculated to obtain the boundary of the circumscribed rectangle.
[0111] Calculate geometric parameters:
[0112] Based on the vertex coordinates, the outer and inner radii of the petri dish are calculated, and then the center coordinates are obtained.
[0113] Remove interference:
[0114] Finally, using the calculated center coordinates and radius, a new mask is generated to remove the petri dish area from the image, leaving only the pure seed area, ensuring the accuracy of subsequent analysis.
[0115] Through step S202, this embodiment obtains the seed culture dish area, laying the foundation for subsequent accurate seed mold statistics by eliminating interference from the culture dish glass.
[0116] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 3 It can also specifically include the following:
[0117] Step S301: Perform noise removal operation on the updated seed grain binary image according to the preset erosion algorithm;
[0118] Step S302: Perform boundary enhancement operation on the updated seed binary map after the noise removal operation according to the preset dilation algorithm, and determine the corresponding enhanced boundary seed binary map.
[0119] Optionally, in this embodiment, this step involves performing morphological processing on the preprocessed binary image of the seed grains to remove small noises from the image.
[0120] Specifically, morphological erosion first requires selecting a structuring element (usually a small rectangle or circle). This structuring element defines the "neighborhood" for the erosion operation. For each pixel in the image, it is compared to the structuring element. If the values of all pixels within the structuring element are greater than or equal to the value of the center pixel (usually 1 for binary images), the pixel's value is retained; otherwise, the pixel's value is set to 0 (for binary images, this means it becomes the background). This process is repeated across the entire image until all pixels have been processed.
[0121] Understandably, erosion removes small noise points in an image because these points are typically surrounded by larger target areas and are thus removed during the erosion process. Simultaneously, the target boundaries are also reduced in size due to erosion.
[0122] Specifically, morphological dilation, similarly, requires selecting a structuring element. For each pixel in the image, it is compared to the structuring element. If the value of any pixel within the structuring element is greater than the value of the center pixel (for binary images, this means there is a pixel with a value of 1 within the structuring element), then the value of the center pixel is set to 1 (for binary images, this means it becomes the target). This process is repeated across the entire image until all pixels have been processed.
[0123] Understandably, dilation enhances the boundaries of objects in an image because it expands the target area outward, fills small internal holes, and makes the connections between objects tighter.
[0124] Optionally, in this embodiment, the erosion operation is performed first, followed by the expansion operation. This helps to remove small noise points while maintaining the basic shape of the target.
[0125] Through step S302, this embodiment realizes the enhancement processing of the preprocessed binarized image, laying the foundation for accurate identification of seed morphology in the future.
[0126] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 4 It can also specifically include the following:
[0127] Step S401: Traverse the multiple valid contours and determine whether the valid contour area is smaller than the preset contour area;
[0128] Step S402: If so, determine the corresponding single-particle binary image based on the effective contour;
[0129] Step S403: If not, determine the corresponding binary map of multiple particle aggregation regions based on the effective contour.
[0130] Optionally, this embodiment applies seed-grain differentiation rules to distinguish seed-grain aggregation morphologies.
[0131] Specifically, the seed outlines in the binary graph are traversed and classified based on area.
[0132] Identifying regions with single seed grains and aggregates of multiple grains: If the area of the contour is smaller than a set threshold for a single seed grain, it is considered a single seed grain, and a corresponding mask and contour are generated and stored. middle;
[0133] Otherwise, these larger contour areas would be treated as regions where multiple seed grains aggregate, generating corresponding masks, from which new [seed grains] would be synthesized. This classification is helpful for subsequent image analysis and processing.
[0134] Through step S403, this embodiment successfully classifies seeds by morphology, laying the foundation for subsequent segmentation of multiple seed aggregation regions, identification of individual seed morphology, and improvement of seed detection accuracy.
[0135] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 5 It can also specifically include the following:
[0136] Step S501: Calculate the distance from each pixel in the binary image of the multi-particle aggregation region to the background, and determine the corresponding distance value;
[0137] Step S502: Determine the corresponding gray value based on the distance value, and determine the corresponding first type of grain grayscale image based on the gray value.
[0138] Optionally, in this embodiment, in the binary image, the target region is typically marked with a non-zero value (e.g., 1), while the background region is marked with a zero value (0). Distance transformation can help us determine the distance of each pixel in the target region to the nearest background region.
[0139] By calculating the distance from each non-zero pixel to the nearest zero pixel, we can obtain a grayscale image, where the grayscale value of each pixel represents that distance. The greater the distance, the lower the grayscale value (if using standard Euclidean distance); the closer the distance, the higher the grayscale value.
[0140] Understandably, grayscale images can help identify seed boundaries and provide important information for subsequent seed segmentation and identification of moldy areas.
[0141] Optionally, the distance transformation can be performed using Euclidean distance transformation.
[0142] Optionally, the distance transformation can also use Manhattan distance.
[0143] Optionally, the distance transformation can also use chessboard distance transformation.
[0144] Through step S502, this embodiment successfully determined the grayscale images of various particle aggregation regions, laying a solid foundation for subsequent identification and segmentation of seed particles, as well as for distinguishing between moldy and healthy regions.
[0145] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 6 It can also specifically include the following:
[0146] 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 regions, wherein the preset template grain grayscale image is a grayscale image of a single standard grain shape;
[0147] Step S602: Perform threshold filtering on the similar regions according to the preset potential seed threshold to determine the corresponding potential single seed binary map.
[0148] Optionally, in this embodiment, the purpose of this step is to identify a specific shape (elliptical seed) in the image.
[0149] Specifically, first, an elliptical template is created, representing 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 seed shape (such as an ellipse) or an average shape obtained by processing a known seed image.
[0150] Secondly, a distance transformation is performed on the created elliptical template to generate a grayscale image of the template.
[0151] Then, a template matching function is used to search for the region most similar to the template distance map in the second grayscale image obtained after expanding the boundaries. The template matching function uses the normalized cosine correlation coefficient method, which filters by similarity metric to find possible elliptical seed regions in the image. Based on the similarity metric results, the region that best matches the template is determined. These regions are considered potential seed regions.
[0152] Specifically, after the above steps, a threshold is set based on the matching results to distinguish between true seed regions and noise or mismatched regions. The matching results are binarized according to the threshold to generate a binary image, where true seed regions are marked as 1 (or white), and other regions are marked as 0 (or black). Finally, we obtain a binary map where each point above the threshold is considered a possible target region, i.e., a potential seed center.
[0153] Through step S602, this embodiment successfully obtained single-grain contour recognition for multiple grain aggregation regions and obtained a binary map of potential single grains, laying a solid foundation for subsequent grain segmentation.
[0154] In one embodiment of the fully automated seed mold detection method based on intelligent image analysis of this application, see [link to relevant documentation]. Figure 7 It can also specifically include the following:
[0155] Step S701: Perform mold identification operation on the seed set according to the preset second color threshold to determine the corresponding mold area;
[0156] Step S702: Calculate the mold ratio based on the moldy area and the total area of the seed set to determine the corresponding seed mold level.
[0157] Optionally, in this embodiment, the color range of the moldy area is set in the HSV color space, and then the area of the moldy area (number of pixels in the moldy area AM) and the total seed area (number of pixels in the seed area AT) are calculated respectively. The final mold ratio Ratio = The calculation yielded the result.
[0158] This ratio reflects the degree to which the seeds have been damaged by mold and can be used for subsequent quality assessment and grading.
[0159] Through step S702, this embodiment successfully detected mold growth based on the seed set and obtained the mold growth quality grade.
[0160] To improve the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms, this application provides an embodiment of a fully automated seed mold detection device based on intelligent image analysis for implementing all or part of the aforementioned fully automated seed mold detection method based on intelligent image analysis. See [link to embodiment]. Figure 8 The fully automated seed mold detection device based on intelligent image analysis specifically includes the following components:
[0161] The seed binary image determination module 10 is used to acquire a seed image, perform a Gaussian filtering operation on the seed image to determine the corresponding denoised seed image, perform a color space segmentation operation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, and perform a culture dish interference removal operation on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image. The seed binary image is used to separate the seed surface and the background area.
[0162] The seed aggregation type binary map determination module 20 is used to perform boundary enhancement operation on the updated seed binary map according to a preset morphological algorithm to determine the corresponding enhanced boundary seed binary map, perform contour detection operation on the enhanced boundary seed binary map according to a preset contour detection algorithm to determine multiple corresponding valid contours, and perform seed morphology division operation on the multiple valid contours according to a preset differentiation rule to determine the corresponding single seed binary map and multiple seed aggregation region binary map;
[0163] The seed mold level determination module 30 is used to determine the corresponding first type of grain grayscale image based on a preset distance transformation algorithm and the binary image of the multi-grain aggregation region; add a border to the first type of grain grayscale image to determine the corresponding second type of grain grayscale image; perform a similarity matching operation between the second type of grain grayscale image and a preset template grain grayscale image; determine the corresponding potential single-grain binary image based on the matching result obtained after the similarity matching operation; perform a contour filtering operation on the potential single-grain binary image; perform a single-grain segmentation operation on the multi-grain aggregation region binary image based on the single-grain contour obtained after the contour filtering operation; determine the corresponding segmented single-grain binary image; merge the segmented single-grain binary image and the single-grain binary image to determine the corresponding seed set; and perform a mold identification operation on the seed set based on a preset second color threshold to determine the corresponding seed mold level.
[0164] As described above, the fully automated seed mold detection device based on intelligent image analysis provided in this application can obtain a seed binary image by denoising the seed image and binarizing it according to the color space. It removes interference from the petri dish region in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image, and obtains a single seed binary image and a multi-seed aggregation region binary image. It generates a grayscale image of the multi-seed aggregation region binary image, matches this grayscale image with a single seed standard morphology grayscale image, and performs contour detection and filtering on the matched similar regions. This divides the multi-seed aggregation region binary image into a single seed combination region binary image. The single seed combination region binary image is then merged with the single seed binary image to obtain a seed set, which is then used for mold detection. This improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.
[0165] From a hardware perspective, in order to improve the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms, this application provides an embodiment of an electronic device for implementing all or part of the aforementioned fully automated seed mold detection method based on intelligent image analysis. The electronic device specifically includes the following components:
[0166] The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between the fully automated seed mold detection method based on intelligent image analysis and core business systems, user terminals, and related databases and other related devices; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the fully automated seed mold detection method based on intelligent image analysis in the present embodiment, and the contents of the embodiments of the fully automated seed mold detection method based on intelligent image analysis are incorporated herein, and repeated details will not be described again.
[0167] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.
[0168] In practical applications, parts of the fully automated 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 choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed in the client device, the client device may further include a processor.
[0169] The aforementioned 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; in other implementation scenarios, it 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, a server cluster consisting of multiple servers, or a distributed server structure.
[0170] Figure 9 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 9 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 9 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0171] In one embodiment, the fully automated seed mold detection method based on intelligent image analysis can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:
[0172] Step S101: Obtain a seed image, perform Gaussian filtering on the seed image to determine the corresponding denoised seed image, perform color space segmentation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, perform culture dish interference removal on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image, wherein the seed binary image is used to separate the seed surface and the background area;
[0173] Step S102: Perform boundary enhancement operation on the updated seed binary map according to the preset morphological algorithm to determine the corresponding enhanced boundary seed binary map; perform contour detection operation on the enhanced boundary seed binary map according to the preset contour detection algorithm to determine the corresponding multiple effective contours; perform seed morphology division operation on the multiple effective contours according to the preset differentiation rules to determine the corresponding single seed binary map and multiple seed aggregation region binary map.
[0174] Step S103: Based on the preset distance transformation algorithm and the binary image of the multi-particle aggregation region, determine the corresponding first type of particle grayscale image, add a border to the first type of particle grayscale image, determine the corresponding second type of particle grayscale image, perform a similarity matching operation between the second type of particle grayscale image and the preset template particle grayscale image, determine the corresponding potential single-particle binary image based on the matching result obtained after the similarity matching operation, perform a contour filtering operation on the potential single-particle binary image, and perform a single-particle segmentation operation on the multi-particle aggregation region binary image based on the single-particle contour obtained after the contour filtering operation, determine the corresponding segmented single-particle binary image, merge the segmented single-particle binary image and the single-particle binary image to determine the corresponding particle set, and perform a mold identification operation on the particle set based on the preset second color threshold to determine the corresponding particle mold level.
[0175] As described above, the electronic device provided in this application embodiment obtains a seed binary image by denoising the seed image and binarizing it according to the color space. It removes interference from the petri dish region in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image, and obtains a single seed binary image and a multi-seed aggregation region binary image. It generates a grayscale image of the multi-seed aggregation region binary image, matches this grayscale image with a single seed standard morphology grayscale image, and performs contour detection and filtering on the matched similar regions. This divides the multi-seed aggregation region binary image into a single seed combination region binary image. The single seed combination region binary image is then merged with the single seed binary image to obtain a seed set. Mold detection is then performed on the seed set. This improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.
[0176] In another embodiment, the fully automated seed mold detection method based on intelligent image analysis can be configured separately from the central processing unit 9100. For example, the fully automated seed mold detection method based on intelligent image analysis can be configured as a chip connected to the central processing unit 9100, and the function of the fully automated seed mold detection method based on intelligent image analysis can be realized through the control of the central processing unit.
[0177] like Figure 9 As 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 is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 9 All components shown; in addition, the electronic device 9600 may also include Figure 9 For components not shown, please refer to existing technologies.
[0178] like Figure 9 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.
[0179] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.
[0180] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0181] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can 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 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.
[0182] The memory 9140 may also include a data storage unit 9143 for storing 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 electronic device for communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0183] The communication module 9110 is a transmitter / receiver that sends 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 is the same as in a conventional mobile communication terminal.
[0184] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 9130 is also coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.
[0185] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the fully automated seed mold detection method based on intelligent image analysis, where the execution subject is a server or client, as described in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the fully automated seed mold detection method based on intelligent image analysis, where the execution subject is a server or client, as described in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:
[0186] Step S101: Obtain a seed image, perform Gaussian filtering on the seed image to determine the corresponding denoised seed image, perform color space segmentation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, perform culture dish interference removal on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image, wherein the seed binary image is used to separate the seed surface and the background area;
[0187] Step S102: Perform boundary enhancement operation on the updated seed binary map according to the preset morphological algorithm to determine the corresponding enhanced boundary seed binary map; perform contour detection operation on the enhanced boundary seed binary map according to the preset contour detection algorithm to determine the corresponding multiple effective contours; perform seed morphology division operation on the multiple effective contours according to the preset differentiation rules to determine the corresponding single seed binary map and multiple seed aggregation region binary map.
[0188] Step S103: Based on the preset distance transformation algorithm and the binary image of the multi-particle aggregation region, determine the corresponding first type of particle grayscale image, add a border to the first type of particle grayscale image, determine the corresponding second type of particle grayscale image, perform a similarity matching operation between the second type of particle grayscale image and the preset template particle grayscale image, determine the corresponding potential single-particle binary image based on the matching result obtained after the similarity matching operation, perform a contour filtering operation on the potential single-particle binary image, and perform a single-particle segmentation operation on the multi-particle aggregation region binary image based on the single-particle contour obtained after the contour filtering operation, determine the corresponding segmented single-particle binary image, merge the segmented single-particle binary image and the single-particle binary image to determine the corresponding particle set, and perform a mold identification operation on the particle set based on the preset second color threshold to determine the corresponding particle mold level.
[0189] As described above, the computer-readable storage medium provided in this application embodiment obtains a seed binary image by denoising the seed image and binarizing it according to the color space. It removes interference from the petri dish region in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image, and obtains a single seed binary image and a multi-seed aggregation region binary image. It generates a grayscale image of the multi-seed aggregation region binary image, matches this grayscale image with a single seed standard morphology grayscale image, and performs contour detection and filtering on the matched similar regions. This divides the multi-seed aggregation region binary image into a single seed combination region binary image. The single seed combination region binary image is then merged with the single seed binary image to obtain a seed set. Mold detection is then performed on the seed set. This improves the efficiency and accuracy of seed mold detection based on image processing technology and computer vision algorithms.
[0190] Embodiments of this application also provide a computer program product capable of implementing all steps in the fully automated seed mold detection method based on intelligent image analysis, where the execution subject is a server or client, as described in the above embodiments. When executed by a processor, this computer program / instruction implements the steps of the fully automated seed mold detection method based on intelligent image analysis. For example, the computer program / instruction implements the following steps:
[0191] Step S101: Obtain a seed image, perform Gaussian filtering on the seed image to determine the corresponding denoised seed image, perform color space segmentation on the denoised seed image according to a preset first color threshold to determine the corresponding seed binary image, perform culture dish interference removal on the seed binary image according to a set seed culture dish area to determine the corresponding updated seed binary image, wherein the seed binary image is used to separate the seed surface and the background area;
[0192] Step S102: Perform boundary enhancement operation on the updated seed binary map according to the preset morphological algorithm to determine the corresponding enhanced boundary seed binary map; perform contour detection operation on the enhanced boundary seed binary map according to the preset contour detection algorithm to determine the corresponding multiple effective contours; perform seed morphology division operation on the multiple effective contours according to the preset differentiation rules to determine the corresponding single seed binary map and multiple seed aggregation region binary map.
[0193] Step S103: Based on the preset distance transformation algorithm and the binary image of the multi-particle aggregation region, determine the corresponding first type of particle grayscale image, add a border to the first type of particle grayscale image, determine the corresponding second type of particle grayscale image, perform a similarity matching operation between the second type of particle grayscale image and the preset template particle grayscale image, determine the corresponding potential single-particle binary image based on the matching result obtained after the similarity matching operation, perform a contour filtering operation on the potential single-particle binary image, and perform a single-particle segmentation operation on the multi-particle aggregation region binary image based on the single-particle contour obtained after the contour filtering operation, determine the corresponding segmented single-particle binary image, merge the segmented single-particle binary image and the single-particle binary image to determine the corresponding particle set, and perform a mold identification operation on the particle set based on the preset second color threshold to determine the corresponding particle mold level.
[0194] As described above, the computer program product provided in this application embodiment reduces noise in the seed image and binarizes it according to the color space to obtain a seed binary image. It removes interference from the petri dish region in the seed binary image, performs boundary enhancement and contour detection on the updated seed binary image, and obtains a single seed binary image and a multi-seed aggregation region binary image. It generates a grayscale image of the multi-seed aggregation region binary image, matches the grayscale image with the standard morphology grayscale image of a single seed, and performs contour detection and filtering on the similar regions after matching. In this way, the multi-seed aggregation region binary image is segmented into a single seed combination region binary image. The single seed combination region binary image is merged with the single seed binary image to obtain a seed set, and mold detection is performed on the seed set. Thus, the efficiency and accuracy of seed mold detection can be improved based on image processing technology and computer vision algorithms.
[0195] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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.
[0196] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0197] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0198] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0199] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A fully automated seed kernel mold detection method based on intelligent image analysis, characterized in that, The method comprises: An image of the seed is acquired, a Gaussian filtering operation is performed on the image of the seed to determine a corresponding denoised seed image, a color space segmentation operation is performed on the denoised seed image according to a preset first color threshold to determine a corresponding seed binary image; A binarization operation is performed on the seed image according to a preset third color threshold to determine a corresponding contour binary image, a contour screening operation is performed on the contour binary image according to a preset contour detection algorithm to determine a corresponding seed culture dish contour, wherein the contour binary image comprises a seed culture dish contour and a seed contour, a polygon approximation operation and a vertex extraction operation are performed on the seed culture dish contour according to a preset polygon approximation algorithm to determine corresponding seed culture dish polygon vertex coordinates, and a seed culture dish region is determined according to a maximum value and a minimum value of the seed culture dish polygon vertex coordinates, wherein the seed culture dish region comprises a seed culture dish center coordinate, a seed culture dish inner radius, and a seed culture dish outer radius, a culture dish interference removal operation is performed on the seed binary image according to the set seed culture dish region to determine a corresponding updated seed binary image, wherein the seed binary image is used to separate a seed surface and a background region; A noise removal operation is performed on the updated seed binary image according to a preset erosion algorithm, a boundary enhancement operation is performed on the updated seed binary image after the noise removal operation according to a preset dilation algorithm to determine a corresponding enhanced boundary seed binary image, a contour detection operation is performed on the enhanced boundary seed binary image according to a preset contour detection algorithm to determine a plurality of effective contours, and a seed morphology division operation is performed on the plurality of effective contours according to a preset division rule to determine a single seed binary image and a multi-seed aggregation region binary image; A distance calculation operation is performed on each pixel point in the multi-seed aggregation region binary image to a background to determine a corresponding distance value, a gray value is determined according to the distance value, a first seed gray image is determined according to the gray value, a frame adding operation is performed on the first seed gray image to determine a second seed gray image, a similarity matching operation is performed on the second seed gray image and a preset template seed gray image, a potential single seed binary image is determined according to a matching result obtained after the similarity matching operation, a single seed segmentation operation is performed on the multi-seed aggregation region binary image according to a single seed contour obtained after a contour screening operation on the potential single seed binary image to determine a segmented single seed binary image, a merging operation is performed on the segmented single seed binary image and the single seed binary image to determine a seed set, and a mold identification operation is performed on the seed set according to a preset second color threshold to determine a seed mold grade.
2. The fully automated seed kernel mould detection method based on intelligent image analysis as claimed in claim 1, wherein, The seed morphology division operation on the plurality of effective contours according to the preset division rule to determine a single seed binary image and a multi-seed aggregation region binary image comprises: The plurality of effective contours are traversed, and it is determined whether the effective contour is smaller than a preset contour area; If yes, a single seed binary image is determined according to the effective contour; If not, a plurality of single-species particle binary images and a plurality of multi-species particle aggregation region binary images are determined according to the effective contours.
3. The fully automated seed kernel mould detection method based on intelligent image analysis as claimed in claim 1, wherein, The similar matching operation is performed on the second-species particle gray scale image and the preset template-species particle gray scale image according to a preset normalization cosine correlation coefficient algorithm, and a similar region is determined. The similar matching operation is performed on the second-species particle gray scale image and the preset template-species particle gray scale image according to a preset normalization cosine correlation coefficient algorithm, and a similar region is determined. The similar matching operation is performed on the second-species particle gray scale image and the preset template-species particle gray scale image according to a preset normalization cosine correlation coefficient algorithm, and a similar region is determined.
4. The fully automated seed kernel mould detection method based on intelligent image analysis as claimed in claim 1, wherein, The moldy area is determined according to the moldy recognition operation on the seed particle set according to the preset second color threshold value. The moldy area is determined according to the moldy recognition operation on the seed particle set according to the preset second color threshold value. The moldy area is determined according to the moldy recognition operation on the seed particle set according to the preset second color threshold value.
5. A fully automatic seed kernel and germinal spot detection device based on intelligent image analysis, characterized in that, The device comprises: The seed particle binary image determination module is configured to acquire a seed particle image, perform a Gaussian filtering operation on the seed particle image to determine a noise-reduced seed particle image, perform a color space segmentation operation on the noise-reduced seed particle image according to a preset first color threshold value to determine a seed particle binary image, perform a binarization operation on the seed particle image according to a preset third color threshold value to determine a contour binary image, perform a contour screening operation on the contour binary image according to a preset contour detection algorithm to determine a seed culture dish contour, wherein the contour binary image comprises a seed culture dish contour and a seed particle contour, perform a polygon approximation operation and a vertex extraction operation on the seed culture dish contour according to a preset polygon approximation algorithm to determine seed culture dish polygon vertex coordinates, and determine a seed culture dish region according to maximum and minimum values of the seed culture dish polygon vertex coordinates, wherein the seed culture dish region comprises a seed culture dish center coordinate, a seed culture dish inner radius, and a seed culture dish outer radius, perform a culture dish interference removal operation on the seed particle binary image according to the set seed culture dish region to determine an updated seed particle binary image, and use the seed particle binary image to separate a seed particle surface and a background region. The seed particle aggregation type binary image determination module is configured to perform a noise point removal operation on the updated seed particle binary image according to a preset erosion algorithm, perform a boundary enhancement operation on the updated seed particle binary image after the noise point removal operation according to a preset dilation algorithm to determine an enhanced boundary seed particle binary image, perform a contour detection operation on the enhanced boundary seed particle binary image according to a preset contour detection algorithm to determine a plurality of effective contours, and perform seed particle morphology division on the plurality of effective contours according to a preset division rule to determine a single-species particle binary image and a plurality of multi-species particle aggregation region binary images. The seed particle mold grade determination module is configured to: calculate the distance from each pixel point in the multiple seed particle aggregation region binary images to the background to determine a corresponding distance value; determine a corresponding gray value based on the distance value, determine a corresponding first seed particle gray image based on the gray value, add a frame to the first seed particle gray image to determine a corresponding second seed particle gray image, perform a similarity matching operation on the second seed particle gray image and a preset seed particle gray image, determine a corresponding potential single seed particle binary image based on a matching result obtained after the similarity matching operation, perform a contour screening operation on the potential single seed particle binary image, perform a single seed particle segmentation operation on the multiple seed particle aggregation region binary images based on a single seed particle contour obtained after the contour screening operation to determine a segmented single seed particle binary image, perform a merging operation on the segmented single seed particle binary image and the single seed particle binary image to determine a seed particle set, perform a mold identification operation on the seed particle set based on a preset second color threshold, and determine a corresponding seed particle mold grade.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the full-automatic seed particle mold detection method based on intelligent image analysis according to any one of claims 1 to 4 when executing the program.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the full-automatic seed particle mold detection method based on intelligent image analysis according to any one of claims 1 to 4 when executed by the processor.
Citation Information
Patent Citations
Maize kernel phenotype measuring method and system
CN106971393A
Wheat scab detection method based on multi-angle field high-definition imaging
CN110736750A
Automatic colony counting method and system based on Multi-Otsu threshold segmentation
CN117830331A