Sweet menu embryo pelleting seed breakage rate detection method based on machine vision

By using multispectral imaging and three-dimensional morphology reconstruction technology, combined with polarization correction and reflectivity calibration, a three-dimensional height map is generated, which solves the problems of low accuracy and poor anti-interference ability in the detection of seed damage in sweet potato monoembryo pelleting in traditional detection methods, and realizes efficient, accurate identification and quantitative evaluation of seed damage.

CN121033039AActive Publication Date: 2025-11-28INNER MONGOLIA AUTONOMOUS REGION ACAD OF AGRI & ANIMAL HUSBANDRY SCI

Patent Information

Application Number
CN202511556340.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2025-11-28
Estimated Expiration
2045-10-29

AI Technical Summary

Technical Problem

Existing methods for detecting sweet potato mono-embryo pelleted seeds rely on manual inspection, which is inefficient and highly subjective. Traditional machine vision systems cannot accurately identify minute cracks and internal damage, resulting in limited accuracy and reliability of the detection.

Method used

Using machine vision-based multispectral imaging and 3D topography reconstruction technology, visible light, near-infrared and non-standard visible light images are acquired. Combined with polarization difference correction and reflectivity calibration, an initial 3D height map is generated, anomaly judgment features on the seed surface are extracted, and a damage probability prediction model is constructed.

Benefits of technology

It significantly improves the accuracy of identifying micro-cracks and internal damage, enabling an objective and quantitative evaluation of seed damage and avoiding misjudgments caused by human subjective error and natural morphological differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033039A_ABST
    Figure CN121033039A_ABST
Patent Text Reader

Abstract

The invention provides a sweet menu embryo pelleting seed breakage rate detection method based on machine vision, and relates to the technical field of seed detection.The method comprises the steps that firstly, visible light and near-infrared images of seeds under standard illumination and non-standard visible light images under multiple light sources are collected, and reflectivity calibration and polarization difference correction processing are carried out; features such as colors and textures are extracted based on visible light and near-infrared reflectivity images, and multispectral feature vectors are constructed; a surface normal vector is calculated by using a photometric stereoscopic vision technology and combining a plurality of non-standard visible light images, an initial three-dimensional height map is generated through integration, and a plurality of abnormal judgment features are extracted to mark a suspected damaged area. And further calculating an edge sharpness index, removing a mechanical damage area, and determining a final damage area and a three-dimensional contour thereof. And finally, combining the volume loss rate, the projection area ratio and other multi-dimensional features with the multispectral feature vector to construct a damage probability prediction model, thereby realizing accurate and efficient detection of the seed damage rate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of seed detection, and particularly relates to a sugar beet single-embryo pelletized seed breakage rate detection method based on machine vision. BACKGROUND

[0002] Sugar beet single-embryo pelletization is a key link in modern sugar production agriculture. Seeds are coated with a coating agent to form regular pellets to meet the needs of precision seeding machines. However, during the pelletization, packaging, transportation and seeding processes, the seeds are prone to surface cracks, internal structure damage or coating peeling due to mechanical extrusion or collision. These damages directly affect the germination rate, uniformity of emergence and final yield of the seeds. Therefore, efficient and accurate breakage rate detection of the pelletized seeds is an important prerequisite for ensuring the efficiency of agricultural production.

[0003] Existing detection methods mainly rely on manual visual observation or machine vision systems based on two-dimensional visible light images. The manual detection method is not only low in efficiency and strong in subjectivity, and cannot meet the rapid sorting needs of large-scale seeds. Although the traditional monocular vision system can identify obvious surface color abnormalities or large defects, it is insufficient in sensitivity for tiny cracks, shallow scratches and damages hidden by the color of the coating material. More importantly, such methods cannot perceive the changes in the topography of the seed surface and the internal structure damage, and it is difficult to distinguish between real mechanical damage and natural color spots or reflections, which limits the detection accuracy and reliability.

[0004] The above information disclosed in the background section is only used to enhance the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The purpose of the present application is to provide a sugar beet single-embryo pelletized seed breakage rate detection method based on machine vision to solve the problems raised in the background.

[0006] To achieve the above-mentioned purpose, the present application provides the following technical scheme: A sugar beet single-embryo pelletized seed breakage rate detection method based on machine vision, comprising the following specific steps: Step 1: Collecting visible light images and near-infrared images of seeds to be analyzed under standard light, and non-standard visible light images under k light sources, and processing the above images based on reflectance calibration image sets and polarization difference correction image sets to obtain visible light reflectance images, near-infrared reflectance images and k non-standard visible light reflectance images; Step 2: Extracting visible light image features and near-infrared image features based on the visible light reflectance images and the near-infrared reflectance images and merging them to construct a multispectral feature vector; Step 3: Calculate the normal vector of each pixel point in the seed region based on each non-standard visible light reflectance image and its corresponding light source direction vector; generate an initial three-dimensional height map through normal vector field integration operation, so as to extract the abnormal judgment features of the seed surface, and mark out the suspected damage area according to the abnormal judgment features and the preset judgment condition; Step 4: Calculate the edge sharpness index of each suspected damage area, remove the area determined as mechanical damage, and output the final damage area and its three-dimensional profile data; Step 5: According to the three-dimensional profile data, calculate the total damage area ratio, total absolute volume loss and maximum volume loss rate of the final damage area of each seed, and combine them with the multispectral feature vector as input data to construct a damage probability prediction model to determine the damage probability of the seed to be analyzed.

[0007] Further, the reflectance calibration image set includes a whiteboard image and a dark field image, and the polarization difference correction image set includes a parallel polarized light image and a vertical polarized light image; Wherein, the acquisition logic of the parallel polarized light image and the vertical polarized light image is: under standard lighting conditions equipped with a polarizing mirror, the parallel polarized light image and the vertical polarized light image of the seed to be analyzed are collected respectively to form the polarization difference correction image set; Wherein, the acquisition logic of the visible light image, the near-infrared image and the non-standard visible light image is: using the same pixel-level RGB color camera and monochrome near-infrared camera, the visible light image and the near-infrared image of the seed to be analyzed are collected synchronously under standard lighting conditions, and the two images are image-registered to be transformed to the same coordinate system, wherein the standard lighting condition is a uniform lighting condition, and then k different and known direction light sources are controlled to be lit in turn to collect k non-standard visible light images of the seed to be analyzed under different lighting conditions, thereby forming a non-standard visible light image set for generating an initial three-dimensional height map; Wherein, the logic for processing the above images based on the reflectance calibration image set and the polarization difference correction image set is: processing the visible light image, the near-infrared image and the non-standard visible light image through the reflectance calibration image set to obtain the corrected visible light reflectance image, the near-infrared reflectance image and the corrected non-standard visible light reflectance image, and then performing polarization difference correction on the corrected visible light reflectance image and the corrected non-standard visible light reflectance image through the polarization difference correction image set to obtain the visible light reflectance image and the non-standard visible light reflectance image.

[0008] Further, constructing the multispectral feature vector specifically includes: The visible light image features include color features and texture features, the color features are hue and saturation, and the texture features are GLCM contrast; the near-infrared image features include transmittance and LBP entropy; Convert the visible light reflectance image to HSV color space, and process it based on OTSU threshold method to preliminarily separate the background and the foreground as a seed candidate region from the image; for the preliminarily separated foreground region, calculate the mean and standard deviation of the hue and saturation of all pixel points thereof to define the upper threshold and lower threshold of the hue and saturation of the seed region, wherein the lower threshold of the hue is , the upper threshold of the hue , is the mean of the hue, is the standard deviation of the hue, the lower threshold of the saturation is , the upper threshold of the saturation , is the mean of the saturation, is the standard deviation of the saturation, the region composed of the pixel points with the hue value falling within the range of , and the saturation value falling within the range of is determined as the final seed region; calculate the mean of the hue and the mean of the saturation of all pixel points in the seed region to serve as the color feature of the seed to be analyzed, and convert the seed region of the visible light reflectance image into a gray scale image and calculate the gray scale co-occurrence matrix thereof, and calculate the GLCM contrast of the seed region through the gray scale co-occurrence matrix to serve as the texture feature; (why the pixel points falling within the threshold interval are the seed region needs to be explained later, which feels strange) Based on the position of the seed region in the visible light reflectance image, determine the seed region in the near-infrared reflectance image, and calculate the transmittance based on the red channel reflectance in the seed region of the near-infrared reflectance image, and perform local binarization on the seed region in the image to calculate the LBP entropy; Splice the visible light image features and the near-infrared image features to construct a multispectral feature vector, denoted as wherein is the multispectral feature vector, H is the hue, S is the saturation, is the transmittance, is the GLCM contrast, is the LBP entropy.

