A method and device for sorting jujube seeds based on image recognition and a medium
By using multi-directional illumination imaging and photometric stereoscopic reconstruction technology, the problem of difficulty in characterizing the three-dimensional morphological features of jujube kernel surface in existing technologies has been solved, thereby improving the reliability and adaptability of jujube kernel sorting results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YULIN UNIV
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies are insufficient to effectively characterize the three-dimensional morphological features of jujube seed surface, resulting in inaccurate sorting results and an inability to adapt to morphological differences between different batches of samples.
By using multi-directional illumination imaging and photometric stereo reconstruction, surface normal distribution maps and relative height distribution maps are obtained. Combining contour consistency, normal solution residuals, and saturation pixel ratios, reconstruction reliability indicators are generated, and a batch benchmark parameter set is constructed for quality judgment.
It achieves quantitative characterization of the three-dimensional morphological features of jujube kernels, improves the reliability and adaptability of sorting results, effectively filters out unreliable data, and realizes adaptive calibration for morphological differences between different batches of raw materials.
Smart Images

Figure CN122425011A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method, device and medium for sorting jujube kernels based on image recognition. Background Technology
[0002] As a traditional Chinese medicine and food ingredient, the quality grade and sorting accuracy of jujube seed directly affect the quality stability and clinical efficacy of subsequent processed products. Currently, in the Chinese medicinal herb processing industry, the sorting of jujube seed largely relies on manual sensory inspection or simple mechanical screening. Manual sorting mainly depends on the operator's visual judgment of the particle appearance, plumpness, and surface texture, which suffers from high labor intensity and significant efficiency fluctuations. Meanwhile, some automated equipment attempts to use visible light imaging combined with two-dimensional image features for preliminary classification, extracting and comparing the appearance parameters of jujube seed such as color, shape, and size to achieve basic quality grading. However, such technical solutions based on conventional image processing can usually only obtain two-dimensional reflection intensity information of the object's surface, making it difficult to comprehensively capture the microscopic geometric structure of the jujube seed surface.
[0003] Existing two-dimensional image-based sorting methods, when applied to the quality analysis of jujube seeds, are easily affected by factors such as changes in lighting conditions, differences in material posture, and uneven reflectivity of individual surfaces, resulting in insufficient stability of feature extraction. Crucially, the quality grade of jujube seeds is closely related to its three-dimensional morphological parameters, such as the continuity of its ventral groove, surface wrinkles, depth of hidden cracks, and edge fullness. Conventional two-dimensional imaging techniques cannot effectively reconstruct these three-dimensional features, making it difficult for the sorting results to accurately reflect the internal quality and structural integrity of the particles. Furthermore, due to the natural morphological differences between jujube seeds from different origins and batches, sorting models with fixed parameters often exhibit poor adaptability and increased misclassification rates during execution. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an image recognition-based sorting method for jujube kernels, which solves the problems of existing technologies lacking effective characterization capabilities for the three-dimensional morphological features of jujube kernel surfaces and difficulty in adapting to the natural morphological drift between different batches of samples.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for sorting jujube kernels based on image recognition, comprising: single-kernel limited conveying of jujube kernels, establishing single-kernel numbering, obtaining a target area mask, and completing camera calibration, light source direction calibration, and mapping of image coordinates to conveying coordinates; performing multi-directional directional illumination imaging on valid jujube kernels, reconstructing surface normal distribution map, relative height distribution map, and fused reflection intensity map based on grayscale response under different illuminations, and generating a reconstruction reliability indicator; determining the major axis and ventral groove feature lines based on the target area mask, establishing a standard unfolded coordinate system, extracting parameters such as ventral groove continuity, wrinkle undulation, crack depth, edge integrity, and fullness, calculating quality judgment values in combination with batch benchmark parameter sets, and outputting category labels and sorting execution control codes; performing online sorting based on the sorting execution control code, conveying speed, and sorting execution position coordinates, and updating the batch benchmark parameter set based on the parameter results of superior jujube kernels.
[0007] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the specific steps of single-seed limited conveying of jujube seeds, establishing single-seed numbering, and obtaining a target area mask are as follows: The jujube seeds to be sorted are introduced into a vibrating cloth mechanism, causing the jujube seeds to transition from a piled state to a single-layer discrete state; the jujube seeds in the single-layer discrete state are then introduced one by one into limiting bearing grooves arranged sequentially along the conveying direction, so that each limiting bearing groove holds only one jujube seed; when the jujube seeds enter the imaging window along with the limiting bearing grooves, the jujube seeds that meet the single-seed recognition conditions are sorted... A unique single-grain number is assigned; a background reference image is acquired when no jujube seed passes through, and the corresponding current image is acquired when the jujube seed enters the imaging window; background difference processing is performed on the current image and the background reference image to obtain a difference image, and threshold segmentation is performed on the difference image to obtain a binary image; morphological processing and connected component extraction are performed on the binary image to obtain the connected region with the largest area as the target region mask for the jujube seed; the validity indicator of the jujube seed is determined based on the area, major axis length, minor axis length, and number of effective connected regions corresponding to the target region mask.
[0008] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the specific steps for completing camera calibration, light source direction calibration, and image coordinate to transport coordinate mapping are as follows: A calibration plate is placed on the plane of the imaging window; an area array camera is used to acquire images of the calibration plate and extract the image coordinates of the calibration points; the camera intrinsic and extrinsic parameters are solved by combining the actual spatial coordinates of the calibration points to obtain the camera calibration parameters; a standard diffuse reflection plane target plate is placed at the imaging window; directional light sources set around the area array camera are sequentially illuminated, and corresponding target plate images are acquired; based on the brightness distribution of the standard diffuse reflection plane target plate under different directional illuminations, the incident direction vector of each group of directional light sources relative to the camera coordinate system is solved by combining the target plate normal direction to obtain the light source direction parameters; a transport coordinate system is established, and the calibration plate is placed on the surface of the conveyor belt; images of the calibration plate are acquired, and the corresponding pixel coordinates of known transport coordinate points in the image are extracted; based on the correspondence between pixel coordinates and transport coordinate points, the mapping matrix from image coordinates to transport coordinates is solved to obtain the image coordinate to transport coordinate mapping parameters.
[0009] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the specific steps of reconstructing the surface normal distribution map, relative height distribution map, and fused reflection intensity map based on the grayscale response under different illuminations are as follows: Apply directional illumination in different directions sequentially to the effective jujube seeds within the imaging window, and simultaneously acquire the corresponding grayscale images; perform dark field correction and brightness normalization processing on the grayscale images to obtain corrected grayscale response images under each illumination direction; construct grayscale response vectors based on the light source direction parameters corresponding to each illumination direction and the grayscale response of each pixel under different illumination directions, and solve for the weighted normal vector of each pixel in the target area; normalize the weighted normal vectors to obtain the surface normal distribution map; calculate the surface gradient of each pixel in the target area based on the surface normal distribution map, and perform integral reconstruction or Poisson equation solution based on the surface gradient to obtain the relative height distribution map; perform weighted fusion of the corrected grayscale response images under each illumination direction to obtain the fused reflection intensity map.
[0010] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the generation of reconstruction reliability markers includes: extracting target region masks corresponding to different directional illumination images, calculating the cross-union ratio (CUI) between each target region mask, and obtaining the contour consistency coefficient; calculating the normal solution residual of each pixel based on the gray-level response vector, light source direction parameters, and weighted normal vector, and statistically analyzing the normal solution residual of each pixel in the target region to obtain the average residual; statistically analyzing the proportion of pixels with gray-level values exceeding the saturation threshold in the corrected gray-level response image to the total number of effective pixels in the target region to obtain the saturated pixel ratio; statistically analyzing the boundary truncation of the target region mask in the imaging window to obtain the target region integrity coefficient; comparing the contour consistency coefficient, average residual, saturated pixel ratio, and target region integrity coefficient with their corresponding thresholds; and generating a reconstruction reliability marker characterizing the reliability of the reconstruction result when the contour consistency coefficient is not lower than the contour consistency threshold, the average residual is not higher than the residual threshold, the saturated pixel ratio is not higher than the saturation ratio threshold, and the target region integrity coefficient is not lower than the integrity threshold.
[0011] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the specific steps for extracting parameters such as ventral groove continuity, wrinkle undulation, crack depth, edge integrity, and fullness are as follows: Extracting a set of jujube seed contour boundary points based on a target region mask, and determining the major axis direction of the jujube seed based on the second-order central moment of the contour boundary point set; extracting ventral groove feature lines based on the continuous valley structure extending along the major axis direction in the relative height distribution map, combined with the low-reflection constraint in the fused reflection intensity map; using the major axis direction as the first coordinate direction, and the direction formed by the unfolding of the envelope around the jujube seed surface as the second coordinate direction... Establish a standard unfolded coordinate system based on the coordinate direction; extract the continuity parameter of the ventral groove based on the ratio of the continuous projected length of the ventral groove feature line along the major axis to the measured length of the major axis; extract the wrinkle undulation parameter based on the average of the sum of squares of the local gradient magnitudes of the relative height distribution map under the standard unfolded coordinate system; extract the crack depth parameter based on the maximum height difference between the reference surface height and the relative height distribution map within the candidate crack area; extract the edge integrity parameter based on the ratio of the actual contour area to the reference template area; and extract the fullness parameter based on the weighted sum of the relative height values corresponding to all effective pixels under the standard unfolded coordinate system.
[0012] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the specific steps of calculating the quality judgment value and outputting the category label and sorting execution control code by combining the batch benchmark parameter group are as follows: Select jujube seeds in the current sorting batch that meet the reconstruction reliability requirements and have complete outlines as batch benchmark samples, and calculate the mean and standard deviation of the ventral groove continuity parameter, wrinkle undulation parameter, crack depth parameter, edge integrity parameter and fullness parameter respectively to form a batch benchmark parameter group; Based on the ventral groove continuity parameter, wrinkle undulation parameter, crack depth parameter, edge integrity parameter and fullness parameter of the jujube seed to be judged, and combined with the batch benchmark parameter group, perform normalized weighted calculation to obtain the quality judgment value; Based on the reconstruction reliability indicator, the quality judgment value, and the crack depth threshold and edge integrity threshold, classify the jujube seed to be judged, and output the category label of excellent, usable, rejected or re-inspection grade; Convert the category label into sorting execution control code corresponding to different sorting channels.
[0013] As a preferred embodiment of the image recognition-based jujube seed sorting method of the present invention, the online sorting based on the sorting execution control code, conveying speed, and sorting execution position coordinates specifically includes the following steps: obtaining the identification completion time and corresponding conveying coordinates when the jujube seed completes the quality judgment; calculating the predicted time when the jujube seed arrives at the sorting execution position based on the sorting execution position coordinates, identification completion time, corresponding conveying coordinates, and conveying speed; when the system time reaches the predicted time, controlling the corresponding sorting execution mechanism to act according to the sorting execution control code, so that the jujube seed enters the collection channel corresponding to the sorting execution control code; wherein, the collection channel includes a premium collection channel, a normal collection channel, a rejection collection channel, and a re-inspection collection channel.
[0014] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the image recognition-based jujube seed sorting method described in the first aspect of the present invention.
[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the image recognition-based jujube seed sorting method described in the first aspect of the present invention.
[0016] The beneficial effects of this invention are as follows: By using multi-directional directional illumination imaging and photometric stereoscopic 3D reconstruction, surface normal distribution maps and relative height distribution maps are obtained, realizing the quantitative characterization of 3D morphological features such as ventral grooves, wrinkles, and cracks in jujube kernels; by calculating contour consistency, normal solution residuals, saturated pixel ratios, and regional integrity, reconstruction reliability indicators are generated, realizing quality monitoring and credibility judgment of surface reconstruction results, and effectively filtering out unreliable data; by selecting reliable samples to construct batch benchmark parameter groups and combining them with morphological parameters for normalized weighted calculation to obtain quality judgment values, adaptive calibration for morphological differences in different batches of raw materials is achieved. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of an image recognition-based method for sorting jujube kernels.
[0019] Figure 2 This is a flowchart for single-particle limited-position conveying and data collection calibration.
[0020] Figure 3 This is a flowchart for multi-directional lighting and reconstruction reliability.
[0021] Figure 4 This is a flowchart for standard deployment, quality assessment, and online sorting. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a method for sorting jujube kernels based on image recognition, including the following steps: S1. Perform single-grain limited transport of jujube kernels, establish single-grain numbering, obtain target area mask, and complete camera calibration, light source direction calibration, and image coordinate mapping with transport coordinate mapping.
[0026] Furthermore, the jujube kernels to be sorted are subjected to vibrating cloth and single-kernel limiting conveying to obtain effective jujube kernels that enter the imaging window.
[0027] Furthermore, the jujube kernels to be sorted are added into the storage chamber of the vibrating cloth mechanism. Through the cooperation of the vibrating hopper, the guide trough and the limiting bearing conveyor belt, the jujube kernels are transformed from a piled state to a single-layer discrete state.
[0028] Furthermore, multiple limiting bearing grooves are sequentially arranged on the surface of the limiting bearing conveyor belt along the conveying direction, and each limiting bearing groove is used to accommodate a single jujube kernel.
[0029] Specifically, the width of the limiting bearing groove is greater than the average size of the short axis of a single jujube kernel and less than the width of two jujube kernels side by side. The depth of the limiting bearing groove is less than the average thickness of the jujube kernel. This is so that after the jujube kernel enters the limiting bearing groove, it can maintain a single-kernel limiting state and expose the upper surface of the jujube kernel to the imaging field of view.
[0030] Furthermore, the limiting bearing groove is preferably a shallow V-shaped groove or an arc-bottomed groove.
[0031] Furthermore, a slightly inclined guide surface is set at the outlet of the guide channel, so that when the jujube kernel enters the limiting bearing channel, one side edge will contact the bottom of the channel first. Under the combined action of the conveyor belt movement and the friction difference at the bottom of the limiting bearing channel, the kernel will roll in a controlled manner, so that the long axis of the jujube kernel will gradually become consistent with the conveying direction.
[0032] It should be noted that by making the jujube seeds form a discrete single-grain arrangement and achieve initial pose convergence before entering the imaging window, the effects of target overlap, boundary aliasing, and pose randomness in subsequent target region segmentation and image recognition can be reduced.
[0033] Single-grain effectiveness screening was performed on the jujube seeds before they entered the imaging window to obtain effective jujube seeds.
[0034] Furthermore, a pre-detection area is set in front of the imaging window to detect the material occupancy status in each limiting bearing groove.
[0035] Specifically, if only one connected target area is detected in the current limiting bearing groove, it is determined to be a candidate valid jujube kernel; if two or more connected target areas are detected, or the area of the detected target area exceeds the upper limit of the area of a single jujube kernel, it is determined to be an invalid jujube kernel or an abnormal sample.
[0036] Furthermore, the limiting bearing grooves that are determined to be invalid jujube kernels or abnormal particles are marked with bypass markers to prevent invalid jujube kernels or abnormal particles from entering the subsequent main image recognition process.
[0037] Establish individual seed numbers for each valid jujube seed that enters the imaging window.
[0038] Furthermore, when the jujube kernels enter the imaging window along the limiting and carrying conveyor belt, a unique single-kernel number is assigned to each jujube kernel that meets the single-kernel identification conditions.
[0039] Specifically, when the conveyor belt encoder detects that a certain limit bearing groove has reached the imaging trigger position, the controller reads the current limit bearing groove number and the current sampling cycle number, and establishes the single grain number of the current jujube kernel.
[0040] In this embodiment, the first The single effective jujube seed number is represented as: ; in, Indicates the first The individual number of each jujube seed. Indicates the first The sampling period number corresponding to each jujube seed. Indicates the first The serial number of the limiting bearing groove where the jujube kernel is located.
[0041] It should be noted that the single grain number... This is used to uniformly associate data of the same jujube kernel in subsequent multi-directional illumination imaging, surface normal distribution reconstruction, relative height distribution reconstruction, quality judgment value calculation, and sorting execution control processes, so as to avoid data mismatch in the preceding and following steps.
[0042] Images of valid jujube kernels entering the imaging window are acquired to obtain a mask of the target area.
[0043] Furthermore, within the imaging window, an initial image of the jujube seed is acquired using an area scan camera positioned above.
[0044] Furthermore, when no jujube seed passes through the imaging window, a background reference image is pre-acquired; in the... Once a jujube seed enters the imaging window, the corresponding current image is acquired.
[0045] Specifically, the first The current image corresponding to a single jujube seed is denoted as The background reference image is denoted as ,in, Represents image coordinates.
[0046] Furthermore, background subtraction processing is performed on the current image and the background reference image to obtain the difference image.
[0047] In this embodiment, the first The difference image corresponding to each jujube seed is represented as follows: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The difference value at that point.
[0048] It should be noted that the difference image is used to highlight the grayscale difference between the target area of the jujube seed and the background area, thus providing a basis for subsequent target area segmentation.
[0049] Thresholding is performed on the difference image to obtain a binary image.
[0050] Furthermore, based on the grayscale difference between the target area and the background area of jujube seed under stable background conditions, a background difference threshold is set. .
[0051] It should be noted that the background difference threshold is determined by statistically analyzing the difference grayscale distribution between multiple frames of background reference images collected when no jujube kernels are present and images containing a single jujube kernel. The grayscale boundary value that maximizes the separation between the target area and the background area is selected. Under the condition of 8-bit grayscale images, the value range is usually 10~40.
[0052] In this embodiment, the first The binary image corresponding to a single jujube seed is represented as follows: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The binary segmentation result at the location.
[0053] Where the difference value is not less than the background difference threshold When the difference value is less than the background difference threshold, the current pixel is identified as a pixel in the target region; when the difference value is less than the background difference threshold, the current pixel is identified as a pixel in the target region. When the current pixel is identified as a background pixel, it is determined to be a background pixel.
[0054] Morphological processing and connected component extraction are performed on the binary image to obtain the target region mask.
[0055] Furthermore, morphological opening operations are performed on the binary image to remove isolated noise points; then morphological closing operations are performed to fill local holes.
[0056] Furthermore, connected regions are extracted from the morphologically processed binary image, and the connected region with the largest area is selected as the candidate target region for the current jujube seed.
[0057] Furthermore, the candidate target regions are denoted as target region masks. .
[0058] In this embodiment, the first The area of the target region corresponding to each jujube seed is represented as: ; in, Indicates the first The target area for each jujube seed. Indicates the first The image region where the jujube seed is located. The value can be 0 or 1.
[0059] It should be noted that the target area mask The sum of all pixels with a value of 1 is accumulated, and the result is the area of the target region of the current jujube seed in the image.
[0060] Furthermore, the target area mask Calculate the length of the major axis of the minimum circumscribed rectangle. and minor axis length The validity of a single jujube seed is determined by combining the number of connected regions.
[0061] In this embodiment, the first The efficacy markers corresponding to jujube seed kernels are represented as follows: ; in, Indicates the first The efficacy markers of jujube seed kernels, and These represent the lower and upper threshold values for the target area of a single jujube seed, respectively. and These represent the lower and upper threshold values for the aspect ratio of a single jujube seed, respectively. Indicates the first The number of effective connected regions in an image for each jujube seed.
[0062] It should be noted that a single jujube kernel is considered a valid jujube kernel only if the area of the target region is within a reasonable range for a single jujube kernel, the aspect ratio is within a preset range, and the number of effectively connected regions is 1.
[0063] It should be noted that the lower and upper threshold values of the target area of a single jujube seed are determined by conversion based on the common external dimensions of jujube seeds after pixel size calibration is completed, and the value range is usually 20 to 50 mm² corresponding to the number of pixels; the lower and upper threshold values of the aspect ratio of a single jujube seed are determined based on the common aspect ratio of jujube seeds, and are usually 0.71 to 1.80, preferably 0.90 to 1.60.
[0064] The area scan camera in the imaging window is calibrated to obtain camera calibration parameters.
[0065] Furthermore, during the system startup phase, the calibration board is placed on the plane of the imaging window, and an area scan camera is used to acquire images of the calibration board.
[0066] Furthermore, the image coordinates of each calibration point in the calibration board are extracted, and combined with the known coordinates of each calibration point in actual space, the intrinsic and extrinsic parameters of the area array camera are solved.
[0067] In this embodiment, the camera imaging relationship is represented as follows: ; in, Represents image coordinates, Represents actual spatial coordinates, Indicates the scaling factor. This represents the camera intrinsic parameter matrix. Represents the camera rotation matrix. This represents the camera translation vector.
[0068] It should be noted that the camera imaging relationship is used to establish the geometric correspondence between the position of the jujube seed in actual space and its pixel position in the image, providing a calibration basis for subsequent image recognition and position mapping.
[0069] The light source direction is calibrated for multiple sets of directional light sources to obtain the light source direction parameters.
[0070] Furthermore, a standard diffuse reflective planar target plate is placed at the imaging window, and each set of directional light sources set around the area array camera is illuminated in sequence, and the corresponding target plate images are acquired.
[0071] Furthermore, based on the brightness distribution of the standard diffuse reflection plane target under different incident light directions, and combined with the known normal direction of the target, the incident direction vector of each group of directional light sources relative to the camera coordinate system is solved.
[0072] In this embodiment, the light source direction parameter is expressed as: ; in, Represents the set of light source direction parameters. These represent the unit incident direction vectors corresponding to the four groups of directional light sources.
[0073] It should be noted that the light source direction parameters This is used for subsequent reconstruction of the surface normal distribution based on multi-directional directional illumination images.
[0074] Establish a mapping between image coordinates and transport coordinates, and obtain the mapping parameters from image coordinates to transport coordinates.
[0075] Furthermore, a conveying coordinate system is established by taking the running direction of the limit-bearing conveyor belt as the longitudinal coordinate direction and the direction perpendicular to the conveying direction as the transverse coordinate direction.
[0076] Furthermore, the calibration plate is placed on the surface of the conveyor belt, an image of the calibration plate is acquired, and the corresponding pixel coordinates of multiple known conveyor coordinate points in the image are extracted. The mapping matrix from the image coordinates to the conveyor coordinates is solved by plane homography.
[0077] In this embodiment, the mapping relationship between image coordinates and transport coordinates is expressed as follows: ; in, Represents image coordinates, Indicates the transport coordinates. Indicates the scaling factor. This represents the mapping matrix from image coordinates to transport coordinates.
[0078] It should be noted that the image coordinates to transport coordinates mapping matrix It is used to map the position of jujube kernels in the image to the conveyor belt coordinate system to support the timing control of subsequent sorting operations.
[0079] Furthermore, the target area mask Calculate the position of the centroid to determine the first The jujube seed is located in the center of the image.
[0080] In this embodiment, the first The centroid coordinates of a single jujube seed are represented as follows: ; ; in, Indicates the first The centroid coordinates of a jujube seed in the image.
[0081] It should be noted that the centroid coordinates Substitute image coordinates into the transport coordinate mapping matrix In this way, the current position of the jujube kernel in the transport coordinate system can be obtained.
[0082] Finally, the basic data acquisition package for the current jujube seed kernel is established.
[0083] In this embodiment, the first The basic data acquisition package corresponding to each jujube seed is represented as follows: ; in, Indicates the first The basic data acquisition package corresponding to each jujube seed. Indicates the single-grain number, Indicates a validity indicator. Indicates the target area mask. Indicates camera calibration parameters, Indicates the light source direction parameter, This represents the parameters for mapping image coordinates to transport coordinates.
[0084] It should be noted that by establishing a basic data acquisition package, subsequent multi-directional illumination imaging, surface normal distribution reconstruction, relative height distribution reconstruction, and sorting control steps can all be processed using the same jujube kernel as the data object, thereby ensuring the continuity and consistency of the entire method in the data link.
[0085] S2. Perform multi-directional directional illumination imaging on the effective jujube kernels, reconstruct the surface normal distribution map, relative height distribution map, and fused reflection intensity map based on the grayscale response under different illuminations, and generate reconstruction reliability indicators.
[0086] Multi-directional illumination imaging was performed on targets identified as valid jujube kernels to obtain image sequences of jujube kernels under different illumination directions.
[0087] Furthermore, regarding validity markers The The process of initiating multi-directional directional illumination imaging using jujube kernels.
[0088] Furthermore, an area scan camera is positioned above the imaging window, and at least four sets of directional light sources in different directions are arranged around the area scan camera. The directional light sources of each set are aligned with the calibrated light source direction parameters. One-to-one correspondence.
[0089] Specifically, when the After a jujube seed enters the imaging trigger position, the controller sequentially illuminates four sets of directional light sources according to a fixed timing sequence, and synchronously triggers the area array camera to acquire corresponding images during the illumination of each set of directional light sources, thereby obtaining image sequences of the same jujube seed under different illumination directions.
[0090] In this embodiment, the first Images of jujube kernels obtained under four sets of directional illumination conditions are denoted as follows: ; in, , , and They represent the first The image coordinates of a jujube seed under illumination from the first, second, third, and fourth groups of directional light sources. The grayscale image obtained from the location.
[0091] It should be noted that by acquiring images of the same jujube seed under multiple known incident directions, the local normal distribution of the jujube seed surface can be reconstructed by utilizing the grayscale changes at the same location under different incident light directions, thus providing a basis for subsequent surface morphology analysis.
[0092] Image sequences under different lighting directions are preprocessed to obtain corrected multi-directional grayscale response images.
[0093] Furthermore, for image sequences , , and Dark field correction and brightness normalization are performed frame by frame to eliminate dark current noise in the imaging system and intensity deviations between different directional light sources.
[0094] Specifically, a dark-field reference image was acquired under conditions of no jujube seed target and no effective external light input, and denoted as... Standard diffuse reflection reference images were acquired under the stable illumination state of each group of directional light sources, and the corresponding normalized brightness reference values were obtained.
[0095] Furthermore, regarding the first Original image under directional light source illumination Correction is performed to obtain the corrected grayscale response image. .
[0096] In this embodiment, the first The first jujube seed in The corrected grayscale response image under directional illumination is represented as follows: ; in, Indicates the first The first jujube seed in Group of directional lighting at image coordinates The corrected grayscale response value at that location, Represents the original grayscale image. Represents a dark-field reference image. Indicates the first The brightness normalization coefficient corresponding to the group of directional light sources.
[0097] It should be noted that the brightness normalization coefficient was determined by collecting data on a standard diffuse reflection reference plate under conditions without jujube seed obstruction. The average gray value under directional light source illumination is determined by the ratio of the reference gray value to the average gray value.
[0098] It should be noted that by subtracting the dark field reference image from the original image and dividing by the brightness normalization coefficient, a unified grayscale response scale can be established between images with different directional lighting, reducing the systematic deviation caused by differences in light source brightness.
[0099] Reconstruct the surface normal distribution map based on the grayscale response under different lighting directions.
[0100] Furthermore, masking in the target area Within the defined area, the grayscale response value of each target pixel under the illumination conditions of each directional light source is extracted, and the grayscale response vector of that pixel is constructed.
[0101] Specifically, for the first Ziziphus jujuba seed in image coordinates The grayscale response vector at point is denoted as: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The multi-directional grayscale response vector at that location.
[0102] Furthermore, based on the obtained light source direction parameters Establish the lighting matrix: ; in, This represents the illumination matrix composed of the unit incident direction vectors of each group of directional light sources.
[0103] Furthermore, based on the Lambert reflection approximation model, the surface of the jujube seed is mapped to the image coordinates... The product of the albedo and the normal vector at a given point is denoted as... Then we have: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The weighted normal vector at that location.
[0104] It should be noted that the weighted normal vector Including surface normal direction information and local albedo information, the surface normal direction of the current location of the jujube seed can be obtained by solving the weighted normal vector.
[0105] Furthermore, for the weighted normal vector By performing least squares calculation, the weighted normal vector is obtained: ; in, For the first Ziziphus jujuba seed in image coordinates The result of solving for the weighted normal vector at the location.
[0106] It should be noted that the lighting matrix The rank is not less than 3.
[0107] Furthermore, for the weighted normal vector After normalization, the surface normal distribution map is obtained.
[0108] In this embodiment, the first Ziziphus jujuba seed in image coordinates The surface normal vector at that location is expressed as: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The surface normal vector at that location, This represents the magnitude of the weighted normal vector.
[0109] It should be noted that by combining the surface normal vectors corresponding to all pixels within the target area, the first pixel can be obtained. Surface normal distribution diagram of jujube kernel.
[0110] It should be noted that the surface normal distribution map is used to reflect the tilt direction and local geometric changes at various locations on the surface of the jujube seed.
[0111] Reconstruct the relative height distribution map based on the surface normal distribution map.
[0112] Furthermore, since there is a correspondence between the surface normal vector and the gradient of the surface height function, the local slope of the jujube seed surface can be calculated based on the surface normal distribution map.
[0113] Specifically, let the first Ziziphus jujuba seed in image coordinates The surface normal vector at that location is expressed as: ; in, , and They represent the first Ziziphus jujuba seed in image coordinates The surface normal vector at direction, direction and Components in direction.
[0114] Furthermore, based on the relationship between the normal component and the surface gradient, the first... Ziziphus jujuba seed in image coordinates The surface gradient at that point is expressed as: ; ; in, Indicates the first Ziziphus jujuba seed in image coordinates along Surface gradient in direction, Indicates the first Ziziphus jujuba seed in image coordinates along Surface gradient in the direction.
[0115] It should be noted that, Not zero.
[0116] It should be noted that the surface gradient is used to characterize the rate of change of the surface height of jujube seed in each direction.
[0117] Furthermore, based on the surface gradient and The relative height distribution map is obtained by performing integral reconstruction or solving the Poisson equation within the target area.
[0118] In this embodiment, the first The relative height distribution diagram of each jujube seed is denoted as follows: .
[0119] Furthermore, to ensure reconstruction stability, a target area mask is used. The defined region is used as the integration region, and the initial value of the relative height on the boundary of the target region is set as the zero datum plane.
[0120] It should be noted that the relative height distribution map The height distribution map is used to reflect the relative undulation of the surface of jujube kernels. The values of the height distribution map represent the relative height with respect to the preset reference surface, rather than the absolute spatial height.
[0121] The relative height distribution map can further characterize the abdominal groove structure, local collapse, crack depression and edge undulation features of jujube seed.
[0122] A blended reflection intensity map is generated based on the grayscale response under different lighting directions.
[0123] Furthermore, in order to preserve the comprehensive colorimetric response and local reflectance intensity information of the jujube seed surface, the corrected grayscale response images are fused to generate a fused reflectance intensity map.
[0124] Specifically, for the first Corrected grayscale response images of jujube kernels under various directional illumination conditions , , and Perform a weighted summation.
[0125] In this embodiment, the first The fusion reflection intensity map corresponding to a single jujube seed is shown as follows: ; in, Indicates the first Ziziphus jujuba seed in image coordinates The fusion reflection intensity value at that location, Indicates the first The fusion weights corresponding to the group of directional lighting images are such that the sum of all fusion weights is 1.
[0126] It should be noted that the fusion weight is determined by statistical analysis of the first... The average signal-to-noise ratio or grayscale stability index of the group of directional illumination images in the target area is determined after normalization of the index of each group of directional illumination images. The value range is usually 0~1, and the sum of the fusion weights of each group is 1. When four groups of directional illumination images are used and the image quality of each group is similar, the fusion weight can usually be 0.20~0.30, preferably 0.25.
[0127] It should be noted that the fused reflection intensity map It is used to preserve the comprehensive color, light and dark distribution and local reflection anomaly information of the jujube seed surface, so that it can be used in conjunction with the relative height distribution map in the subsequent crack area identification, edge area identification and morphology parameter extraction process.
[0128] Reconstruction reliability flags are generated based on image consistency and reconstruction quality.
[0129] Furthermore, to avoid reconstruction errors caused by motion blur of jujube seeds, local strong reflections, missing boundaries, or multi-directional image mismatch, the first... The reconstruction process of jujube kernels generates a reconstruction reliability indicator.
[0130] Specifically, calculate the first... The contour consistency, grayscale response saturation ratio, target region integrity, and normal solution residual of a jujube seed grain across different directional lighting images are evaluated, and the reliability of the reconstruction of the jujube seed grain is determined based on a comprehensive assessment of these indicators.
[0131] Furthermore, regarding the first The contour uniformity of each jujube seed was calculated.
[0132] Specifically, the target region masks extracted by thresholding in images with different directional illumination are respectively denoted as... , , and Calculate the crossover ratio of the masks for each target region and obtain the contour consistency coefficient.
[0133] In this embodiment, the first The profile uniformity coefficient of jujube seed kernels is expressed as: ; in, Indicates the first Profile uniformity coefficient of jujube kernel under different directional light conditions This indicates the number of pixels at the intersection of the masks for each target region. This represents the number of pixels in the union of the masks for each target region.
[0134] It should be noted that when the contour consistency coefficient is low, it usually indicates that the jujube seed has motion displacement, local occlusion, or unstable target edge during the collection process, which may reduce the reliability of surface normal and relative height reconstruction.
[0135] Furthermore, the residuals of the normal solution are calculated to evaluate the degree of fit between the gray-scale response of different directional lighting and the obtained surface normal.
[0136] In this embodiment, the first Ziziphus jujuba seed in image coordinates The residual obtained by solving for the normal at a point is expressed as: ; in, Indicates the first Ziziphus jujuba seed in image coordinates Solve for the residuals in the normal direction at the location.
[0137] Furthermore, the residuals of the normal vectors of all pixels within the target region are averaged to obtain the first... The average residual of each jujube seed is expressed as: ; in, Indicates the first The average residual of each jujube seed, Indicates the first The total number of valid pixels within the target area of a jujube seed.
[0138] It should be noted that when the average residual is large, it usually indicates that the grayscale response of the current jujube seed surface does not match the preset lighting model, which may be caused by strong reflection, surface contamination or image distortion.
[0139] Furthermore, the saturation pixel ratio and target region integrity are calculated.
[0140] Specifically, the proportion of pixels in the corrected grayscale response image whose grayscale values exceed the saturation threshold to the total number of effective pixels in the target area is denoted as the saturation pixel ratio. Simultaneously, the proportion of the non-truncated area of the target region mask within the imaging window to the total area of the target region is recorded as the target region integrity coefficient. .
[0141] It should be noted that the saturation pixel ratio Used to reflect the degree of strong reflection or overexposure, target area integrity coefficient This is used to reflect whether the jujube seed target has completely entered the imaging window.
[0142] It should be noted that the saturation threshold is obtained by calibrating the upper limit of the grayscale of the corrected grayscale response image output by the imaging system under the current exposure time and gain conditions, and taking a fixed proportion value close to the upper limit of grayscale as the judgment threshold. If an 8-bit grayscale image is used, the saturation threshold is usually 230 to 250, preferably 240 to 245; if a normalized grayscale image is used, it is usually 0.90 to 0.98, preferably 0.94 to 0.96.
[0143] Reconstruction reliability flags are generated based on contour consistency coefficient, average residual, saturated pixel ratio, and target region integrity coefficient.
[0144] Furthermore, a contour consistency threshold is set. Residual threshold Saturation ratio threshold and integrity threshold And generate the first according to the following rules Reliability markers for the reconstruction of jujube seed kernels.
[0145] It should be noted that the contour consistency threshold is determined by extracting the target region mask from multiple effective jujube seeds under various directional lighting conditions, statistically analyzing the distribution of the target region mask contour consistency coefficient, and based on the lower boundary value of the effective sample contour consistency coefficient, typically ranging from 0.80 to 0.95; the residual threshold is determined by solving the surface normal of multiple effective jujube seeds, statistically analyzing the average residual distribution of the normal solution for each effective sample, and based on the upper boundary value of the effective sample average residual distribution, typically ranging from 0.02 to 0.10; the saturation ratio threshold is determined by statistically analyzing the saturation pixel ratio distribution of multiple effective jujube seeds under various directional lighting conditions, and based on the upper boundary value of the effective sample saturation pixel ratio distribution, typically ranging from 0.01 to 0.10; and the integrity threshold is determined by statistically analyzing the integrity coefficient distribution of the target region within the imaging window of multiple effective jujube seeds, and based on the lower boundary value of the effective sample integrity coefficient distribution, typically ranging from 0.85 to 0.98.
[0146] In this embodiment, the first The reliability criterion for the reconstruction of jujube seed kernels is expressed as: ; in, Indicates the first Reliability markers for the reconstruction of jujube seed kernels.
[0147] It should be noted that when the contour consistency coefficient is not lower than the contour consistency threshold, the average residual is not higher than the residual threshold, the saturated pixel ratio is not higher than the saturation ratio threshold, and the target region integrity coefficient is not lower than the integrity threshold, the reconstruction result of the current jujube seed is considered reliable. Otherwise, the current reconstruction result of jujube seed is deemed unreliable, and... .
[0148] Finally, the corresponding reconstruction result data package is created.
[0149] In this embodiment, the first The reconstruction result data package corresponding to each jujube seed is represented as follows: ; in, Indicates the first The reconstruction result data package corresponding to each jujube seed. Indicates the single-grain number, Indicates the target area mask. This represents the surface normal distribution diagram. This represents a map showing the relative height distribution. This represents the fused reflection intensity map. This indicates the reliability of the reconstruction.
[0150] It should be noted that by establishing a reconstruction result data package, a unified data input can be provided for subsequent standard expansion coordinate system establishment, groin continuity extraction, crack depth identification, edge integrity analysis, fullness calculation, and quality judgment value generation, thereby ensuring that the data link of each subsequent step is continuous, the input is complete, and the processing objects are consistent.
[0151] S3. Determine the major axis and ventral groove feature lines based on the target area mask, establish a standard unfolded coordinate system, extract parameters such as ventral groove continuity, fold undulation, crack depth, edge integrity, and fullness, calculate the quality judgment value in combination with the batch baseline parameter group, and output the category label and sorting execution control code.
[0152] The main direction of the jujube seed contour is determined based on the target area mask, and the long axis direction is obtained.
[0153] Furthermore, regarding the first Target area mask corresponding to a jujube seed Extract contour points to obtain the target boundary point set.
[0154] Furthermore, the second central moment of the jujube seed in the image plane is calculated based on the target boundary point set, and the principal direction of the second central moment is used as the major axis direction of the current jujube seed.
[0155] Specifically, first, based on the target area mask... Calculate the first The centroid coordinates of a jujube seed Then, using the centroid coordinates as the center, calculate the discrete distribution of each target pixel relative to the centroid.
[0156] In this embodiment, the first The second-order central matrix of a jujube seed is represented as: ; in, Indicates the first The second-order central moment matrix of a jujube seed. , and They represent the first The second-order central moment component of a jujube seed relative to its center of mass.
[0157] Furthermore, for the second-order central matrix Perform eigenvalue decomposition, and take the direction of the eigenvector corresponding to the largest eigenvalue as the first eigenvalue. The long axis direction of a jujube seed.
[0158] In this embodiment, the first The major axis direction angle of a jujube seed is represented as: ; in, Indicates the first The orientation angle of a jujube seed relative to the major axis of the horizontal coordinate axis of the image.
[0159] It should be noted that calculating the major axis direction through the target area mask can provide a geometric basis for unifying jujube kernels in different postures to the same directional reference, thereby reducing feature drift caused by different placement postures.
[0160] The ventral groove feature line is determined based on the relative height distribution map and the fused reflection intensity map.
[0161] Furthermore, the ventral groove region of jujube seed typically extends along the long axis and appears as a continuous valley structure along the long axis on the relative height distribution map, while it typically appears as a local low reflectance or shadow band on the fused reflectance intensity map.
[0162] Furthermore, given the direction of the major axis... Under the condition that, the first Relative height distribution diagram of jujube kernels Rotate to an intermediate coordinate system in which the major axis is aligned with the preset reference direction, so as to search for continuous concave trajectories along the major axis.
[0163] Specifically, in the direction perpendicular to the major axis, the relative height distribution map... Local troughs were searched for on each cross section, and the results were combined with the fused reflection intensity map. The low-reflection constraint is used to obtain a set of candidate groin points.
[0164] Furthermore, path continuity constraints and local smoothing fitting are applied to the candidate groin point set to obtain the first... The characteristic ventral groove of a jujube seed.
[0165] In this embodiment, the first The characteristic line of the ventral groove of a jujube seed is denoted as .
[0166] It should be noted that the abdominal groove feature line The structure is used to characterize the main depression structure extending along the long axis of the surface of jujube kernel. This structure is a key benchmark for the subsequent establishment of a standard unfolded coordinate system and the extraction of the continuity parameters of the ventral groove.
[0167] Establish a standard unfolded coordinate system based on the major axis direction and the ventral groove feature line.
[0168] Furthermore, with the first Using the long axis of the jujube seed as the first coordinate direction, and the direction formed by the unfolding of the envelope around the jujube seed surface as the second coordinate direction, a third coordinate system is established. The standard coordinate system for the development of jujube kernels.
[0169] Specifically, first, the relative height distribution map Fusion reflection intensity map and target area mask According to the major axis direction angle Rotate to a unified reference direction so that the major axis direction is consistent with the longitudinal coordinate direction in the standard unfolded coordinate system.
[0170] Furthermore, using the groin feature line As the zero reference line for unfolding, the surface of the jujube seed is resampled along the direction perpendicular to the major axis, and the surface information in the original image coordinate system is mapped to the surface information in the standard unfolded coordinate system.
[0171] In this embodiment, the first The standard coordinate system for the development of a jujube seed is denoted as: ,in, Represents the unfolded coordinates along the major axis. Represents the coordinates along the lateral envelope of the surface.
[0172] It should be noted that a standard coordinate system is established. It can unify the jujube kernels under different postures and local angles into the same standard surface expression form, so that the morphological parameters extracted later are comparable.
[0173] Extract the continuity parameters of the abdominal groove in the standard expanded coordinate system.
[0174] Furthermore, the groin feature line Projected onto standard unfolded coordinate system In addition, the continuous coverage length along the long axis is statistically analyzed.
[0175] Specifically, the length of the continuous projection of the abdominal groove feature line along its major axis is denoted as... , record the The measured length of the major axis of a jujube seed in a standard coordinate system is: .
[0176] In this embodiment, the first The continuity parameter of the ventral groove of a whole jujube seed is expressed as: ; in, Indicates the first The continuity parameter of the ventral groove of jujube seed kernels. This represents the continuous projection length of the groin feature line along its major axis. Indicates the first Measured length of the long axis of a jujube seed.
[0177] It should be noted that when the groin feature line can extend continuously along the long axis, the groin continuity parameter... Larger; when the groin feature line is interrupted, partially closed, or partially missing, the groin continuity parameter is... The value is relatively small; among them, the abdominal groove continuity parameter is used to characterize the integrity of the abdominal groove structure of jujube seed.
[0178] Extract the fold undulation parameters in the standard unfolded coordinate system.
[0179] Furthermore, the wrinkled structure on the surface of jujube kernels appears as a local continuous undulation in the relative height distribution map, and the gradient modulus of the wrinkled structure can reflect the density of the wrinkles and the intensity of the undulation.
[0180] Specifically, in the standard expanded coordinate system In the middle, for the first Relative height distribution diagram of jujube kernels Calculate the local gradient and average the squared gradient magnitudes of all valid pixels to obtain the wrinkle undulation parameters.
[0181] In this embodiment, the first The wrinkle undulation parameter of a jujube seed is expressed as: ; in, Indicates the first Parameters of wrinkle undulation in jujube kernel. Indicates the first The total number of valid pixels of a jujube seed in a standard expanded coordinate system. Indicates the first The coordinates of each valid pixel. Indicates the first The magnitude of the relative height gradient of each effective pixel.
[0182] It should be noted that the fold undulation parameters The larger the value, the more drastic the change in surface height of the jujube seed; the higher the fold undulation parameter. The smaller the value, the smoother the surface of the jujube seed; the wrinkle undulation parameter is used to characterize the overall degree of undulation of the wrinkles on the surface of the jujube seed.
[0183] Crack depth parameters are extracted in the standard unfolded coordinate system.
[0184] Furthermore, the cracked areas on the surface of jujube kernels typically appear as localized, elongated valley structures in the relative height distribution map, and are usually accompanied by narrow low-reflection areas or abrupt bright-dark boundaries in the fused reflection intensity map.
[0185] Furthermore, based on the relative height distribution map and the fused reflection intensity map, candidate crack regions are extracted in the standard unfolded coordinate system and denoted as... .
[0186] Specifically, within each candidate crack region, the relative height of the boundary points on both sides of the crack is used as the fitting input to construct the corresponding reference surface height. Then, calculate the maximum height difference between the relative height distribution map within the candidate crack area and the reference surface.
[0187] In this embodiment, the first The crack depth parameter of a jujube seed kernel is expressed as: ; in, Indicates the first Crack depth parameters of jujube kernels. Indicates the first Candidate crack regions for jujube kernels. This represents the reference surface height obtained by fitting the data based on the boundary points on both sides of the crack region. Indicates the first The relative height distribution of jujube kernels in a standard expanded coordinate system.
[0188] It should be noted that the crack depth parameter is used to quantify the maximum degree of indentation of the crack relative to the local normal surface, and can reflect whether there is obvious fracture or mechanical damage on the surface of the jujube seed.
[0189] Extract edge integrity parameters in the standard unfolded coordinate system.
[0190] Furthermore, the first The actual contour area of a jujube seed in a standard expanded coordinate system is denoted as and according to the first The length and width dimensions of a jujube seed are used to generate the corresponding reference template area. .
[0191] Specifically, the area of the reference template It can be determined by the reference template that is closest to the current jujube seed's major axis length and minor axis length from a pre-built standard jujube seed shape template library.
[0192] It should be noted that the standard jujube seed shape template library is generated by collecting complete, undamaged jujube seed sample images that have been manually verified as qualified, registering, normalizing and calculating the mean of the target contours of each sample, and then clustering them according to the major axis length, minor axis length and contour shape to generate a set of standard contour templates for the corresponding categories.
[0193] In this embodiment, the first The edge integrity parameter of a jujube seed kernel is expressed as: ; in, Indicates the first Edge integrity parameters of jujube kernels. Indicates the first The actual contour area of a jujube seed in a standard coordinate system. This represents the area of the reference template corresponding to the current length and width dimensions of the jujube seed.
[0194] It should be noted that when the edges of the jujube seed are chipped, broken, or damaged, the actual outline area of the jujube seed will be smaller relative to the area of the reference template. Therefore, the edge integrity parameter will be affected. It will decrease; the edge integrity parameter is used to characterize the integrity of the edge contour of jujube seed.
[0195] Extract the fullness parameter in the standard unfolded coordinate system.
[0196] Furthermore, the plumpness of jujube seeds can be approximately represented by the total integral of the relative height distribution map in the entire standard unfolded coordinate system.
[0197] Specifically, for the first The fullness parameter of a jujube seed is obtained by weighted summation of the height values of all valid pixels in the standard unfolded coordinate system.
[0198] In this embodiment, the first The plumpness parameter of a jujube seed is expressed as: ; in, Indicates the first Parameters for the plumpness of jujube kernels. Indicates the first The first jujube seed in The relative height value at each valid pixel. This represents the area weight corresponding to a single expanded pixel.
[0199] It should be noted that when the overall surface of the jujube seed is full and undulating with few local collapses, the jujube seed fullness parameter is considered to be... The plumpness parameter of jujube seeds is relatively large; when there are shriveled, collapsed, or low-lying areas on the surface caused by insufficient internal tissue, the plumpness parameter of jujube seeds is relatively large. Smaller.
[0200] It should be noted that the area weight corresponding to a single unfolded pixel is determined by calibrating the pixel size of the imaging system and combining the coordinate scaling ratio during resampling in the standard unfolded coordinate system. The actual area corresponding to a single unfolded pixel in the actual transport plane or surface unfolding plane is converted and the value range is usually 0.0001 to 0.01 mm² / pixel, preferably 0.0005 to 0.005 mm² / pixel; under common industrial area scan cameras and close-range imaging conditions, it can usually be taken as 0.001 to 0.003 mm² / pixel.
[0201] Establish a batch baseline parameter group.
[0202] Furthermore, to accommodate the surface morphology variations among jujube seeds from different origins, with varying degrees of dryness, and from different batches, at the beginning of the current sorting phase, the first batches are selected... Jujube kernels that meet the reconstruction reliability requirements and have complete outlines are used as batch reference samples.
[0203] Specifically, parameters such as groin continuity, wrinkle undulation, crack depth, edge integrity, and fullness are calculated for each batch of benchmark samples. The mean and standard deviation of each parameter are then calculated to form a batch benchmark parameter set.
[0204] In this embodiment, the batch reference parameter group is represented as: ; in, , , , and These represent the mean values of the ventral groove continuity parameter, fold undulation parameter, crack depth parameter, edge integrity parameter, and fullness parameter in the batch reference sample, respectively. , , , and These represent the standard deviations of the corresponding parameters.
[0205] It should be noted that the batch reference parameter group is used to normalize and compare the morphological parameters of different batches of jujube kernels, thereby reducing the problem of misjudgment of fixed thresholds caused by differences in raw material batches.
[0206] Calculate the quality judgment value by combining the batch baseline parameter set.
[0207] Furthermore, for any of the pending decisions... The quality judgment value of each jujube seed is calculated based on parameters such as the continuity of the ventral groove, the fold undulation parameter, the crack depth parameter, the edge integrity parameter, and the fullness parameter, combined with the batch benchmark parameter set.
[0208] In this embodiment, the first The quality assessment value for each jujube seed kernel is expressed as: ; in, Indicates the first Quality determination value of jujube seed kernels. , , , and These represent the weighting coefficients corresponding to the continuity of the ventral groove, the undulation of the folds, the depth of the crack, the integrity of the edge, and the fullness, respectively.
[0209] It should be noted that the parameters of ventral groove continuity, edge integrity, and fullness usually have a positive promoting effect on high-quality jujube kernels, so a positive accumulation method is used in the quality judgment value; the parameters of crack depth and the degree of deviation of wrinkle undulation from the benchmark usually have a negative impact on the quality of jujube kernels, so a negative deduction method is used in the quality judgment value.
[0210] It should be noted that the weight coefficients corresponding to the continuity of the groin, the undulation of the folds, the depth of the crack, the integrity of the edge, and the fullness are determined by extracting parameters from the pre-labeled training samples of jujube seeds, and by using linear regression, logistic regression, or weighted optimization training with the goal of optimizing the accuracy of sample grade determination or the classification loss. The value range of each weight coefficient is usually 0~1, and the sum of each weight coefficient is 1. In practical applications, the weight coefficients corresponding to the continuity of the groin, the integrity of the edge, and the fullness can usually be taken as 0.15~0.30, and the weight coefficients corresponding to the undulation of the folds and the depth of the crack can usually be taken as 0.10~0.25.
[0211] Output category labels based on quality judgment values and reconstruction reliability indicators.
[0212] Furthermore, combining reconstruction reliability indicators Compared with the current quality judgment value of jujube seed Determine the first The category to which jujube kernels belong.
[0213] Specifically, when the Reconstruction reliability markers of jujube seed kernels If the reliability requirements are not met, the jujube seed should be directly marked as a re-inspection grade; when the first... Reconstruction reliability markers of jujube seed kernels Once the reliability requirements are met, then the quality judgment value is used. and crack depth parameters Edge integrity parameters A joint determination will be made.
[0214] In this embodiment, the first The category label for jujube seed kernels is indicated as follows: ; in, Indicates the first Category label for jujube seed kernels. and These represent the high-level and low-level thresholds for quality assessment, respectively. This indicates the upper limit threshold for the crack depth parameter. This represents the lower limit threshold allowed for edge integrity parameters.
[0215] It should be noted that by simultaneously considering the quality judgment value, the reconstruction reliability indicator, and the significant defect constraint, misjudgment caused by relying solely on a single score can be avoided, making the classification of jujube seed more robust.
[0216] It should be noted that the high-grade threshold for quality judgment values is determined by calculating the distribution of quality judgment values for jujube seed samples pre-labeled as superior, and based on the lower boundary value of the distribution of quality judgment values for superior samples. The high-grade threshold for quality judgment values is typically set between 0.50 and 1.50, preferably between 0.80 and 1.20. The low-grade threshold for quality judgment values is determined by calculating the distribution of quality judgment values for jujube seed samples pre-labeled as usable and rejectable, and based on the boundary value between the usable and rejectable sample distributions. The low-grade threshold for quality judgment values is typically set between -0.50 and 0.50, preferably between -0.20 and 0.30. The crack depth parameter allows... The upper limit threshold is determined by statistically analyzing the crack depth parameter distribution of jujube kernel samples pre-labeled as acceptable samples and crack defect samples, and based on the upper limit value of the crack depth parameter between the two types of samples. The upper limit threshold for crack depth parameter is usually 0.05-0.30 mm, preferably 0.08-0.20 mm. The lower limit threshold for edge integrity parameter is determined by statistically analyzing the edge integrity parameter distribution of jujube kernel samples pre-labeled as edge intact samples and edge damaged samples, and based on the lower limit value of the edge integrity parameter between the two types of samples. The lower limit threshold for edge integrity parameter is usually 0.80-0.95, preferably 0.85-0.90.
[0217] Convert category labels into sorting execution control codes.
[0218] Furthermore, to facilitate direct access by subsequent online sorting organizations, the first... The category label of each jujube seed is converted into a sorting execution control code.
[0219] Specifically, the superior, usable, rejection, and re-inspection levels are mapped to different control codes for subsequent sorting execution bit action control.
[0220] In this embodiment, the first The sorting execution control code for jujube kernels is represented as follows: ; in, Indicates the first The sorting control code for jujube kernels.
[0221] It should be noted that the sorting execution control code is used to directly control the actions of the actuators in different channels during the subsequent online sorting process, thereby converting the algorithm judgment results into executable control instructions.
[0222] Finally, the corresponding judgment result data packet is created.
[0223] In this embodiment, the first The judgment result data packet corresponding to each jujube seed is represented as follows: ; in, Indicates the first The data packet containing the judgment results for each jujube seed. Let represent a set of single-grain morphology parameters, and: ; Among them, the single-grain morphology parameter group Including the continuity parameter of the groin fold undulation parameters Crack depth parameters Edge integrity parameters and fullness parameter .
[0224] S4. Perform online sorting based on the sorting execution control code, conveying speed, and sorting execution position coordinates, and update the batch baseline parameter group based on the parameter results of the superior grade jujube kernels.
[0225] Based on the image coordinate to transport coordinate mapping parameters and real-time transport parameters, the arrival time of the jujube kernel at the sorting execution position is determined.
[0226] Furthermore, for the data packets containing the output judgment results... The Read the individual jujube seed number. and sorting execution control code And combine the established image coordinates to the transmitted coordinate mapping parameters And real-time parameter transmission, for the first The spatial location of each jujube seed was tracked.
[0227] Furthermore, in the After the quality assessment of each jujube seed is completed, the record is made. The time and location at which the identification of jujube kernels was completed.
[0228] Specifically, the first The moment when the quality assessment of each jujube seed is completed is recorded as follows: The transmission coordinates corresponding to the time are marked as The coordinates of the sorting execution position in the conveying direction are marked as The current conveyor belt speed is recorded as .
[0229] Furthermore, based on the distance from the current position of the jujube seed to the sorting execution position and the current conveying speed, the first... The predicted time when each jujube kernel reaches the sorting execution position.
[0230] In this embodiment, the first The predicted time when each jujube kernel reaches the sorting execution position is expressed as: ; in, Indicates the first The predicted time when each jujube seed reaches the sorting execution position. Indicates the first The moment when a jujube seed completes the recognition operation. Indicates the coordinates of the sorting execution position. Indicates the first The transport coordinates corresponding to the moment when the identification of a single jujube seed is completed. Indicates the first The delivery speed of each jujube kernel at a given time.
[0231] Online sorting is performed based on the sorting execution control code.
[0232] Furthermore, when the system time reaches the [number]th [time]... Predicted arrival time of jujube seed At that time, the sorting execution mechanism is controlled according to the sorting execution control code. The corresponding sorting channel will then perform the corresponding actions.
[0233] Specifically, the sorting actuator can be any one of the following: a pneumatic pulse jet mechanism, a lever deflection mechanism, or a baffle switching mechanism.
[0234] Furthermore, in this embodiment, a pneumatic pulse jet mechanism is preferably used.
[0235] Specifically, when the When the jujube kernels reach the sorting execution position, the controller, according to the first... Sorting execution control code corresponding to each jujube seed The corresponding nozzle is controlled to release airflow pulses within a fixed time window, causing the jujube kernels to enter the corresponding collection channel.
[0236] Furthermore, the superior grade jujube kernels are introduced into the superior grade collection channel, the usable grade jujube kernels are introduced into the ordinary collection channel, the rejected grade jujube kernels are introduced into the rejection collection channel, and the re-inspection grade jujube kernels are introduced into the re-inspection collection channel.
[0237] Generate execution action identifiers based on the sorting and execution control codes.
[0238] Furthermore, for the convenience of recording the first The sorting status and subsequent feedback analysis of jujube kernels generate corresponding execution action identifiers after the sorting process is completed.
[0239] Specifically, when the When the jujube kernels enter the superior collection channel, the first... The action of executing a single jujube seed is marked as a superior action; when entering the ordinary collection channel, the first... The action of executing a single jujube seed is marked as a normal action; when it enters the rejection collection channel, the first... The action marker for each jujube seed is marked as a rejection action; when it enters the re-inspection collection channel, the first... The action mark for each jujube seed is a re-inspection action.
[0240] In this embodiment, the first The action marker for processing a single jujube seed is denoted as... .
[0241] It should be noted that the execution action identifier is used to represent the first... The actual sorting results of jujube kernels at the sorting execution position can be used for subsequent statistics, traceability, and feedback updates of batch baseline parameter groups.
[0242] A sliding window statistical analysis was performed on the morphological parameters of superior grade jujube seeds.
[0243] Furthermore, during the continuous online sorting process, the jujube seeds that were determined to be of superior grade and actually entered the superior grade collection channel were screened, and the corresponding single-grain morphology parameter sets were extracted. .
[0244] Furthermore, regarding the recent A sliding window set is established for jujube kernels that meet the criteria of being "judged as superior and actually entering the superior collection channel", and the mean values of various morphological parameters within the sliding window set are statistically analyzed.
[0245] In this embodiment, the most recent The mean value of the sliding window for high-quality jujube kernels.
[0246] It should be noted that by performing sliding window statistics only on superior grade jujube seeds, the updated batch benchmark parameter set can always be adjusted around the jujube seed samples that are stable and of superior quality in the current batch, thereby improving the adaptability of subsequent quality judgment.
[0247] Calculate the offset between the mean of the sliding window parameters and the baseline parameter set of the current batch.
[0248] Furthermore, to determine whether the morphological features of the current batch have undergone overall drift, the difference between the mean value of the sliding window parameters and the baseline parameter set of the current batch is calculated.
[0249] Furthermore, a normalized offset calculation is performed on the mean of the sliding window parameters and the mean of the current batch of baseline parameters.
[0250] In this embodiment, the offset of the current sliding window relative to the batch baseline parameter group is expressed as: ; in, This represents the normalized offset of the sliding window parameter mean relative to the current batch's baseline parameter set. , , , and They represent the most recent The mean values of the following parameters were used to measure the continuity of the ventral groove, the undulation of the wrinkles, the crack depth, the edge integrity, and the fullness of the high-quality jujube kernels within the sliding window.
[0251] It should be noted that the normalized offset This is used to measure whether the overall distribution of the current superior jujube seed sample has changed within an acceptable range relative to the original batch baseline, thereby determining whether to perform a baseline parameter group update.
[0252] Determine whether to update the batch baseline parameter group based on the normalized offset.
[0253] Furthermore, set a batch baseline update threshold. .
[0254] Specifically, when the normalized offset Less than the batch baseline update threshold When the distribution of morphological parameters of superior jujube seeds within the current sliding window is determined to be within an acceptable drift range, the batch baseline parameter group is recursively updated; when the normalized offset... Greater than or equal to the batch baseline update threshold When this happens, stop the recursive update and re-execute the batch baseline sample initialization.
[0255] It should be noted that the batch benchmark update threshold is determined by statistically analyzing the normalized offset distribution between the average sliding window parameters of the same batch of premium jujube kernels and the initial batch benchmark parameter group, and based on the allowable upper limit boundary value of the normalized offset distribution. The batch benchmark update threshold is usually taken as 0.50 to 2.00, preferably 0.80 to 1.50.
[0256] Perform a recursive update on the batch baseline parameter group.
[0257] Furthermore, when the batch baseline update conditions are met, the mean value in the current batch baseline parameter group is updated using a recursive weighted method.
[0258] Specifically, let the recursive update coefficient be... ,and Then, the mean value of the batch baseline parameter group is updated using the current sliding window mean.
[0259] It should be noted that the recursive update coefficient is determined by simulating and updating the pre-collected continuous sorting data of the same batch of jujube kernels, comparing the stability and quality judgment accuracy of the batch benchmark parameter group under different recursive update coefficients, and selecting the coefficient value that makes the two optimal. The value range of the recursive update coefficient is usually 0.05 to 0.50, preferably 0.10 to 0.30.
[0260] In this embodiment, the updated batch baseline parameter group mean is represented as follows: ; ; ; ; ; in, , , , and These represent the updated mean values for the ventral groove continuity parameter, the mean value for the fold undulation parameter, the mean value for the crack depth parameter, the mean value for the edge integrity parameter, and the mean value for the fullness parameter, respectively.
[0261] Furthermore, while recursively updating the mean term, the standard deviation term can be updated synchronously or periodically re-estimated based on the parameter dispersion of superior jujube seeds within the sliding window.
[0262] Specifically, in this embodiment, the standard deviation term can be re-estimated based on the sample standard deviation of each parameter within the sliding window to obtain... .
[0263] It should be noted that the recursive update coefficients Used to control the weighting of historical batch baseline parameter sets and the average of current superior sliding window parameters; when When it is smaller, it indicates a greater emphasis on historical stability; when A larger value indicates a greater emphasis on rapid adaptation to changes in the current sample distribution.
[0264] Generate the updated batch baseline parameter set.
[0265] Furthermore, the updated mean and standard deviation terms are combined to generate an updated batch baseline parameter set.
[0266] In this embodiment, the updated batch baseline parameter set is represented as: ; in, This indicates the updated batch baseline parameter set.
[0267] It should be noted that the updated batch baseline parameter set The data will be returned to the batch baseline parameter set used for normalizing and comparing the morphological parameters of different batches of jujube seeds, and will serve as the batch baseline input for subsequent calculation of jujube seed quality judgment values.
[0268] This embodiment also provides a computer device applicable to the image recognition-based jujube seed sorting method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the image recognition-based jujube seed sorting method proposed in the above embodiment.
[0269] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0270] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the image recognition-based jujube seed sorting method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0271] In summary, this invention acquires surface normal distribution maps and relative height distribution maps through multi-directional directional illumination imaging and photometric stereoscopic 3D reconstruction, achieving quantitative characterization of the 3D morphological features of jujube kernels, such as ventral grooves, wrinkles, and cracks. By calculating contour consistency, normal solution residuals, saturated pixel ratios, and region integrity, a reconstruction reliability indicator is generated, enabling quality monitoring and credibility judgment of the surface reconstruction results and effectively filtering out unreliable data. By selecting reliable samples to construct a batch benchmark parameter set and combining it with morphological parameters for normalized weighted calculation to obtain a quality judgment value, adaptive calibration for morphological differences between different batches of raw materials is achieved.
[0272] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for sorting jujube kernels based on image recognition, characterized in that, include: The process involves single-grain limited transport of jujube seeds, establishing single-grain numbers, obtaining a target area mask, and completing camera calibration, light source orientation calibration, and mapping of image coordinates to transport coordinates. Multi-directional illumination imaging was performed on effective jujube kernels. Based on the grayscale response under different illumination conditions, the surface normal distribution map, relative height distribution map, and fused reflection intensity map were reconstructed, and a reconstruction reliability indicator was generated. Based on the target area mask, determine the major axis and ventral groove feature lines, establish a standard unfolded coordinate system, extract parameters such as ventral groove continuity, wrinkle undulation, crack depth, edge integrity, and fullness, calculate the quality judgment value in combination with the batch baseline parameter group, and output the category label and sorting execution control code. Online sorting is performed based on the sorting execution control code, conveying speed, and sorting execution position coordinates, and the batch baseline parameter group is updated based on the parameter results of the superior grade jujube kernels.
2. The image recognition-based jujube seed sorting method as described in claim 1, characterized in that, The specific steps for single-grain limited transport of jujube seeds, establishing a single-grain number, and obtaining a target area mask are as follows: The jujube kernels to be sorted are fed into the vibrating cloth mechanism, so that the jujube kernels are transformed from a piled state to a single-layer discrete state. The jujube kernels in a single-layer discrete state are introduced one by one into the limiting bearing grooves arranged sequentially along the conveying direction, so that each limiting bearing groove can only hold one jujube kernel. When the jujube kernel enters the imaging window along with the limiting support groove, a unique single kernel number is assigned to the jujube kernel that meets the single kernel identification conditions. Acquire a background reference image when no jujube seed passes through, and acquire the corresponding current image when the jujube seed enters the imaging window; Background subtraction is performed between the current image and the background reference image to obtain a difference image. Then, threshold segmentation is performed on the difference image to obtain a binary image. Morphological processing and connected component extraction are performed on the binary image to obtain the connected region with the largest area as the target region mask for jujube seed. The effectiveness criteria of jujube seed are determined based on the area, major axis length, minor axis length, and number of effective connected regions corresponding to the target area mask.
3. The image recognition-based jujube seed sorting method as described in claim 1, characterized in that, The specific steps for completing camera calibration, light source direction calibration, and image coordinate to transport coordinate mapping are as follows: The calibration board is placed on the plane of the imaging window. The area array camera is used to acquire the image of the calibration board and extract the image coordinates of the calibration points. The camera intrinsic parameter matrix and extrinsic parameter are solved by combining the actual spatial coordinates of the calibration points to obtain the camera calibration parameters. A standard diffuse reflective plane target plate is placed at the imaging window, and directional light sources set around the area array camera are lit in sequence, and the corresponding target plate images are acquired. Based on the brightness distribution of a standard diffuse reflection plane target under different directional illuminations, the incident direction vector of each group of directional light sources relative to the camera coordinate system is solved by combining the normal direction of the target plate, and the light source direction parameters are obtained. Establish a conveyor coordinate system, place the calibration plate on the surface of the conveyor belt, acquire an image of the calibration plate, and extract the corresponding pixel coordinates of the known conveyor coordinate points in the image; Based on the correspondence between pixel coordinates and transport coordinate points, solve the mapping matrix from image coordinates to transport coordinates to obtain the mapping parameters between image coordinates and transport coordinates.
4. The image recognition-based jujube seed sorting method as described in claim 3, characterized in that, The specific steps for reconstructing the surface normal distribution map, relative height distribution map, and fused reflection intensity map based on the grayscale response under different lighting conditions are as follows: Different directional illuminations were sequentially applied to the effective jujube kernels within the imaging window, and corresponding grayscale images were acquired simultaneously. Dark field correction and brightness normalization are performed on grayscale images to obtain corrected grayscale response images under various lighting directions; Based on the light source direction parameters corresponding to each lighting direction and the grayscale response of each pixel under different lighting directions, construct the grayscale response vector and solve the weighted normal vector of each pixel in the target area. The weighted normal vectors are normalized to obtain the surface normal distribution map; The surface gradient of each pixel in the target area is calculated based on the surface normal distribution map, and the relative height distribution map is obtained by integral reconstruction or solving the Poisson equation based on the surface gradient. Weighted fusion of the corrected grayscale response images under each illumination direction is performed to obtain a fused reflection intensity map.
5. The image recognition-based jujube seed sorting method as described in claim 2, characterized in that, The generated reconstruction reliability flags include: Extract the target region masks corresponding to images with different directional lighting, calculate the cross-union ratio between the target region masks, and obtain the contour consistency coefficient; Based on the grayscale response vector, light source direction parameters, and weighted normal vector of each pixel, the normal solution residual of each pixel is calculated, and the normal solution residual of each pixel in the target area is statistically analyzed to obtain the average residual. The proportion of saturated pixels is obtained by statistically analyzing the percentage of pixels with gray values exceeding the saturation threshold in the corrected grayscale response image relative to the total number of effective pixels in the target area. The boundary truncation of the target region mask within the imaging window is statistically analyzed to obtain the target region integrity coefficient. The contour consistency coefficient, average residual, saturated pixel ratio, and target region integrity coefficient are compared with their respective thresholds. When the contour consistency coefficient is not lower than the contour consistency threshold, the average residual is not higher than the residual threshold, the saturated pixel ratio is not higher than the saturation ratio threshold, and the target region integrity coefficient is not lower than the integrity threshold, a reconstruction reliability indicator is generated to represent the reliability of the reconstruction result.
6. The image recognition-based jujube seed sorting method as described in claim 2 or 5, characterized in that, The specific steps for extracting parameters such as the continuity of the abdominal groove, wrinkle undulation, crack depth, edge integrity, and fullness are as follows: Extract the set of boundary points of the jujube seed contour based on the mask of the target region, and determine the direction of the major axis of the jujube seed based on the second central moment of the boundary point set. Based on the continuous valley structure extending along the long axis in the relative height distribution map, and combined with the low reflection constraint in the fused reflection intensity map, the ventral groove feature line is extracted. A standard unfolded coordinate system is established with the major axis direction as the first coordinate direction and the direction formed by the unfolding of the envelope around the surface of the jujube seed as the second coordinate direction. The continuity parameter of the groin is extracted based on the ratio of the continuous projected length of the groin feature line along the major axis to the measured length of the major axis. Based on the average value of the sum of squares of the local gradient magnitudes in the relative height distribution map under the standard unfolded coordinate system, the fold undulation parameters are extracted. Based on the maximum height difference between the reference surface height and the relative height distribution map within the candidate crack region, the crack depth parameter is extracted. Extract edge integrity parameters based on the ratio of the actual contour area to the reference template area; The saturation parameter is extracted based on the weighted sum of the relative height values of all valid pixels in the standard unfolded coordinate system.
7. The image recognition-based jujube seed sorting method as described in claim 6, characterized in that, The specific steps for calculating the quality judgment value by combining the batch baseline parameter set and outputting the category label and sorting execution control code are as follows: Select jujube kernels that meet the reconstruction reliability requirements and have complete outlines from the current sorting batch as the batch benchmark sample, and calculate the mean and standard deviation of the abdominal groove continuity parameter, wrinkle undulation parameter, crack depth parameter, edge integrity parameter and fullness parameter respectively to form the batch benchmark parameter set; The quality judgment value is obtained by performing normalized weighted calculation based on the parameters of the ventral groove continuity, wrinkle undulation, crack depth, edge integrity, and fullness of the jujube seed to be judged, combined with the batch benchmark parameter group. Based on the reconstruction reliability indicator, quality judgment value, crack depth threshold and edge integrity threshold, the jujube seed to be judged is classified and output as excellent, usable, rejected or re-inspection category label; Convert the category labels into sorting execution control codes corresponding to different sorting channels.
8. The image recognition-based jujube seed sorting method as described in claim 7, characterized in that, The online sorting based on the sorting execution control code, conveying speed, and sorting execution position coordinates involves the following steps: Obtain the identification completion time and corresponding transport coordinates when the quality judgment of jujube kernels is completed; Based on the coordinates of the sorting execution position, the identification completion time, the corresponding conveying coordinates, and the conveying speed, the predicted time when the jujube seed arrives at the sorting execution position is calculated. When the system time reaches the predicted time, the corresponding sorting execution mechanism is controlled according to the sorting execution control code, so that the jujube kernels enter the collection channel corresponding to the sorting execution control code; The collection channels include a premium collection channel, a regular collection channel, a rejection collection channel, and a re-inspection collection channel.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the image recognition-based jujube seed sorting method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the image recognition-based jujube seed sorting method according to any one of claims 1 to 8.