[0009] Further, generating the initial three-dimensional height map specifically includes: Based on the k visible light reflectance images, calculate the unit normal vector of each pixel point in the seed region by using photometric stereo algorithm, specifically as follows: for each pixel point in the seed region, extract the pixel brightness values of the same position in the k visible light reflectance images to form a k-dimensional observation vector, and according to the simplification of the reflection function of a Lambertian surface, obtain ; wherein, represents an observation vector, is a surface reflectance, is a unit normal vector, is a light source direction matrix of k x 3, represents a three-dimensional row vector of the first light source, represents a three-dimensional row vector of the second light source, represents a three-dimensional row vector of the kth light source; by solving the following overdetermined equation system, i.e. to obtain the least squares solution of the normal vector and the albedo, and then by normalization to obtain the unit normal vector, and then by the relationship formula to extract the surface gradient from the normal vector field, the specific relationship formula is , wherein, is the component of the unit normal vector on the X-axis in three-dimensional space, is the component of the unit normal vector on the Y-axis in three-dimensional space, is the component of the unit normal vector on the Z-axis in three-dimensional space, p represents the partial derivative of the height in the X direction, and q represents the partial derivative of the height in the Y direction; Further, by solving the following Poisson equation, the gradient field is integrated to generate an initial three-dimensional height map, the formula is as follows: ; wherein, represents the height of the pixel point (x, y) in three-dimensional space, (p, q) represents the gradient field, and (x, y) is the pixel point position.

[0010] Further, marking the suspected damaged area specifically includes: The abnormality judgment features include Gaussian curvature, average curvature and local height difference; based on the initial three-dimensional height map, the first-order partial derivative and the second-order partial derivative of each pixel point are calculated, and then the Gaussian curvature and the average curvature of each pixel point are calculated according to the differential geometry formula; at the same time, the absolute value of the height difference of each pixel point and the pixel points in its neighborhood in the initial three-dimensional height map is calculated; The preset judgment conditions include geometric anomaly conditions and spectral verification conditions, and the geometric anomaly conditions are: wherein, is the Gaussian curvature of the pixel point (x, y), is the average curvature of the pixel point (x, y), is the average of the absolute value of the height difference of the pixel point (x, y) and the pixel points in its neighborhood, represents logical or, , , respectively represent the preset Gaussian curvature threshold, the average curvature threshold and the height difference threshold; The spectral verification condition is: wherein, T(x,y) represents the transmittance of the pixel point (x, y), T(x,y) represents the transmittance of the pixel point (x, y), T(x,y) represents the transmittance of the pixel point (x, y), is an adjustable parameter; The pixel points that satisfy both the geometric anomaly condition and the spectral verification condition are marked as suspected damage points, and other pixel points are marked as normal points, and a binary image is output, with the pixel value of the suspected damage point being 1 and the pixel value of the normal point being 0. An 8-neighborhood scan is performed on the binary image, and all spatially adjacent pixel points with a value of 1 are merged into the same connected domain, and each connected domain is taken as an independent suspected damage region candidate. Based on a preset minimum damage area threshold, suspected damage region candidates smaller than the minimum damage area threshold are removed, and the remaining suspected damage region candidates are taken as suspected damage regions.

[0011] Further, determining whether it is mechanical damage specifically includes: N edge points are collected on the edge profile of each suspected damage region, and the height gradient amplitude of each edge point is calculated based on the initial three-dimensional height map, and the formula is as follows: ; wherein, T(x,y) represents the transmittance of the pixel point (x, y), The average value and the maximum value of the height gradient amplitudes of all edge points of each suspected damage region are calculated and taken as edge sharpness indicators. According to the set mechanical damage judgment condition, it is determined whether it is mechanical damage. The mechanical damage judgment condition includes: condition one: the average value of the height gradient amplitudes of all edge points is greater than a preset normal damage height gradient amplitude average threshold, and condition two: the maximum value of the height gradient amplitudes of all edge points is greater than a preset normal damage height gradient amplitude maximum threshold. If one of the judgment conditions is met, it is determined that the suspected damage region is mechanical damage. The region determined as mechanical damage is removed from the suspected damage region, and the remaining suspected damage region is output as the final damage region, and the three-dimensional profile data corresponding to each final damage region is output.

[0012] Further, the three-dimensional profile data includes the coordinates and height of all pixel points in the region. According to the binary image of the seed to be analyzed, the number of pixel points in each final damage region is counted to calculate the area ratio, and the formula is as follows: ; wherein, represents the area proportion of the jth final damage area in the whole seed to be analyzed, represents the projection area of the jth final damage area on the binary image, that is, the number of pixel points of the final damage area, represents the total projection area of the seed to be analyzed in the binary image, that is, the number of pixel points of the seed to be analyzed in the binary image, and j is the index of the final damage area; The arithmetic mean of the heights of all pixel points in all final damage areas is calculated as a reference height; the physical area of a single pixel is obtained through the camera calibration parameters, and the heights of the pixel points are compared with the reference height to calculate the absolute volume defect, and the specific formula is as follows: ; wherein, represents the absolute volume defect of the jth final damage area, is the physical area of a single pixel, and R(j) represents a set of pixel points in the jth final damage area, is the reference height, represents the height of the pixel point (x, y); Based on the initial three-dimensional height map, the total volume of the seed to be analyzed is calculated; specifically, the reference height is regarded as the base height of the seed, and the volume of the seed surface higher than the base height is summed to calculate the total volume, and the formula is as follows: ; wherein, is the total volume of the seed to be analyzed, E represents a set of all pixel points of the seed to be analyzed in the binary image, is the lowest point height of the whole seed region; According to the absolute volume defect and the total volume of the seed, the volume loss rate of each final damage area is calculated, and the formula is as follows: ; wherein, is the volume loss rate of the jth final damage area.

[0013] Further, the construction of the damage probability prediction model specifically includes: The area proportion and the absolute volume defect of all final damage areas are summed to obtain the total damage area proportion of the seed and the total absolute volume defect of the seed; the maximum value of the volume loss rate of all final damage areas is determined; the total damage area proportion of the seed, the total absolute volume defect of the seed, and the maximum value of the volume loss rate of all final damage areas are combined with the multi-spectral feature vector to obtain a combined feature vector; Based on the above method, a group of sample seeds with known damage state are collected, and the combined feature vector of each sample seed is obtained, each sample seed is independently evaluated for damage by expert scoring method according to the physical sample of the sample seed, and the damage probability value of each sample seed is determined as the training label; based on the logistic regression model, the combined feature vector of the group of sample seeds is taken as the input, and the corresponding damage probability value is taken as the label, the model is trained, and a damage probability prediction model is constructed; The combined feature vector of the seed to be analyzed is input into the trained damage probability prediction model, and the damage probability value output by the model is compared with the preset damage threshold to determine whether the seed to be analyzed is damaged; The number of seeds determined to be damaged in the group of seeds to be analyzed is counted, the proportion of the number in the group of seeds is calculated, and the proportion is taken as the damage rate of the group of seeds to be analyzed. In the above technical solution, the technical effects and advantages provided by the present application are: The present application effectively solves the problems of low precision, poor anti-interference ability and inability to quantitatively evaluate in the detection of sugar beet single embryo pelletized seed damage by traditional manual detection and single visible light vision method by fusing multispectral imaging and three-dimensional topography reconstruction technology. By using the sensitivity of near-infrared image to internal structure and the enhanced ability of visible light image after polarization correction to surface details, combined with the accurate reconstruction of three-dimensional height map to surface geometric features, the system can reliably identify multiple damage types including micro-cracks, internal damage and surface depressions, significantly improving the detection rate and accuracy of complex damage characteristics. By quantitatively calculating the volume loss, projection area ratio and other multi-dimensional geometric indicators of the damaged area, and combining with the multispectral features for decision-making, the method realizes objective and quantitative evaluation of the damage degree of the seed, avoiding misjudgment caused by human subjective error and natural morphological difference. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 The present application is a whole method flowchart. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below with specific examples.

[0016] It should be noted that, unless otherwise defined, technical terms or scientific terms used in the present application shall have the common meaning understood by one of ordinary skill in the art to which the present application pertains. The terms "first", "second", and similar terms used in the present application do not denote any order, quantity, or importance, but are only used to distinguish different components. The terms "comprise", "include" and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connected" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "up", "down", "left", "right" and the like are only used to represent relative positional relationships, and when the absolute positions of the described objects change, the relative positional relationships may also change accordingly.

[0017] Embodiments: Please refer to Figure 1 The present application provides a technical solution: A sugar beet embryo pellet granulation seed breakage detection method based on machine vision, the specific steps comprising: Step 1: Collect the visible light image and near-infrared image of the seed to be analyzed under standard light, and the non-standard visible light image under k light sources, and process the above images based on the reflectance calibration image set and the polarization difference correction image set to obtain the visible light reflectance image, the near-infrared reflectance image and the k non-standard visible light reflectance image; In this embodiment, the image acquisition system core comprises: a standard light box, a pixel-level aligned RGB color camera and a monochrome near-infrared camera (or a multi-spectral camera with corresponding spectral response capability), a diffuse white board with known reflectivity (as a reflectivity reference), a polarizing mirror that can cover the camera lens, and k independently controllable point light sources with known spatial azimuth angles. The direction of each light source is defined by the zenith angle (the angle with the normal of the sample table) and the azimuth angle (the angle between the projection in the sample table plane and the reference direction). The standard light box provides uniform and stable main lighting environment, and its spectral characteristics are known. The k point light sources are arranged around the sample table, and their zenith angles and azimuth angles are accurately recorded for subsequent calculation of the three-dimensional direction vectors of the light sources and for photometric stereo vision calculation. To ensure image space consistency, the RGB camera and the near-infrared camera are fixed by a rigid structure in hardware and are pre-calibrated so that their optical axes are parallel and the imaging planes are coplanar, thereby minimizing parallax. Reflectivity calibration is a key step to eliminate camera dark current noise and uneven illumination and to convert the original image gray value to relative reflectivity. The reflectivity calibration image set includes a white board image and a dark field image, and the polarization difference correction image set includes a parallel polarized light image and a perpendicular polarized light image. The white board image is obtained by placing a standard diffuse white board with known reflectivity in the center of the sample table under standard lighting conditions, and using the RGB color camera and the monochrome near-infrared camera to acquire images. This image represents the maximum response of the imaging system under the current lighting. The dark field image is acquired using the RGB color camera and the monochrome near-infrared camera under complete shading (i.e., all light sources are turned off). This image represents the dark current and readout noise of the camera.

[0018] Polarization difference correction aims to effectively suppress the interference of seed surface specular reflection light (high light) that can mask the texture and damage details of the seed surface. The acquisition logic of the parallel polarized light image and the perpendicular polarized light image is as follows: under standard lighting conditions with a polarizing mirror, a linear polarizing mirror is installed in front of the camera lens. First, rotate the polarizing mirror so that its polarization direction is parallel to the polarization direction of the incident light (this state is determined experimentally in advance), and acquire the parallel polarized light image. Then, rotate the polarizing mirror by 90 degrees so that its polarization direction is perpendicular to the polarization direction of the incident light, and acquire the perpendicular polarized light image. The parallel polarized light image and the perpendicular polarized light image of the seed to be analyzed are acquired to form a polarization difference correction image set; Wherein, the acquisition logic of the visible light image, the near-infrared image and the non-standard visible light image is: under standard lighting conditions, remove the polarizer (or adjust it to a state that does not affect imaging), trigger the RGB color camera and the monochrome near-infrared camera synchronously, and collect a visible light image and a near-infrared image respectively. Due to the slight position and angle difference between the two cameras, the collected visible light image and near-infrared image need to be image registered. A registration algorithm based on feature points (such as SIFT, ORB) or an algorithm based on phase correlation is used to calculate the reflection transformation or perspective transformation matrix between the two images, and the near-infrared image is transformed to the coordinate system of the visible light image to realize pixel-level spatial alignment. The standard lighting conditions are uniform lighting conditions, and then k different and known direction light sources are controlled to be lit in turn to collect k non-standard visible light images of the seed to be analyzed under different lighting conditions to form a non-standard visible light image set for generating an initial three-dimensional height map.

[0019] Wherein, the logic of processing the above images based on the reflectance calibration image group and the polarization difference correction image group is: the visible light image, the near-infrared image and the non-standard visible light image are processed through the reflectance calibration image group, and the formula for calculating the reflectance image to be corrected is: ; Wherein, is the original image, is the corresponding dark field image, is the corresponding whiteboard image, is the calculated to-be-corrected reflectance image. This operation normalizes the image pixel value to the relative reflectance range of [0, 1], effectively eliminating the effects of system fixed pattern noise and uneven lighting. After this step, the to-be-corrected visible light reflectance image, the to-be-corrected near-infrared reflectance image and the k to-be-corrected non-standard visible light reflectance images are obtained.

[0020] The to-be-corrected visible light reflectance image and the to-be-corrected non-standard visible light reflectance image are then corrected by the polarization difference image group to obtain the visible light reflectance image and the non-standard visible light reflectance image. This processing is specifically for images in the visible light band to suppress specular reflection. First, for the to-be-corrected visible light reflectance image and each to-be-corrected non-standard visible light reflectance image, the parallel polarized light image and the vertical polarized light image are processed according to the above reflectance calibration method to obtain the corresponding parallel polarized reflectance image and the vertical polarized reflectance image. Then, the polarization difference algorithm is used for correction. The logic of polarization difference correction is: calculate the difference image , and enhance the contrast of the difference image. Finally, the corrected reflectance image is obtained by one of the following formulas: Formula A: ; Formula B: ; Formula C: ; wherein, is the reflectance image, is the parallel polarized reflectance image, is the perpendicular polarized reflectance image, are the weight coefficients of the corresponding terms, is the correction term.

[0021] The specific value of in the above formulas is not a fixed preset value, but needs to be determined by experiment calibration. The specific value determination method is to collect a group of seed sample images with known surface characteristics (including smooth and rough surfaces), and manually identify the areas in the image that are severely affected by specular reflection. With the optimization goal of effectively suppressing the specular reflection component in the corrected area and maximizing the retention of diffuse reflection texture information, the grid search method or optimization algorithm (such as least squares method) is used to fit the optimal value on the experimental data. The intensity of specular reflection is closely related to the roughness, moisture content and illumination of the seed surface, so it is difficult to apply a fixed coefficient to all situations. By calibrating on a representative sample set, an optimal compromise coefficient can be obtained for the current seed type and imaging system, so that the correction effect is optimal overall, ensuring the stability of subsequent feature extraction. Usually, the value of these coefficients ranges from 0 to 1, and the initial debugging can start from 0.5. The above Formula A represents a linear subtraction model, assuming that the specular reflection component in the image is proportional to the polarization difference value. The correction process is to directly subtract the estimated specular reflection component from the original image. This formula is intuitive and simple, with small computational complexity. However, when is large, it may cause to appear negative, which needs to be truncated (such as zeroing), which may introduce errors. Formula B is a nonlinear ratio model based on a physical assumption that the reflectance value of the original image is exaggerated in areas with strong specular reflection. This formula compresses the values of these highlight areas through a denominator related to is a normalization constant to prevent the denominator from being zero, is usually a very small integer, or related to the average reflectance of the image, controls the compression strength. This formula can effectively suppress highlights and prevent negative results, and is more consistent with the nonlinear characteristics of light intensity saturation in some cases. However, it may over-compress in some cases, resulting in loss of details in the highlight area, and is more suitable for cases where specular reflection is very strong and there are pixel areas close to saturation in the image. Formula C is a linear attenuation model, which can be regarded as a variant of Formula A. It regards the correction process as an attenuation of the original image related to the intensity of specular reflection. When When the pixel is large (strong specular reflection), the attenuation factor is small, thus reducing the brightness of the pixel. This formula is also simple and intuitive, and by designing the attenuation factor, it can naturally ensure that the result will not be negative (as long as the value of the attenuation factor is ensured to be not less than 0). The applicable scenario is similar to formula A, but it is hoped to avoid the case of negative values.

[0022] Step 2: Extract visible light image features and near-infrared image features based on the visible light reflectance image and the near-infrared reflectance image and combine them to construct a multispectral feature vector; In this embodiment, constructing the multispectral feature vector specifically includes: The visible light image features include color features and texture features, the color features are hue and saturation, and the texture features are GLCM contrast, and the near-infrared image features include transmittance and LBP entropy; The visible light reflectance image is converted to the HSV color space. The specific method of conversion is: for each pixel point, according to the intensity values of its R, G and B three channels, the corresponding hue (H), saturation (S) and brightness (V) values are calculated by using the standard conversion formula. Subsequently, based on the OTSU threshold method, it is processed to preliminarily separate the background (i.e. the seed candidate region) and the foreground as the seed candidate region from the image. The OTSU threshold method is an adaptive threshold determination method, which automatically calculates the best segmentation threshold by maximizing the inter-class variance between the foreground and the background, and this process does not need to preset the threshold value and can adapt to images under different lighting conditions. For the foreground region preliminarily separated as the seed candidate region by the OTSU method, the mean value and the standard deviation of the hue and the saturation of all the pixel points thereof are calculated. These statistics are dynamically calculated based on the foreground region of the current image to be analyzed, rather than fixed and unchanged preset values, which ensures the adaptability of feature extraction for different batches and different imaging conditions of the seed image. Using these statistics, the upper threshold and the lower threshold of the hue and the saturation of the seed region are defined, wherein the lower threshold of the hue , , is the mean value of the hue, is the standard deviation of the hue, the lower threshold of the saturation , , is the mean value of the saturation, is the standard deviation of the saturation; here, the mean value ± times the standard deviation is selected as the threshold range, which is based on the statistical principle, assuming that the hue and the saturation values of the foreground (seed) region approximately obey the normal distribution, and this range (i.e. ​) can cover about 95.4% of the data points in theory. This setting aims to include normal fluctuations in seed surface color while effectively excluding background or noise pixels that are significantly different from the seed color feature, thus achieving accurate extraction of the seed region. The connected region composed of pixels with hue values falling within the range of , ] and saturation values falling within the range of is determined as the final seed region.

[0023] The aggregation of healthy seed surfaces in a specific color space naturally excludes damaged parts and foreign objects with abnormal color features through an adaptive threshold method based on data distribution. The core idea is that in the HSV color space, due to the pelleting process, the seed surface material and color are relatively uniform, and the pixels of most intact seed regions will show a compact cluster distribution in the hue and saturation dimensions. By calculating the mean and standard deviation of the hue and saturation of all pixels in the foreground region (i.e. the seed candidate region), we are actually depicting the approximate range and density of the main cluster in the color feature space under data-driven. Then, the threshold range is set to twice the standard deviation of the mean. Those pixels with hue or saturation values outside this range have significantly deviated from the normal cluster of seeds, and therefore have a high probability of not belonging to the intact seed surface. They may be due to the exposure of internal tissues, the attachment of highly reflective impurities, or dark mold stains, etc.

[0024] The mean hue and saturation of all pixels in the seed region are calculated as the color features of the seed to be analyzed. The seed region of the visible light reflectance image is converted to a grayscale image, and the grayscale conversion uses the weighted formula sensitivity of human eyes to different wavelengths of light. Then, a gray level co-occurrence matrix (GLCM) is calculated. The GLCM is a method to describe texture by studying the spatial dependence of gray levels. In this embodiment, the calculation parameters of the GLCM are set as follows: the step (d) is 1 pixel, the directions are selected as 0°, 45°, 90°, and 135°, the average value of the GLCM of each direction is taken as the final GLCM, and the final GLCM is taken as the texture feature. The contrast of the calculated GLCM is further calculated. The contrast reflects the definition of the image and the depth of the texture groove. The deeper the texture groove, the greater the contrast, and the clearer the visual effect. The calculated GLCM contrast is taken as the texture feature of the seed to be analyzed. Based on the position coordinates of the seed region accurately determined in the visible light reflectance image, the same seed region is located and extracted in the spatially aligned near-infrared reflectance image. This ensures that the visible light and near-infrared features are derived from the same physical position of the seed. In the seed region of the near-infrared reflectance image, the transmittance is calculated based on the reflectance value of the red channel. The transmittance is the average reflectance value of the red channel of the seed region in the near-infrared image. The red channel is selected because in near-infrared imaging, the red light of a specific waveband has a high correlation with the internal structure and water content of the seed, and its reflectance characteristics can indirectly reflect the physical state of the seed, such as integrity or potential damage. Local binary pattern analysis is performed on the seed region in the near-infrared reflectance image. LBP is an operator for describing local texture features of an image. In this embodiment, a basic LBP operator is used. That is, in a 3x3 neighborhood, the gray value of the center pixel is taken as the threshold, and the gray values of the eight neighborhood pixels are compared with the gray value of the center pixel. If the gray value of the neighborhood pixel is greater than or equal to the gray value of the center pixel, the position is marked as 1, otherwise it is marked as 0, thereby generating an 8-bit binary pattern. The statistical histogram of the LBP values of all pixel points in the seed region is calculated. Then, the information entropy of the LBP histogram, i.e., the LBP entropy, is calculated. The calculation formula of the LBP entropy is wherein is the probability of the kth LBP pattern in the histogram. The LBP entropy reflects the complexity and irregularity of the seed surface texture. Damage or abnormal areas often cause changes in texture complexity, thereby affecting the entropy value.

[0025] The visible light image features and the near-infrared image features are spliced to construct a multispectral feature vector, which is represented as wherein, is the multispectral feature vector, H is the hue, S is the saturation, is the transmittance, is the GLCM contrast, is the LBP entropy.

[0026] By fusing the color and texture information under visible light and the transmission characteristics and texture complexity information under near-infrared light, the multispectral feature vector can more comprehensively and accurately represent the performance and internal physical properties of the sugar beet embryo seeds, thereby providing a robust and high-discrimination feature input for subsequent seed damage state classification.

[0027] Step 3: In combination with each non-standard visible light reflectance image and the corresponding light source direction vector, the normal vector of each pixel point in the seed region is calculated; an initial three-dimensional height map is generated by field integral operation of the normal vector, so as to extract an abnormal judgment feature of the seed surface, and a suspected damage area is marked according to the abnormal judgment feature and a preset judgment condition. In this embodiment, generating the initial three-dimensional height map specifically includes: First, a light source direction matrix is constructed, specifically as follows: For each light source with a zenith angle and an azimuth angle, the calculation formula of the three-dimensional unit direction column vector is ; wherein is the i th zenith angle, is the i th azimuth angle, and i is the light source index. The k column vectors obtained by the above calculation are transposed to obtain k row vectors of 1x3, and the row vectors are stacked in turn as rows to form a light source direction matrix .

[0028] Based on the k visible light reflectance images, the unit normal vector of each pixel point in the seed region is calculated by using the photometric stereo vision algorithm, specifically as follows: for each pixel point in the seed region, the pixel brightness values of the same position in the k visible light reflectance images are extracted to form a k-dimensional observation vector, and the reflection function on the surface of a Lambertian body is simplified to obtain: ; wherein, represents the observation vector, is the surface reflectivity, is the unit normal vector, is the light source direction matrix of kx3, represents the three-dimensional row vector of the first light source, represents the three-dimensional row vector of the second light source, represents the three-dimensional row vector of the k th light source; In actual application, in order to meet the solution condition of the photometric stereo vision algorithm, the value of k should be not less than 3, so as to ensure that the light source direction matrix L has sufficient rank to solve the normal vector. Preferably, the value range of k is 4 to 6, and by increasing the number of light sources, the robustness of the system can be enhanced, the noise interference can be reduced, and the accuracy of the normal vector estimation can be improved.

[0029] The least square solution of the normal vector and albedo is obtained by solving the following overdetermined equation system: During the solving process, if the matrix is close to singular, a regularization term or a numerical stability method such as singular value decomposition can be introduced to improve the stability of the solution. Subsequently, the unit normal vector is obtained by normalization, and then the surface gradient is extracted from the normal vector field through the relationship formula , , wherein is the component of the unit normal vector on the X-axis in the three-dimensional space, is the component of the unit normal vector on the Y-axis in the three-dimensional space, is the component of the unit normal vector on the Z-axis in the three-dimensional space, p represents the partial derivative of the height in the X direction, and q represents the partial derivative of the height in the Y direction. The gradient field is integrated to generate the initial three-dimensional height map by solving the following Poisson equation: ; wherein is the Laplacian operator, represents the height of the pixel point (x, y) in the three-dimensional space, (p, q) represents the gradient field, , , and (x, y) is the pixel point position. In the discrete image domain, the Poisson equation is usually efficiently solved by discrete cosine transformation or iterative method (such as Gauss-Seidel iteration). During the solving process, appropriate boundary conditions need to be set, for example, Neumann boundary condition, which assumes that the height gradient at the boundary is zero.

[0030] In this embodiment, marking the suspected damage area specifically includes: The abnormality judgment features include Gaussian curvature, average curvature, and local height difference. The Gaussian curvature reflects the intrinsic bending degree of the surface at the point, and for local severe deformation regions such as damage and cracks, the Gaussian curvature will usually change significantly. The average curvature reflects the average bending degree of the surface at the point, and can be used to identify abnormalities such as depressions or protrusions. The local height difference calculates the absolute value of the height difference between each pixel point and its neighborhood pixel points, reflecting the local roughness or mutation of the surface. Based on the initial three-dimensional height map, the first-order partial derivative and the second-order partial derivative of each pixel point are calculated. In discrete calculation, these derivatives can be approximately obtained by image gradient operators such as Sobel operator, Scharr operator, or central difference method. Further, the Gaussian curvature and the average curvature of each pixel point are calculated according to the differential geometry formula, and the calculation formula is as follows: ; ; where K is the Gaussian curvature, a measure of the intrinsic geometric properties of a surface at a point (i.e., properties independent of how the surface is embedded in three-dimensional space). It reflects the local degree of curvature of the surface at that point and is a geometric invariant that does not depend on the choice of coordinate system. In seed surface topography analysis, Gaussian curvature is used to identify those sharp local deformations that cannot be achieved by simple bending. K > 0 indicates that the point exhibits ellipsoidal features (locally a peak or a valley), K = 0 indicates that the point exhibits cylindrical or planar features (locally flat, such as a ridge or a plane), and K < 0 indicates that the point exhibits hyperbolic features (locally saddle-shaped). H is the mean curvature, a measure of the extrinsic geometric properties of a surface at a point (i.e., properties related to how the surface is embedded in three-dimensional space). It reflects the tendency of the surface to curve on average towards its normal vector direction at that point and is a direct indicator of the concavity or convexity of the surface. H > 0 indicates that the surface is on average convex outward at that point (e.g., the outside of a sphere), H = 0 indicates a minimal surface (e.g., a soap film), and H < 0 indicates that the surface is on average concave inward at that point (e.g., the inside of a sphere). , which represents the height The rate of change of the slope in the X direction (i.e., p) itself. It quantifies the degree of bending of the surface along the X direction. For example, a convexity in the X direction will result in being positive. , which represents the height The rate of change of the slope in the Y direction (i.e., q) itself. It quantifies the degree of bending of the surface along the Y direction. , which represents the height The rate of change of the slope in the X direction (i.e., p) with respect to the Y direction, or the rate of change of the slope in the Y direction (i.e., q) with respect to the X direction (according to Clairaut's theorem, both are equal). It quantifies the degree of coupling of bending in the two orthogonal directions and is a key parameter for identifying complex topographies such as saddle points.

[0031] At the same time, the absolute values of the height differences between each pixel point and each pixel point in its neighborhood in the initial three-dimensional height map are calculated, and the average of all absolute values is taken as the local height difference. The calculation formula is as follows: ; wherein, represents the local height difference of the pixel point (x, y), i is the pixel point index in the neighborhood, used to traverse all pixels in the neighborhood window, such as a 3x3 or 5x5 window; N is the number of neighborhood pixel points, represents the height of the i-th pixel point in the neighborhood of the pixel point (x, y); The preset judgment conditions include geometric anomaly conditions and spectral verification conditions, and the geometric anomaly conditions are: wherein, is the Gaussian curvature of the pixel point (x, y), Let be the average curvature of pixel (x, y). This is the mean of the absolute values ​​of the height differences between a pixel (x, y) and its neighboring pixels. Represents logical OR, , , These represent the preset Gaussian curvature threshold, average curvature threshold, and height difference threshold, respectively.

[0032] In damage detection, a complete, smooth seed surface typically has a gently varying curvature value. However, a damaged area (such as a crack, notch, dent, or spall) introduces drastic deformation in a localized area. This deformation causes abrupt changes in the area's height (captured by local height differences), and its curvature pattern deviates significantly from that of a normal area. For example, extremely high average and Gaussian curvatures are generated at the edges of cracks, and specific combinations of curvature are produced at the bottom and edges of pits formed by spalling. Therefore, by setting a threshold... By detecting these abnormal curvature extreme points, potential damage areas can be effectively located.

[0033] This is the Gaussian curvature threshold, used to determine whether there is severe, non-developable curvature in a localized area of ​​the surface. Its specific value can be determined by statistically analyzing the Gaussian curvature distribution of a large number of known normal seed samples. For example, the 99th percentile of the Gaussian curvature distribution of normal samples can be used as the threshold. .generally, The value can range from 0.1. Up to 1.0 The specific result depends on the smoothness of the seed surface and the imaging resolution. This is the average curvature threshold, used to determine the overall unevenness or irregularity of a surface. Its specific value can also be determined by statistically analyzing the absolute value distribution of the average curvature of normal samples, for example, by taking its 99th percentile. Typically, The value can range from 0.05. Up to 0.5 . This is a local height difference threshold used to determine whether there are steep height changes on the surface. Its specific value can be set based on the average roughness of a normal seed surface or the maximum allowable height difference. Typically, The value can range from 5% to 15% of the average seed diameter.

[0034] The spectral verification conditions are as follows: ,in, This represents the transmittance of a pixel (x, y). This represents the average transmittance of the neighboring pixels of pixel (x, y). Transmittance standard deviation of the neighborhood pixels of pixel point (x, y). In this embodiment, a local window is defined with the pixel point under judgment as the center, for example, 5x5 or 7x7 pixels. The window size is an odd integer to ensure central symmetry. The transmittance mean and transmittance standard deviation are calculated in the local window. is a tunable parameter used to control the sensitivity of the spectral anomaly detection. The value of determines the strictness of the judgment of whether it is an abnormal point. The greater the value, the stricter the condition, the fewer the suspected damaged points detected, and the risk of missed detection may increase. The smaller the value, the more relaxed the condition, the more points detected, and the risk of false detection may increase. The specific optimized value of can be determined by ROC curve analysis on a validation set containing known damaged and normal seeds to achieve the best balance point. Generally, The value range is between 1.5 and 3.0.

[0035] The pixel points that meet both the geometric anomaly condition and the spectral verification condition are marked as suspected damaged points, and other pixel points are marked as normal points, and a binary image is output, with the pixel value of suspected damaged points set to 1 and the pixel value of normal points set to 0.

[0036] In this embodiment, the relevant data values of 30 data points are collected to show the judgment process of suspected damaged points. In the judgment process, the Gaussian curvature threshold value is 0.5 , the average curvature threshold value is 0.3 , the height difference threshold value is 0.02 mm, and the spectral sensitivity parameter value is 2. The specific data is shown in the following table: Table 1: Related data table for judging suspected damaged points

[0037] From the above table, the judgment process of the 30 sample data points as suspected damaged points can be clearly observed. The local window size used in calculating the local transmittance mean and local transmittance standard deviation is 7x7 pixels. This medium size can robustly estimate the local background statistical properties in most seed damage detection scenarios. The geometric anomaly points in the table represent whether the pixel points are marked as abnormal points after the geometric anomaly condition judgment, and the spectral anomaly points represent whether the pixel points are marked as abnormal points after the spectral verification condition judgment.

[0038] Morphological operations are performed on the obtained binary image, such as a closing operation using a small structure element (e.g. a 3x3 circle or square) to fill small holes, connect adjacent broken areas, and smooth the boundaries. Subsequently, 8-neighbor connected component analysis is performed on the binary image, merging all spatially adjacent (connected through up, down, left, right, and four diagonal directions) and pixel value 1 pixels into the same connected domain, and each connected domain is taken as an independent suspected broken area candidate. Based on a preset minimum broken area threshold, suspected broken area candidates smaller than the minimum broken area threshold are removed. The minimum broken area threshold should be set considering the minimum broken size that can be identified in actual application, and avoiding a large number of small false areas caused by image noise. For example, the minimum broken area can be set to 0.01% to 0.1% of the total image pixels, or according to the physical size conversion, for example, the area corresponding to an actual size of less than 0.1 mm is removed. Finally, the remaining suspected broken area candidates are taken as suspected broken areas.

[0039] Step 4: Calculate the edge sharpness index of each suspected broken area, remove the areas determined to be mechanical damage, and output the final broken area and its three-dimensional profile data. In this embodiment, determining whether it is mechanical damage specifically includes: N edge points are collected on the edge profile of each suspected broken area. The value of N should be sufficient to reflect the characteristics of the entire edge profile, and is usually set to 50 to 200 points. In specific implementation, sampling can be performed along the edge profile at equal arc length or equal pixel distance to ensure uniformity and representativeness of the sampling. Based on the initial three-dimensional height map, the height gradient amplitude of each edge point is calculated, and the formula is as follows: ; wherein, represents the height gradient amplitude of the pixel point (x, y); respectively represent the partial derivatives in the x direction and the y direction, i.e. the height change rate at that point. In actual numerical calculation, discrete differential operators such as Sobel operator, Prewitt operator or central difference method are usually used to approximate the calculation of the two partial derivatives. For example, using a 3x3 Sobel operator template to perform convolution operation in the neighborhood of the pixel point (x, y) can obtain the gradient approximation value of the height at the point in the X and Y directions. The value is larger, indicating that the height change at the edge point is more severe, and the edge in the three-dimensional space is more sharp.

[0040] The average value and the maximum value This is used as an indicator of edge sharpness. The average value reflects the overall average steepness of the edge of the damaged area, while the maximum value reflects the steepness of the sharpest part of the edge. Based on the established mechanical damage judgment criteria, it is determined whether the damage is mechanical. The mechanical damage judgment criteria include: Condition 1: The average height gradient amplitude of all edge points is greater than the preset threshold for the average height gradient amplitude of normal damage. Condition 2: The maximum value of the height gradient magnitude at all edge points is greater than the preset threshold for the maximum value of the height gradient magnitude of normal damage. If any one of the judgment conditions is met, the suspected damaged area is determined to be mechanical damage. and The setting of these parameters is crucial for accurately distinguishing between mechanical damage and natural breakage. Their values ​​depend on the measurement accuracy of the 3D heightmap, the unit (e.g., micrometers / pixel), and the physical properties of the sweet potato cake surface itself. The determination process includes: collecting a representative set of sweet potato cake samples containing known categories (explicitly labeled as natural breakage, mechanical breakage, and intact); performing 3D scanning and the processing described in this method on these samples; and calculating the natural breakage region and mechanical damage region for each sample. and Draw separate maps for areas of natural damage and mechanical damage. and The distribution histogram or scatter plot. Observe the two types of regions. and Divisibility in dimensions. It should be set for natural damage. and the upper limit of distribution and mechanical damage Between the lower bound of the distribution, a value can usually be chosen that minimizes the sum of the misclassification rates of natural damage (classifying natural damage as mechanical damage) and mechanical damage (classifying mechanical damage as natural damage). Similarly, The principles of determination and The same applies to the distribution differences regarding the maximum value feature. The performance of the selected threshold is tested on independent validation sets, and fine-tuned based on the validation results. This value is chosen because mechanical damage is typically caused by scratches or impacts from sharp objects, resulting in steep, cliff-like three-dimensional structures at the edges, causing abrupt changes in height at the edges. and The values ​​are generally higher. Natural damage (such as natural cracking or peeling of the seed coat) typically has gentler edges and more subtle height variations. and The values ​​are relatively low. For example, assuming the data unit of the 3D height map is micrometers, the above statistical analysis may reveal more than 95% of naturally damaged areas. Less than 15 micrometers per pixel less than 40 microns / pixel; and 80% or more of the mechanically damaged areas more than 15 microns / pixel or more than 40 microns / pixel. Then, and can be initially set to 15 microns / pixel and 40 microns / pixel, respectively. In practical applications, these two thresholds may need to be adjusted adaptively according to different seed varieties and imaging system accuracy.

[0041] The areas finally determined as mechanically damaged are removed from the suspected damaged areas, and the remaining suspected damaged areas are output as final damaged areas, and the three-dimensional profile data corresponding to each final damaged area is output. The three-dimensional profile data is a set of three-dimensional coordinate points in the initial three-dimensional height map corresponding to each final damaged area. These three-dimensional profile data not only contains the planar shape and position of the damaged area, but also accurately records the depth information, providing a reliable data basis for subsequent accurate calculation of damaged area (especially on curved seed surfaces), damaged volume estimation, and deeper damaged morphology analysis.

[0042] Step 5: According to the three-dimensional profile data, calculate the total damaged area ratio, total absolute volume loss, and maximum volume loss rate of each seed, and combine them with the multispectral feature vector as input data to construct a damaged probability prediction model to determine the damaged probability of the seed to be analyzed.

[0043] In this embodiment, the three-dimensional profile data includes the coordinates and heights of all pixel points in the area. First, according to the binary image of the seed to be analyzed, the number of pixel points in each final damaged area is counted to calculate the area ratio, as follows: ; wherein, represents the area ratio of the jth final damaged area in the entire seed to be analyzed, is the projection area of the jth final damaged area on the binary image, i.e., the number of pixel points in the final damaged area, is the total projection area of the seed to be analyzed in the binary image, i.e., the number of pixel points in the binary image of the seed to be analyzed, and j is the index of the final damaged area.

[0044] In the area ratio calculation formula, reflects the relative size of a single damaged area in the total surface area of the seed, which quantifies the two-dimensional spatial influence range of the damaged area in percentage form. This indicator can objectively evaluate the extent of damage to the seed surface area, providing a direct geometric basis for judging the severity of damage. The independent variable and There is a direct proportional relationship between the two, the larger the projected area of the damaged area, the higher the proportion of the total surface area of the seed; while the denominator As a normalization factor, it ensures the consistency of the damage evaluation results of seeds of different sizes. So that the area ratio index not only reflects the absolute size of the damaged area, but also eliminates the influence of individual size difference on the evaluation results. As the projected area of the damaged area increases, the numerator value increases accordingly, resulting in a linear increase in the area ratio , indicating that the degree of damage performance is aggravated; on the contrary, when the damaged area decreases, the ratio value decreases accordingly. If the total projected area of the seed changes, it will inversely affect the ratio value, that is, under the same damaged area, the smaller the seed, the larger the area ratio value.

[0045] The arithmetic mean of the height of all pixel points in all final damaged areas is calculated as the reference height. The setting of the reference height is based on the fact that the damaged area usually exhibits a concave feature. By calculating the average height of the damaged area, a relative reference plane can be established, so as to accurately calculate the volume loss.

[0046] The physical area of a single pixel is obtained through the camera calibration parameters, and the height of each pixel point is compared with the reference height to calculate the absolute volume loss, as follows: ; Wherein, represents the absolute volume loss of the jth final damaged area, is the physical area of a single pixel, R(j) represents the set of pixel points in the jth final damaged area, is the reference height, represents the height of the pixel point (x, y).

[0047] The dependent variable in the absolute volume loss calculation formula reflects the physical space lost by the jth final damaged area relative to the complete surface of the seed. Its technical effect lies in accurately quantifying the actual material volume lost due to damage, concave or missing on the seed surface. This parameter combines the two-dimensional damaged area with three-dimensional depth information, and converts the damaged degree observed by the naked eye into accurately measurable volume loss data, thereby providing a more accurate and robust geometric feature input than simple area measurement for damage probability prediction. The independent variable directly depicts the depth of each pixel point position. The reference height represents the theoretical height reference surface of the damaged area when it is not damaged, while the actual height Below this reference surface indicates the presence of material defects. The sum of the differences of all pixels in the region is calculated, which is essentially integrating the concave space of the entire damaged region based on spatial discrete sampling. The physical area of a single pixel is used as the integral infinitesimal, which collectively converts the depth information on the two-dimensional plane into volume information in three-dimensional space. Therefore, these independent variables collectively determine the size of the dependent variable representing the absolute volume loss. As the difference between the height of each pixel and the reference height increases, the concave at that pixel point becomes more significant, and the corresponding volume loss contribution also increases. Therefore, when the damaged region contains more pixels with greater depth, or the degree of concave of existing pixels is further deepened, the dependent variable, i.e. the absolute volume loss, will show a clear growth trend after the accumulation of these increased differences and the multiplication of the fixed pixel area.

[0048] The physical area of a single pixel is obtained through camera calibration parameters. The specific calibration method includes: using a standard calibration board, obtaining a calibration board image, and determining the actual physical size of each pixel in the image through corner point detection and coordinate system conversion. This calibration process needs to be carried out under the same imaging conditions as seed collection to ensure measurement accuracy.

[0049] Based on the initial three-dimensional height map, the total volume of the seed to be analyzed is calculated; specifically, the reference height is regarded as the base height of the seed, and the volume of the seed surface above the base height is calculated by summation, as follows: ; wherein, is the total volume of the seed to be analyzed, E represents the set of all pixel points occupied by the seed to be analyzed in the binary image, is the lowest point height of the entire seed region.

[0050] When calculating the total volume of the seed to be analyzed , the reference surface is set as the lowest point height of the entire seed region . This data is determined within the seed region through the initial three-dimensional height map, and the height values of all pixel points are traversed , and the minimum value in it is . This calculation method defines the three-dimensional entity volume of the seed as the space occupied from its lowest contact point on the support plane (corresponding to ) to the surface points, thereby establishing a unified and objective physical reference. Compared with using internal reference surfaces such as the average height of the damaged region, using as the reference can eliminate the base deviation introduced by different seeds or different poses of the same seed, and the calculated volume loss rate The severity of material loss caused by damage relative to the overall size of the seed can be more accurately reflected, and the physical consistency and comparability of the evaluation results are enhanced.

[0051] According to the absolute volume loss and the total volume of the seed, the volume loss rate of each final damage area is calculated, and the formula is as follows: ; Wherein, is the volume loss rate of the jth final damage area.

[0052] Dependent variable in the volume loss rate calculation formula Specifically reflects the percentage of the volume loss caused by the jth final damage area relative to the total volume of the seed. This relative quantitative index can effectively eliminate the influence of size difference between different seed individuals on the evaluation results. By normalizing the absolute volume loss to the proportion relative to the total volume of the seed, the parameter realizes the standardized measurement of the damage degree of seeds of different sizes, and the technical effect lies in that the damage evaluation results have comparability between seeds of different sizes, provides a reliable quantitative basis for establishing a unified damage determination standard, and significantly improves the accuracy and consistency of damage detection. In the calculation formula, when the total volume of the seed remains constant, the volume loss rate will show a linear growth trend with the increase of the absolute volume loss, indicating that the damage degree is aggravated; on the contrary, when the absolute volume loss is constant and the total volume of the seed increases, the volume loss rate will decrease accordingly, indicating that the same amount of damage has relatively less impact on larger seeds.

[0053] In the embodiment, the construction of the damage probability prediction model specifically includes: The area proportion and the absolute volume loss of all final damage areas are summed to obtain the total damage area proportion of the seed and the total absolute volume loss of the seed; the maximum value of the volume loss rate of all final damage areas is determined; and the total damage area proportion of the seed, the total absolute volume loss of the seed, and the maximum value of the volume loss rate of all final damage areas are combined with the multispectral feature vector to obtain a combined feature vector. The construction process of the combined feature vector specifically includes: first, three geometric feature parameters of each final damage area, i.e. the area proportion, the absolute volume loss, and the volume loss rate, are extracted; then these features are summarized and processed to calculate the total features at the seed level, including: the sum of the area proportions of all damage areas, the sum of the absolute volume losses of all damage areas, and the maximum value of the volume loss rate in all damage areas; finally, these total geometric features are spliced with the multispectral feature vector to form a combined feature vector for model training.

[0054] The multispectral feature vector is obtained by extracting the reflectance or absorption characteristics of the seed at different wavebands in a multispectral imaging system. Specifically, it includes the spectral response values at specific wavelengths such as visible light and near-infrared bands. These features can reflect the material properties, moisture distribution, and other physical and chemical properties of the seed surface. Combined with geometric features, they can more comprehensively describe the damage state of the seed.

[0055] Based on the above method, a group of sample seeds with known damage states are collected, and the combined feature vector of each sample seed is obtained. The expert scoring method is used to independently evaluate the damage of each sample seed based on the physical sample. The specific implementation of the expert scoring method is to invite multiple experienced seed quality evaluation experts to independently evaluate each sample seed. During the evaluation, the factors such as damage area, depth, and location are considered comprehensively through visual observation and tactile inspection, and a damage probability score between 0 and 1 is given, where 0 represents no damage and 1 represents complete damage. For example, for a seed with only a slight surface scratch, the score is about 0.1; for a seed with a small edge crack, the score is about 0.35; for a seed with an obvious crack in the embryo area, the score is about 0.7; for a severely broken seed, the score is higher than 0.8. Finally, the average value of the scores of multiple experts is taken as the training label of the sample seed.

[0056] Based on the logistic regression model, the combined feature vector of the group of sample seeds is taken as the input, and the corresponding damage probability value is taken as the label for model training to construct a damage probability prediction model. During model training, the optimal value of each weight coefficient is determined by maximum likelihood estimation method to make the model prediction result as close as possible to the expert score.

[0057] During the model training process, the specific values of multiple weight coefficients need to be determined. The determination method of these weight coefficients is as follows: first, collect a sufficient number of sample seeds (usually not less than 200), obtain the combined feature vector of each seed and the corresponding expert score label; then use optimization algorithms such as gradient descent or Newton method to minimize the difference between the model prediction value and the expert score, and determine the optimal value of each weight coefficient through iterative optimization. The specific value of the weight coefficient depends on the feature distribution of the training data set, and different varieties or batches of seeds may need to be retrained to obtain applicable weight coefficients.

[0058] The combined feature vector of the seed to be analyzed is input into the trained damage probability prediction model, and the damage probability value output by the model is compared with the preset damage threshold to determine whether the seed to be analyzed is damaged; The method for determining the damage threshold is as follows: after the model training is completed, the model performance is evaluated using the validation set seed samples, the ROC curve is drawn, and the Youden index is calculated to select the optimal threshold point as the damage threshold. Specifically, first, the true positive rate and false positive rate under different thresholds are calculated, then the Youden index (true positive rate + true negative rate - 1) corresponding to each threshold is calculated, and the threshold with the maximum Youden index is selected as the final damage threshold. This method can control the false detection rate while ensuring the detection sensitivity, achieving the best discrimination effect. The value range of the damage threshold is usually 0.3 to 0.7, and the specific value depends on the requirements of the actual application scenario for detection accuracy and recall rate. For seed quality detection scenarios with higher requirements, the threshold can be appropriately increased to 0.6-0.7 to reduce false detection; for preliminary screening scenarios, the threshold can be reduced to 0.3 to 0.5 to ensure a high detection rate.

[0059] The number of seeds determined to be damaged in a group of seeds to be analyzed is counted, and the proportion of damaged seeds in the group is calculated as the damage rate of the group of seeds to be analyzed. The calculation formula of the damage rate is: damage rate = (number of damaged seeds / total number of detected seeds) x 100%. This index can objectively reflect the quality status of the batch of seeds, providing an important reference for seed production and quality control.

[0060] To ensure the reliability of the detection results, the method further includes a model verification step: periodically verify the model using standard samples with known damage status, and when the model performance decreases by more than a preset range (such as a decrease in accuracy of more than 5%), re-collect training samples and update model parameters. This measure can ensure the long-term stable operation of the detection system and adapt to natural changes in seed characteristics. In addition, the method also takes into account the differences in characteristics of different seed varieties. For different types of sugar beet single embryo pelleted seeds, a dedicated prediction model needs to be established to ensure the accuracy of the detection results.

[0061] The above formulas are dimensionless values, and the formulas are obtained by software simulation of a large amount of data to reflect the current true situation. The preset parameters in the formula are set by a person skilled in the art according to the actual situation.

[0062] The above embodiments can be realized wholly or partially by software, hardware, firmware, or any combination thereof. When realized by software, the above embodiments can be realized in the form of a computer program product in whole or in part. Those skilled in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed by hardware or software methods depends on the specific application and design constraints of the technical solutions.

[0063] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, and may be located in one place, or distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment of the present application according to actual needs.

[0064] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A machine vision-based method for detecting the breakage rate of sweet potato germ pelleted seeds, characterized in that, The specific steps include: Step 1: Collect visible light and near-infrared images of the seeds to be analyzed under standard illumination, as well as non-standard visible light images under k light sources. Process the above images based on the reflectance calibration image group and the polarization difference correction image group to obtain visible light reflectance images, near-infrared reflectance images, and k non-standard visible light reflectance images. Step 2: Extract visible light image features and near-infrared image features based on visible light reflectance images and near-infrared reflectance images, and merge them to construct a multispectral feature vector; Step 3: Combine each non-standard visible light reflectance image and its corresponding light source direction vector to calculate the normal vector of each pixel in the seed region; generate an initial three-dimensional height map by performing field integration on the normal vector to extract the abnormal judgment features of the seed surface, and mark the suspected damaged area according to the abnormal judgment features and the preset judgment conditions. Step 4: Calculate the edge sharpness index of each suspected damaged area, remove the areas determined to be mechanically damaged, and output the final damaged area and its three-dimensional contour data; Step 5: Based on the 3D contour data, calculate the maximum value of the total damaged area percentage, total absolute volume loss, and volume loss rate of the final damaged area for each seed, and combine them with the multispectral feature vector as input data to construct a damage probability prediction model and determine the damage probability of the seed to be analyzed.

2. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 1, characterized in that, The reflectivity calibration image set includes a whiteboard image and a dark field image, and the polarization difference correction image set includes a parallel polarized light image and a vertically polarized light image. The acquisition logic for parallel polarized light images and vertical polarized light images is as follows: under standard illumination conditions equipped with a polarizing filter, parallel polarized light images and vertical polarized light images of the seed to be analyzed are acquired respectively to form a polarization difference correction image group. The acquisition logic for visible light images, near-infrared images, and non-standard visible light images is as follows: using an RGB color camera and a monochrome near-infrared camera with the same pixel level, visible light images and near-infrared images of the seeds to be analyzed are acquired simultaneously under standard lighting conditions. The two images are then image registered to transform them to the same coordinate system. The standard lighting condition is uniform lighting condition. Then, by controlling k different light sources with known directions to be lit sequentially, k non-standard visible light images of the seeds to be analyzed under different lighting conditions are acquired to form a set of non-standard visible light images used to generate the initial three-dimensional height map. The logic for processing the above images based on the reflectance calibration image group and the polarization difference correction image group is as follows: the visible light image, near-infrared image, and non-standard visible light image are processed by the reflectance calibration image group to obtain the visible light reflectance image to be corrected, the near-infrared reflectance image, and the non-standard visible light reflectance image to be corrected. Then, the polarization difference image group is used to perform polarization difference correction on the visible light reflectance image to be corrected and the non-standard visible light reflectance image to be corrected to obtain the visible light reflectance image and the non-standard visible light reflectance image.

3. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 1, characterized in that, Constructing the multispectral feature vector specifically includes: The visible light image features include color features and texture features. The color features are hue and saturation, and the texture features are GLCM contrast. The near-infrared image features include transmittance and LBP entropy. The visible light reflectance image is converted to the HSV color space and processed using the OTSU thresholding method to initially separate the background and foreground as seed candidate regions. For the initially separated foreground regions, the mean and standard deviation of hue and saturation of all pixels are calculated to define upper and lower thresholds for hue and saturation of the seed regions. The lower threshold for hue is... Hue upper limit threshold , The mean value of hue. The standard deviation of hue, and the lower limit threshold of saturation. Saturation upper limit threshold , The mean value of saturation. The standard deviation of saturation is the hue value in the foreground region falling within the range of saturation. , Within the range, and the saturation value falls within... The region consisting of pixels within the range is determined as the final seed region; the mean hue and mean saturation of all pixels within the seed region are calculated as the color features of the seed to be analyzed, and the seed region of the visible light reflectance image is converted into a grayscale image and its gray-level co-occurrence matrix is ​​calculated. The GLCM contrast of the seed region is calculated through the gray-level co-occurrence matrix as the texture feature. Based on the location of the seed region in the visible light reflectance image, the seed region is determined in the near-infrared reflectance image. In the seed region of the near-infrared reflectance image, the transmittance is calculated based on the red channel reflectance. The seed region in the image is then locally binarized to calculate the LBP entropy. Visible light image features and near-infrared image features are concatenated to construct a multispectral feature vector, represented as follows: ,in, This is a multispectral feature vector, where H represents hue and S represents saturation. Transmittance, For GLCM contrast, Let LBP be the entropy.

4. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 2, characterized in that, Generating the initial 3D height map specifically includes: Based on k visible light reflectance images, a photometric stereo vision algorithm is used to calculate the unit normal vector of each pixel within the seed region, specifically as follows: For each pixel within the seed region, the pixel brightness value at the same location in the k visible light reflectance images is extracted to form a k-dimensional observation vector. This vector is then simplified based on the reflectance function of the Lambertian surface, resulting in: ; in, Represents the observation vector. For surface reflectivity, For unit normal vector, The light source direction matrix is ​​k×3. This represents the three-dimensional row vector of the first light source. This represents the three-dimensional row vector of the second light source. This represents the three-dimensional row vector of the k-th light source; By solving the following overdetermined system of equations, namely The least-squares solution for the normal vector and albedo is obtained, and after normalization, the unit normal vector is obtained. Then, the surface gradient is extracted from the normal vector field using the following relation: , ,in, The component of the unit normal vector on the X-axis in three-dimensional space. The component of the unit normal vector on the Y-axis in three-dimensional space. Let p be the component of the unit normal vector on the Z-axis in three-dimensional space, p be the partial derivative of the height in the X direction, and q be the partial derivative of the height in the Y direction. Then, by solving the following Poisson equation and integrating the gradient field, an initial 3D height map is generated, as shown in the following formula: ; in, (x, y) represents the height of the pixel (x, y) in three-dimensional space, (p, q) represents the gradient field, and (x, y) is the position of the pixel.

5. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 3, characterized in that, The specific areas marked as suspected damage include: The anomaly detection features include Gaussian curvature, mean curvature, and local height difference; based on the initial 3D height map, the first and second partial derivatives of each pixel are calculated, and then the Gaussian curvature and mean curvature of each pixel are calculated according to the differential geometry formula; at the same time, the absolute value of the height difference between each pixel and its neighboring pixels in the initial 3D height map is calculated. The preset judgment conditions include geometric anomaly conditions and spectral verification conditions. The geometric anomaly conditions are as follows: ,in, Let (x, y) be the Gaussian curvature of the pixel. Let be the average curvature of pixel (x, y). This is the mean of the absolute values ​​of the height differences between a pixel (x, y) and its neighboring pixels. Represents logical OR, , , These represent the preset Gaussian curvature threshold, average curvature threshold, and height difference threshold, respectively. The spectral verification conditions are as follows: ,in, This represents the transmittance of a pixel (x, y). This represents the average transmittance of the neighboring pixels of pixel (x, y). This represents the standard deviation of the transmittance of the neighboring pixels of pixel (x,y). These are adjustable parameters; Pixels that simultaneously meet the geometric anomaly condition and the spectral verification condition are marked as suspected damaged points, and other pixels are marked as normal points. Output a binary image, setting the pixel value of suspected damaged points to 1 and the pixel value of normal points to 0. An 8-neighborhood scan is performed on the binary image, and all spatially adjacent pixels with a value of 1 are grouped into the same connected region. Each connected region is treated as an independent candidate for suspected damaged area. Based on a preset minimum damaged area threshold, candidates for suspected damaged areas that are smaller than the minimum damaged area threshold are removed, and the remaining candidates for suspected damaged areas are taken as suspected damaged areas.

6. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 5, characterized in that, Determining whether an injury is mechanical includes: N edge points are collected on the edge contour of each suspected damaged area. Based on the initial 3D height map, the height gradient magnitude of each edge point is calculated using the following formula: ; in, This represents the magnitude of the height gradient at pixel (x, y). Calculate the average and maximum values ​​of the height gradient amplitudes of all edge points in each suspected damaged area, and use them as the edge sharpness index. Based on the set mechanical damage judgment conditions, determine whether it is mechanical damage. The mechanical damage judgment conditions include: Condition 1: The average value of the height gradient amplitudes of all edge points is greater than the preset threshold for the average height gradient amplitude of normal damage; Condition 2: The maximum value of the height gradient amplitudes of all edge points is greater than the preset threshold for the maximum value of the height gradient amplitude of normal damage. If either judgment condition is met, the suspected damaged area is determined to be mechanical damage. The areas identified as having mechanical damage are removed from the suspected damage areas, and the remaining suspected damage areas are output as the final damage areas. The three-dimensional contour data corresponding to each final damage area is also output.

7. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 5, characterized in that, The three-dimensional contour data includes the coordinates and height of all pixels within the region. Based on the binary image of the seed to be analyzed, the number of pixels in each final damaged region is counted to calculate the area ratio, using the following formula: ; in, This represents the area percentage of the j-th ultimately damaged region within the entire seed to be analyzed. Let be the projected area of ​​the j-th final damaged region on the binary image, which is the number of pixels in that final damaged region. The total projected area occupied by the seed to be analyzed in the binary image is denoted as , which is the number of pixels of the seed to be analyzed in the binary image. j is the index of the final damaged area. Calculate the arithmetic mean of the heights of all pixels in all ultimately damaged areas as the baseline height; obtain the physical area of ​​a single pixel using camera calibration parameters, and compare the height of each pixel with the baseline height to calculate the absolute volume defect. The specific formula is as follows: ; in, This represents the absolute volume loss of the j-th ultimately damaged region. Let R(j) be the physical area of ​​a single pixel, and let R(j) represent the set of pixels within the j-th final damaged region. As the reference height, This represents the height of the pixel (x, y). Based on the initial 3D height map, the total volume of the seed to be analyzed is calculated. Specifically, the reference height is considered as the base height of the seed, and the total volume of the seed surface above the base height is calculated using the following formula: ; in, Let E represent the total volume of the seed to be analyzed, and let E represent the set of all pixels occupied by the seed in the binary image. This is the lowest point height in the entire seed region; Based on the absolute volume loss and the total seed volume, the volume loss rate of each ultimately damaged area is calculated using the following formula: ; in, Let be the volume loss rate of the j-th final damaged region.

8. The method for detecting the breakage rate of sweet potato germ pelleted seeds based on machine vision according to claim 7, characterized in that, Constructing the damage probability prediction model specifically includes: The area percentage and absolute volume loss of all ultimately damaged areas are summed to obtain the total damaged area percentage and total absolute volume loss of seeds; the maximum volume loss rate of all ultimately damaged areas is determined; the total damaged area percentage, total absolute volume loss of seeds, and the maximum volume loss rate of all ultimately damaged areas are combined with the multispectral feature vector to obtain the combined feature vector. Based on the above method, a set of sample seeds with known damage status is collected, and the combined feature vector of each sample seed is obtained. The damage assessment of each sample seed is independently performed by the expert scoring method according to the physical condition of the sample seed, and the damage probability value of each sample seed is determined as the training label. Based on the logistic regression model, the combined feature vector of the set of sample seeds is used as input, and its corresponding damage probability value is used as the label to train the model and build a damage probability prediction model. The combined feature vector of the seed to be analyzed is input into the trained damage probability prediction model. The damage probability value output by the model is compared with the preset damage threshold to determine whether the seed to be analyzed is damaged. The number of seeds identified as damaged in a group of seeds to be analyzed is counted, the proportion of damaged seeds in the group is calculated, and this proportion is used as the damage rate of the group of seeds to be analyzed.

Citation Information

Patent Citations

  • Food nondestructive testing model construction method based on machine vision

    CN119131260A

  • Industrial production part detection method based on machine vision

    CN120446134A

  • Rare metal processing quality detection method based on machine vision

    CN120598966A

  • Piston rod surface defect detection method and system based on visual detection

    CN120852399A

  • Multispectral fusion vision inspection device

    KR102843305B1

Cited By

  • Intelligent identification method and system for broken spherical grains

    CN121767366A

  • Machine vision-based beef pie green body defect online detection method

    CN121856271A