A system and method for quinoa seed screening control
Patent Information
- Application Number
- CN202610844419.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-06-11
AI Technical Summary
[0002]现有的藜麦种子筛选主要依赖于传统的机械筛分与人工分选方法,这些方法效率低下且高度依赖经验,难以实现标准化与规模化作业,而基于机器视觉的自动化分选技术近年来有所应用,但其通常仅能依据种子的外部形态特征与颜色进行判别,无法探测种子内部的品质缺陷,例如,因水分异常导致的霉变或内部变质,这些内部缺陷在外观上往往没有明显征兆,却是影响种子发芽率与储藏安全的关键因素,此外现有光学分选方法在处理密集堆积的小粒径藜麦种子时,难以对每一粒种子实现精准的实例分割与跟踪,导致分选决策无法与具体的单粒种子个体准确关联,进而影响了高速剔除执行的精准性,同时缺乏一种能够融合种子外部形态、表面纹理及内部光谱信息的综合分析机制,使得分选过程在效率、精度与对内部缺陷的检出能力方面存在显著局限
[0045] This invention achieves accurate identification and tracking of individual seeds even when they are closely packed, by simultaneously acquiring images of white light and two specific near-infrared bands and using instance segmentation technology to establish an independent digital identifier for each seed. Furthermore, it generates a feature difference map by calculating the ratio of near-infrared to white light images, effectively enhancing the feature signals of invisible defects such as internal moisture and mold, overcoming the limitations of traditional methods that rely solely on external morphology for screening. By associating detected abnormal areas with specific individual seed identifiers and intelligently focusing on these suspicious objects to extract their overall morphology, local texture, and fused spectral features, it significantly improves data processing efficiency and analytical targeting. Finally, it fuses and weights multi-dimensional parameters characterizing external morphological integrity and internal lesion severity to obtain a comprehensive defect confidence score. Based on the score and location information, it drives a flexible airflow for precise removal, thus simultaneously achieving high-speed, automated, and high-precision sorting of quinoa seeds for external deformities and internal mold and water stains at the single-seed scale, comprehensively improving the accuracy, reliability, and intelligence of the screening process.
Smart Images

Figure CN122377773B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of seed screening technology, and in particular to a control system and method for screening quinoa seeds. Background Technology
[0002] Current quinoa seed screening mainly relies on traditional mechanical sieving and manual sorting methods. These methods are inefficient, highly dependent on experience, and difficult to standardize and scale up. While automated sorting technology based on machine vision has been applied in recent years, it can usually only judge based on the external morphological characteristics and color of the seeds, and cannot detect internal quality defects, such as mold or internal deterioration caused by abnormal moisture. These internal defects often have no obvious signs in appearance, but are key factors affecting seed germination rate and storage safety. In addition, existing optical sorting methods are difficult to accurately segment and track each seed when dealing with densely packed small-diameter quinoa seeds, so that sorting decisions cannot be accurately associated with specific individual seeds, which affects the accuracy of high-speed rejection. At the same time, there is a lack of a comprehensive analysis mechanism that can integrate seed external morphology, surface texture, and internal spectral information, which makes the sorting process significantly limited in terms of efficiency, accuracy, and ability to detect internal defects.
[0003] Therefore, it is necessary to provide a quinoa seed screening control system and method to solve the above-mentioned technical problems. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a quinoa seed screening control system and method, achieving the beneficial effect of precise and efficient screening of quinoa seeds.
[0005] This invention provides a method for screening and controlling quinoa seeds, comprising:
[0006] S1: Simultaneously acquire the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm;
[0007] S2: Based on the white light reflectance map and the first near-infrared absorption map, generate a first feature difference map; based on the white light reflectance map and the second near-infrared absorption map, generate a second feature difference map.
[0008] S3: For the first feature difference map and the second feature difference map, adaptive threshold segmentation and morphological processing are applied respectively to obtain the abnormal regions. Based on the abnormal regions and the single seed segmentation mask, an association table of abnormal regions and single seeds is generated, and the fusion spectral feature vector of each abnormal region is extracted.
[0009] S4: Based on the association table between abnormal regions and single seeds, extract the overall morphological contour features of single seeds from the white light reflectance map, and extract the local texture features of each abnormal region from the white light reflectance map.
[0010] S5: The morphological integrity parameter calculated based on the overall morphological contour features of the same single seed is weighted and summed with the internal lesion parameters calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed.
[0011] S6: Determine defect seeds based on defect confidence scores, and generate nozzle flexible airflow impact commands based on the location of defect seeds to remove them.
[0012] Preferably, in step S1, the first near-infrared absorption image and the second near-infrared absorption image are grayscale images representing the spatial distribution of absorption intensity, obtained by comparing the reflected light intensity of quinoa seeds to the first preset near-infrared band and the second preset near-infrared band with a preset reference light intensity.
[0013] Preferably, in step S1, the step of simultaneously acquiring the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds includes:
[0014] White light reflection image, first near-infrared absorption image and second near-infrared absorption image are collected in a preset time sequence, and the sum of the collection time intervals ensures that the displacement of a single seed moving along the transport direction does not exceed one-tenth of the average size of a single seed.
[0015] Preferably, in step S1, the step of obtaining the single-seed segmentation mask includes:
[0016] Edge detection and adaptive threshold segmentation are performed on the white light reflectance image to obtain an initial binary image. Morphological opening operation is performed on the initial binary image to eliminate noise, and hole filling is performed to obtain an optimized binary image.
[0017] Calculate the distance transformation map of the optimized binary map, and use the local maxima points on the distance transformation map as foreground markers for the watershed algorithm;
[0018] A morphological dilation operation is performed on the optimized binary image, and the difference between the dilation result and the optimized binary image is calculated to obtain a determined background region as the background marker.
[0019] Using foreground and background markers as control signals, a watershed algorithm is performed on the distance transformation map to obtain independent segmentation regions for each individual seed.
[0020] Assign a unique integer identifier to each individual seed's independent segmentation region, and generate a single-seed segmentation mask with the same size as the white light reflectance map.
[0021] Preferably, in step S2, the generation of the first feature difference map and the second feature difference map includes:
[0022] The gray values of each pixel in the first near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the first feature difference map.
[0023] The gray values of each pixel in the second near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the second feature difference map.
[0024] Preferably, in step S3, the adaptive threshold segmentation includes:
[0025] The first adaptive threshold is obtained by adding the overall gray-level mean of the first feature difference map to the first adjustment amount, wherein the first adjustment amount is the product of the gray-level standard deviation of the first feature difference map and the first sensitivity coefficient, and the first sensitivity coefficient is dynamically adjusted based on the overall contrast of the first feature difference map.
[0026] The second adaptive threshold is obtained by adding the overall gray-level mean of the second feature difference map to the second adjustment amount, wherein the second adjustment amount is the product of the gray-level standard deviation of the second feature difference map and the second sensitivity coefficient, and the second sensitivity coefficient is dynamically adjusted based on the overall contrast of the second feature difference map.
[0027] Preferably, in step S3, the acquisition of the abnormal region includes:
[0028] The first feature difference map is compared with the first adaptive threshold, and the region with a pixel value greater than the first adaptive threshold is identified as a moisture abnormality region. The second feature difference map is compared with the second adaptive threshold, and the region with a pixel value greater than the second adaptive threshold is identified as a mold abnormality region. The moisture abnormality region and the mold abnormality region constitute an abnormal region.
[0029] Preferably, in step S5, the calculation steps for the morphological integrity parameter include:
[0030] The circularity of a single seed's outline is calculated based on the area and perimeter of the single seed segmentation mask.
[0031] The convex hull defect rate of a single seed is calculated based on the difference between the convex hull area and the actual area of the single seed segmentation mask.
[0032] The morphological integrity parameter is obtained by weighting the contour roundness and the convex hull defect rate.
[0033] Preferably, in step S5, the calculation steps for internal lesion parameters include:
[0034] Based on the local texture features of the abnormal region, the texture lesion component of the abnormal region is calculated. The texture lesion component is obtained by calculating the entropy value of the gray-level co-occurrence matrix of the corresponding region in the white light reflectance map of the abnormal region.
[0035] Based on the fused spectral feature vector, the spectral lesion component of the abnormal region is calculated. The spectral lesion component is obtained by calculating the spectral deviation between the fused spectral feature vector of the abnormal region and the pre-stored standard healthy seed spectral vector.
[0036] The internal lesion parameters are obtained by weighted summation of the texture lesion component and the spectral lesion component.
[0037] This invention provides a quinoa seed screening and control system, comprising:
[0038] The multispectral image acquisition module is used to simultaneously acquire the white light reflectance image, the first near-infrared absorption image and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm.
[0039] The feature difference map generation module is used to generate a first feature difference map based on the white light reflectance map and the first near-infrared absorption map, and to generate a second feature difference map based on the white light reflectance map and the second near-infrared absorption map.
[0040] The anomaly detection association module is used to obtain the abnormal regions by applying adaptive threshold segmentation and morphological processing to the first feature difference map and the second feature difference map, respectively. Based on the abnormal regions and the single seed segmentation mask, an association table of abnormal regions and single seeds is generated, and the fusion spectral feature vector of each abnormal region is extracted.
[0041] The multi-dimensional feature extraction module is used to extract the overall morphological contour features of a single seed from the white light reflectance image based on the association table between abnormal regions and single seeds, and to extract the local texture features of each abnormal region from the white light reflectance image.
[0042] The defect confidence scoring module is used to perform a weighted summation of the morphological integrity parameter calculated based on the overall morphological contour features of the same single seed and the internal lesion parameter calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed.
[0043] The rejection and screening execution module is used to determine defect seeds based on defect confidence scores, and generate nozzle flexible airflow impact commands based on the location of the defect seeds to reject them.
[0044] Compared with related technologies, the quinoa seed screening control system and method provided by the present invention have the following beneficial effects:
[0045] This invention achieves accurate identification and tracking of individual seeds even when they are closely packed, by simultaneously acquiring images of white light and two specific near-infrared bands and using instance segmentation technology to establish an independent digital identifier for each seed. Furthermore, it generates a feature difference map by calculating the ratio of near-infrared to white light images, effectively enhancing the feature signals of invisible defects such as internal moisture and mold, overcoming the limitations of traditional methods that rely solely on external morphology for screening. By associating detected abnormal areas with specific individual seed identifiers and intelligently focusing on these suspicious objects to extract their overall morphology, local texture, and fused spectral features, it significantly improves data processing efficiency and analytical targeting. Finally, it fuses and weights multi-dimensional parameters characterizing external morphological integrity and internal lesion severity to obtain a comprehensive defect confidence score. Based on the score and location information, it drives a flexible airflow for precise removal, thus simultaneously achieving high-speed, automated, and high-precision sorting of quinoa seeds for external deformities and internal mold and water stains at the single-seed scale, comprehensively improving the accuracy, reliability, and intelligence of the screening process. Attached Figure Description
[0046] Figure 1 This is a flowchart of a quinoa seed screening and control method according to the present invention;
[0047] Figure 2 This is a block diagram of a quinoa seed screening and control system according to the present invention. Detailed Implementation
[0048] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the drawings, not all structures. Moreover, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0049] It should also be noted that, for ease of description, the accompanying drawings show only the parts relevant to the invention and not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. The process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0050] Example 1
[0051] A method for screening and controlling quinoa seeds, in the specific implementation process, such as... Figure 1 As shown, a flowchart of a quinoa seed screening control method according to the present invention is illustrated, comprising:
[0052] Step S1: Simultaneously acquire the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm.
[0053] Specifically, in step S1, the first near-infrared absorption image and the second near-infrared absorption image are grayscale images representing the spatial distribution of absorption intensity, obtained by comparing the reflected light intensity of quinoa seeds to the first preset near-infrared band and the second preset near-infrared band with a preset reference light intensity.
[0054] Specifically, in step S1, the steps of simultaneously acquiring the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds include:
[0055] White light reflection image, first near-infrared absorption image and second near-infrared absorption image are collected in a preset time sequence, and the sum of the collection time intervals ensures that the displacement of a single seed moving along the transport direction does not exceed one-tenth of the average size of a single seed.
[0056] Specifically, in step S1, the step of obtaining the single-seed segmentation mask includes:
[0057] Edge detection and adaptive threshold segmentation are performed on the white light reflectance image to obtain an initial binary image. Morphological opening operation is performed on the initial binary image to eliminate noise, and hole filling is performed to obtain an optimized binary image.
[0058] Calculate the distance transformation map of the optimized binary map, and use the local maxima points on the distance transformation map as foreground markers for the watershed algorithm;
[0059] A morphological dilation operation is performed on the optimized binary image, and the difference between the dilation result and the optimized binary image is calculated to obtain a determined background region as the background marker.
[0060] Using foreground and background markers as control signals, a watershed algorithm is performed on the distance transformation map to obtain independent segmentation regions for each individual seed.
[0061] Assign a unique integer identifier to each individual seed's independent segmentation region, and generate a single-seed segmentation mask with the same size as the white light reflectance map.
[0062] In the specific implementation process, firstly, for example, a multispectral illumination system including a white light source, a first near-infrared band light source, and a second near-infrared band light source is set up, along with a high-speed global shutter camera. Hardware trigger signals ensure strict synchronization between the three light sources and the camera exposure. The first near-infrared band light source is used to detect abnormal moisture levels inside the seeds, with its dominant emission wavelength in the range of 960 nm to 980 nm. The second near-infrared band light source is used to detect mold, using a center wavelength in the range of 1190 nm to 1210 nm. Before imaging, a standard white board with known reflectivity is placed at the imaging position for calibration, and reference light intensity images under the three light sources are acquired respectively. During actual screening, when quinoa seeds are transported at a constant rate... The image passes through the center of the imaging field of view. Within a very short time interval, the white light source is triggered sequentially for exposure to obtain a white light reflection map. Then, the first near-infrared light source is triggered for exposure to obtain a first near-infrared reflection intensity map. Finally, the second near-infrared light source is triggered for exposure to obtain a second near-infrared reflection intensity map. The time interval is strictly controlled to ensure that the displacement of a single seed during the three exposures is less than one-tenth of its own size, thereby minimizing motion blur and image misalignment. For the obtained first and second near-infrared reflection intensity maps, the grayscale value of each pixel is divided by the pixel value at the same position in the calibrated reference intensity image to calculate the relative reflectance of that point. The negative logarithm of this value is then used to obtain... Indirectly characterizing the absorption intensity of the seed at a given point in the corresponding wavelength band, a first near-infrared absorption map and a second near-infrared absorption map are generated. Subsequently, an image spatial registration step is performed to eliminate minor displacements caused by temporal acquisition, providing an accurate data foundation for all subsequent operations requiring pixel-level alignment. For example, the white light reflectance map with the clearest outline is used as a fixed reference image, and the first and second near-infrared absorption maps are used as images to be registered. Stable feature points at the seed edges or textures are automatically extracted from both the reference image and each image to be registered using scale-invariant feature transformation. Then, matching is performed based on feature descriptors, and an affine transformation matrix is estimated from the successfully matched point pairs using a random sampling consensus algorithm. This affine transformation... The matrix describes the geometric relationships such as translation and rotation of the image to be registered relative to the reference image. Finally, based on this affine transformation matrix, bilinear interpolation is used to perform geometric transformations and resampling on the two preliminary near-infrared absorption images to generate the final first and second near-infrared absorption images that are strictly aligned with the white light reflectance image in space. The first and second near-infrared absorption images are essentially grayscale images that reflect the spatial distribution of absorption intensity of moisture and mold characteristics. Next, edge detection is performed on the white light reflectance image to enhance the seed contour. Then, an adaptive threshold segmentation algorithm is used. For example, the optimal threshold is automatically calculated using the Otsu method and the image is binarized to initially separate the seed foreground and background, resulting in an initial binary image.Morphological opening (erosion followed by dilation) is performed on the initial binary image. A 3-pixel × 3-pixel rectangular structuring element is used to eliminate small noise points and smooth the seed boundary. Simultaneously, holes caused by reflections within the seed region are filled, resulting in an optimized binary image. Next, the distance transform map of the optimized binary image is calculated. The grayscale value of each foreground pixel in the map represents its Euclidean distance to the nearest background pixel. All local maxima in the distance transform map are then identified and extracted as foreground markers for the watershed algorithm. Finally, morphological dilation is performed on the optimized binary image using a 5-pixel × 5-pixel rectangular structuring element. The dilated image is then subtracted from the original optimized binary image to obtain the bounding box within the original image. A ring-shaped region, several pixels wide, surrounds the seed and is defined as the background, serving as the background marker for the watershed algorithm. Constrained by both the foreground and background markers, the watershed algorithm is applied to the distance transformation map, treating it as a terrain surface. Water is injected starting from the foreground marker, with the background marker acting as a barrier, until the water flows converge, thus accurately segmenting interconnected seeds and obtaining an independent segmentation region for each individual seed. Finally, connected component analysis and labeling are performed on these independent segmentation regions, assigning each region a unique integer identifier. This generates a single-seed segmentation mask of the same size as the white light reflection map, where the value of each pixel in the single-seed segmentation mask is the identifier of its corresponding seed, and the background pixel value is zero.
[0063] Step S2: Generate a first feature difference map based on the white light reflectance map and the first near-infrared absorption map, and generate a second feature difference map based on the white light reflectance map and the second near-infrared absorption map.
[0064] Specifically, in step S2, the generation of the first feature difference map and the second feature difference map includes:
[0065] The gray values of each pixel in the first near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the first feature difference map.
[0066] The gray values of each pixel in the second near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the second feature difference map.
[0067] In the specific implementation process, for each pixel in the first near-infrared absorption image, its grayscale value is read, and simultaneously, the grayscale value of the pixel with the exact same coordinate position in the white light reflection image is read. The grayscale value of the pixel in the first near-infrared absorption image is used as the numerator, and the grayscale value of the corresponding pixel in the white light reflection image is used as the denominator, and a division operation is performed to obtain an initial ratio representing the relative intensity of near-infrared absorption at that point. To prevent calculation errors caused by a zero denominator, a very small constant is added to the grayscale value of the denominator. The above operation is performed sequentially on all pixels of the entire image, thereby obtaining an image with the same size as the original image, where each pixel is stored... An initial ratio matrix is stored. Next, this initial ratio matrix undergoes numerical normalization, linearly mapping the data to a standard, fixed numerical range, for example, an 8-bit grayscale range from 0 to 255. Normalization involves iterating through all values in the initial ratio matrix to find the minimum and maximum values. Then, using a linear transformation formula, each original ratio is scaled proportionally to the target range; for example, the minimum value is mapped to 0, the maximum value to 255, and intermediate values are linearly interpolated. This results in a first feature difference map characterizing the spatial distribution of abnormal moisture absorption intensity. Similarly, a second feature difference map is generated based on the second near-infrared absorption map and the same white light reflectance map, ultimately yielding a second feature difference map specifically used to characterize the spatial distribution of abnormal mold absorption intensity.
[0068] Step S3: For the first feature difference map and the second feature difference map, adaptive threshold segmentation and morphological processing are applied respectively to obtain the abnormal regions. Based on the abnormal regions and the single seed segmentation mask, an association table between the abnormal regions and the single seed is generated, and the fusion spectral feature vector of each abnormal region is extracted.
[0069] Specifically, in step S3, the adaptive threshold segmentation includes:
[0070] The first adaptive threshold is obtained by adding the overall gray-level mean of the first feature difference map to the first adjustment amount, wherein the first adjustment amount is the product of the gray-level standard deviation of the first feature difference map and the first sensitivity coefficient, and the first sensitivity coefficient is dynamically adjusted based on the overall contrast of the first feature difference map.
[0071] The second adaptive threshold is obtained by adding the overall gray-level mean of the second feature difference map to the second adjustment amount, wherein the second adjustment amount is the product of the gray-level standard deviation of the second feature difference map and the second sensitivity coefficient, and the second sensitivity coefficient is dynamically adjusted based on the overall contrast of the second feature difference map.
[0072] Specifically, in step S3, the acquisition of the abnormal region includes:
[0073] The first feature difference map is compared with the first adaptive threshold, and the region with a pixel value greater than the first adaptive threshold is identified as a moisture abnormality region. The second feature difference map is compared with the second adaptive threshold, and the region with a pixel value greater than the second adaptive threshold is identified as a mold abnormality region. The moisture abnormality region and the mold abnormality region constitute an abnormal region.
[0074] In the specific implementation process, adaptive threshold segmentation is first performed on the first feature difference map and the second feature difference map respectively. For the first feature difference map, the average gray value of all pixels in the entire image is calculated as the overall gray value, and the dispersion of the gray values of all pixels relative to this mean is calculated, i.e., the gray standard deviation. At the same time, the brightness contrast of the first feature difference map is evaluated, i.e., the overall contrast. Based on the magnitude of the overall contrast, a corresponding first sensitivity coefficient is dynamically selected from a predefined first sensitivity coefficient mapping table. The higher the overall contrast, the smaller the value of the first sensitivity coefficient; the lower the overall contrast, the larger the value of the first sensitivity coefficient. The calculated gray standard deviation of the first feature difference map is multiplied by the dynamically selected first sensitivity coefficient to obtain the first... An adjustment amount is applied; finally, the overall gray-level mean of the first feature difference image is added to this first adjustment amount, and the sum is determined as the first adaptive threshold used to segment the first feature difference image; for the second feature difference image, the same logic and steps are followed, namely, calculating the overall gray-level mean and gray-level standard deviation of the second feature difference image itself, evaluating the overall contrast of the second feature difference image itself, and dynamically selecting a corresponding second sensitivity coefficient from the predefined second sensitivity coefficient mapping table accordingly, multiplying the gray-level standard deviation of the second feature difference image by the second sensitivity coefficient to obtain the second adjustment amount, and finally adding the overall gray-level mean of the second feature difference image to the second adjustment amount to obtain the second adaptive threshold of the second feature difference image; after obtaining the first adaptive threshold, the second adaptive threshold is determined. After applying the adaptive threshold and the second adaptive threshold, the abnormal regions are acquired. The grayscale value of each pixel in the first feature difference image is compared with the first adaptive threshold. Pixels with grayscale values greater than the first adaptive threshold are marked as foreground. These connected pixel regions are identified as moisture abnormality regions reflecting internal moisture anomalies. Similarly, the grayscale value of each pixel in the second feature difference image is compared with the second adaptive threshold. Pixels with grayscale values greater than the second adaptive threshold are marked as foreground. These connected pixel regions are identified as mold abnormality regions reflecting internal mold growth anomalies. Next, the binary images of the moisture abnormality regions and mold abnormality regions initially obtained through threshold segmentation are subjected to morphological processing. For example, using a size of... A 3-pixel × 3-pixel rectangular structuring element performs an erosion-dilation closing operation on the binary image to eliminate small holes caused by noise and smooth the boundaries of abnormal areas, resulting in optimized moisture and mold abnormal areas. Subsequently, based on all detected abnormal areas and single-seed segmentation masks, all pixel coordinates within each moisture and mold abnormal area are traversed. The seed identifiers stored at the same coordinate positions in the single-seed segmentation mask are queried, and the seed identifier with the highest frequency in the area is counted. This abnormal area is then assigned to that seed. This association, including the abnormal area number, the seed identifier, and the abnormal type, is recorded in a structured association table to generate an abnormal area and single-seed association table.Finally, the fusion spectral feature vectors of each abnormal region are extracted. For each abnormal region recorded in the association table between the abnormal region and the single seed, the corresponding pixel position is located in both the first and second feature difference maps. The average and variance of the pixel grayscale in the first feature difference map are calculated, as are the average and variance of the pixel grayscale in the second feature difference map. These four calculated feature values—mean moisture content, variance moisture content, mean mold growth, and variance mold growth—are combined sequentially into a four-dimensional feature vector. This feature vector is the fusion spectral feature vector of the abnormal region, comprehensively representing the abnormal intensity and distribution uniformity of the region in both the moisture and mold growth spectral dimensions.
[0075] Step S4: Based on the association table between abnormal regions and individual seeds, extract the overall morphological contour features of individual seeds from the white light reflectance image, and extract the local texture features of each abnormal region from the white light reflectance image.
[0076] In the specific implementation process, firstly, based on the association table between abnormal regions and individual seeds, the objects of subsequent feature extraction are limited to the seeds that appear in the table. Seeds that do not appear in the table are not processed. For each seed in the association table between abnormal regions and individual seeds, the first step is to extract the overall shape contour features of the seed. That is, based on the unique identifier of the seed, its complete pixel region is obtained from the single seed segmentation mask, and the corresponding overall image is located in the white light reflection image based on this region. Then, a series of geometric features used to quantify its shape regularity and fullness are calculated. These features are the original input data prepared for the subsequent calculation of shape integrity parameters. Secondly, the local texture features of each abnormal region of the seed are extracted. That is, based on the set of precise pixel coordinates of each abnormal region recorded in the association table between abnormal regions and individual seeds, the corresponding local image block is cropped from the original white light reflection image. Then, the texture statistical characteristics of the local region are analyzed to generate feature values used to quantify the degree of texture abnormality, that is, local texture features.
[0077] Step S5: The morphological integrity parameter calculated based on the overall morphological contour features of the same single seed is weighted and summed with the internal lesion parameters calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed.
[0078] Specifically, in step S5, the calculation steps for the morphological integrity parameter include:
[0079] The circularity of a single seed's outline is calculated based on the area and perimeter of the single seed segmentation mask.
[0080] The convex hull defect rate of a single seed is calculated based on the difference between the convex hull area and the actual area of the single seed segmentation mask.
[0081] The morphological integrity parameter is obtained by weighting the contour roundness and the convex hull defect rate.
[0082] Specifically, in step S5, the calculation steps for the internal lesion parameters include:
[0083] Based on the local texture features of the abnormal region, the texture lesion component of the abnormal region is calculated. The texture lesion component is obtained by calculating the entropy value of the gray-level co-occurrence matrix of the corresponding region in the white light reflectance map of the abnormal region.
[0084] Based on the fused spectral feature vector, the spectral lesion component of the abnormal region is calculated. The spectral lesion component is obtained by calculating the spectral deviation between the fused spectral feature vector of the abnormal region and the pre-stored standard healthy seed spectral vector.
[0085] The internal lesion parameters are obtained by weighted summation of the texture lesion component and the spectral lesion component.
[0086] In the specific implementation process, the morphological integrity parameters are first calculated. For each individual seed to be evaluated, its projected area and perimeter are obtained from the extracted overall morphological contour features. Using the constant pi, four times pi is multiplied by the projected area, and then divided by the square of the perimeter to calculate the seed's contour roundness value. Simultaneously, the convex hull area and the actual projected area of the seed are obtained, and the difference between them is calculated. This difference is then divided by the convex hull area to obtain the convex hull defect rate value. Next, the calculated contour roundness value and convex hull defect rate value are linearly weighted and combined according to a set of fixed weighting coefficients pre-calibrated experimentally. For example, the contour roundness value is multiplied by a weighting coefficient of 0.6... The value after subtracting the convex hull defect rate is multiplied by a weighting coefficient of 0.4, and the two products are added together to obtain the morphological integrity parameter of the single seed. The higher the morphological integrity parameter, the more complete and full the seed shape. Next, the internal lesion parameter is calculated. For each abnormal region recorded in the association table between the abnormal region and the single seed, its texture lesion component is first calculated. Based on the extracted local texture features of the abnormal region, for each seed recorded in the association table, each abnormal region to which it belongs is traversed. According to the type of the abnormal region and its pixel coordinate set, the same coordinate region is located and cropped in the original white light reflection image to obtain the local white light image patch corresponding to the abnormal region. For this local image... For each pixel patch, its gray-level co-occurrence matrix (GLCM) is calculated to describe the texture. Specifically, this involves defining the positional relationship between pixel pairs in the zero-degree direction and at a one-pixel interval, and statistically analyzing the probability of gray-level value combinations of all pixel pairs satisfying this positional relationship in the image, forming a two-dimensional probability matrix. Based on this GLCM, its entropy is calculated. The entropy calculation process involves iterating through each probability value in the matrix, multiplying each probability value by its base-2 logarithm, summing all these products, and taking the negative value. The calculated entropy value is the texture lesion component of the abnormal region. Simultaneously, the spectral lesion component of the abnormal region is calculated based on the extracted fusion spectral feature vector of the region and a standard healthy seed obtained through statistical analysis of a large number of healthy seed samples. The spectral feature vectors are used to calculate the spectral deviation between two vectors. For example, an algorithm is used to calculate the cosine of the angle between the vectors and then inversely calculate the angle. This involves first calculating the dot product of the two vectors, then calculating the magnitudes of each vector, dividing the dot product by the product of the magnitudes to obtain the cosine value, and finally using the inverse cosine function to obtain the angle in radians. This angle in radians is used as the spectral deviation, representing the degree of difference between the current region's spectral characteristics and health standards. Next, the texture lesion component and the spectral lesion component are normalized to the range of 0 to 1, and then weighted and summed according to another set of preset weighting coefficients. For example, the normalized spectral lesion component is multiplied by a weighting coefficient of 0.7, and the normalized texture lesion component is multiplied by a weighting coefficient of 0.3. The results are then summed to obtain the single-point internal lesion value of the abnormal region. If a seed contains multiple abnormal regions, the average of the single-point internal lesion values for all regions is determined as the final internal lesion parameter for that single seed. Finally, a defect confidence score is synthesized. The morphological integrity parameter is converted into its defect morphological contribution value. Specifically, the morphological integrity parameter is subtracted from 1, and then this defect morphological contribution value is weighted and summed with the internal lesion parameter according to the final decision weight coefficient. The result obtained is the defect confidence score for that single seed. A higher score indicates a higher confidence that the seed is determined to be a defective seed, which is used as the basis for the final decision.
[0087] Step S6: Determine the defect seed based on the defect confidence score, and generate a nozzle flexible airflow impact command based on the location of the defect seed to remove the defect seed.
[0088] In the specific implementation process, the first step is to determine the defective seeds. The defect confidence score of all individual seeds is compared with a preset rejection threshold. If the defect confidence score of a seed is greater than the preset rejection threshold, the seed is determined to be a defective seed and needs to be rejected. A defective seed instruction list containing the unique identifier of the seed is generated. Next, a nozzle flexible airflow impact command is generated based on the location of the defective seed. The system uses the seed identifier in the defective seed instruction list to backtrack and query the abnormal region and individual seed association table and the individual seed segmentation mask to obtain the position information of the defective seed in the image coordinate system. The centroid pixel coordinates of its segmentation mask are used as the representative. At the same time, combined with pre-calibrated system parameters, namely the physical distance from the camera imaging plane to the downstream nozzle array plane and the constant running speed of the conveyor belt, the system calculates in real time the movement of the defective seed from the imaging position to the nozzle array. The time required directly below the seed, i.e., the trigger delay, is used to convert the pixel coordinates of the seed in the image into physical position coordinates relative to the nozzle array using the camera calibration matrix, thereby determining which specific nozzle in the nozzle array should be activated. Then, a specific flexible airflow impact command is synthesized. This command is a structured data packet that includes at least the target nozzle number, the calculated trigger delay time, and the intensity and duration parameters of the airflow pulse. Finally, the rejection action is executed. After receiving the above command, the nozzle array controller enters a waiting state. Before the seed arrives, the trigger delay time is precisely calculated. The controller generates a high-speed airflow pulse towards the target nozzle specified in the command, which precisely impacts the side of the defective seed that has arrived at the predetermined position, giving it a lateral acceleration. This causes it to deviate from the original falling trajectory of the qualified seed and fall into the designated waste collection channel, thereby completing the selective and precise rejection of a single defective seed.
[0089] The working principle of the quinoa seed screening and control method provided by this invention is as follows:
[0090] This invention acquires surface morphology and internal composition information of quinoa seeds by synchronously or quasi-synchronously acquiring images of white light and two characteristic near-infrared bands. Then, using the white light image, edge detection and a watershed algorithm are used to segment the tightly packed seed clusters, assigning a unique identifier to each seed for individualized tracking. For internal defect detection, the two near-infrared images are compared pixel-by-pixel with the white light image and normalized to generate feature difference maps highlighting moisture and mold abnormalities. On this map, adaptive threshold segmentation and morphological processing are used to locate abnormal regions, which are then precisely associated with the aforementioned individual seed identifiers to achieve... The system assigns individual defect points and extracts feature vectors that integrate dual-band spectral information. For suspected seeds, it extracts overall morphological contour features from their white light images in parallel to assess shape regularity and extracts local texture features from abnormal areas to quantify surface micro-changes. Finally, it weights and fuses the integrity parameter representing the external morphology with the internal lesion parameter that integrates texture and spectral abnormality information to calculate a comprehensive defect confidence score. Based on this score and its spatial location information, it drives a flexible airflow to precisely remove defect seeds, thereby achieving simultaneous, efficient, and accurate single-particle screening of external deformities and internal lesions.
[0091] Example 2
[0092] A quinoa seed screening and control system, in the specific implementation process, such as Figure 2 As shown, it illustrates a modular structure diagram of a quinoa seed screening control system according to the present invention, comprising:
[0093] The multispectral image acquisition module 100 is used to simultaneously acquire the white light reflectance image, the first near-infrared absorption image and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm.
[0094] The feature difference map generation module 200 is used to generate a first feature difference map based on the white light reflectance map and the first near-infrared absorption map, and to generate a second feature difference map based on the white light reflectance map and the second near-infrared absorption map.
[0095] The anomaly detection association module 300 is used to obtain the abnormal region by applying adaptive threshold segmentation and morphological processing to the first feature difference map and the second feature difference map, respectively. Based on the abnormal region and the single seed segmentation mask, an association table of abnormal region and single seed is generated, and the fusion spectral feature vector of each abnormal region is extracted.
[0096] The multi-dimensional feature extraction module 400 is used to extract the overall morphological contour features of a single seed from the white light reflectance image based on the association table between abnormal regions and single seeds, and to extract the local texture features of each abnormal region from the white light reflectance image.
[0097] The defect confidence scoring module 500 is used to perform a weighted summation of the morphological integrity parameter calculated based on the overall morphological contour features of the same single seed and the internal lesion parameter calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed.
[0098] The rejection and screening execution module 600 is used to determine defect seeds based on defect confidence scores, and to generate nozzle flexible airflow impact commands to reject defect seeds based on the location of the defect seeds.
[0099] The working principle of the quinoa seed screening and control system provided by this invention is as follows:
[0100] This invention simultaneously acquires three images of quinoa seeds—white light, first, and second near-infrared—using a multispectral image acquisition module 100. The white light image is then used to segment and label each seed. A feature difference map generation module 200 then performs pixel-by-pixel ratio calculations and normalization on the two near-infrared images and the white light image, generating feature maps that highlight internal anomalies related to moisture and mold, respectively. Anomaly detection and association module 300 performs adaptive threshold segmentation on these feature maps to locate abnormal pixel regions and precisely associates these regions with the single-seed identifier in the segmentation mask, while simultaneously extracting feature vectors that fuse dual-band spectral information. A multi-dimensional feature extraction module 400 then... Based on the aforementioned correlation, the system intelligently extracts the overall morphological outline and local texture features of each abnormal area from the white light image of the suspected seed. The defect confidence scoring module 500 aggregates three types of features: morphology, texture, and spectrum. By calculating the morphological integrity parameter and the internal lesion parameter and performing weighted fusion, it outputs a comprehensive defect score for each seed. Finally, the rejection and screening execution module 600 makes rejection decisions based on the score and, combined with the spatial location information of the seed, generates control commands to drive the flexible airflow nozzle array to eject the defective seed from the seed stream at a precise moment. This achieves fully automatic, high-throughput, and high-precision sorting of seeds with malformed appearance and internal lesions at the system level.
[0101] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0102] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0103] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
Claims
1. A method for screening and controlling quinoa seeds, characterized in that, The screening control method includes: S1: Simultaneously acquire the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm; S2: Based on the white light reflectance map and the first near-infrared absorption map, generate a first feature difference map; based on the white light reflectance map and the second near-infrared absorption map, generate a second feature difference map. S3: For the first feature difference map and the second feature difference map, adaptive threshold segmentation and morphological processing are applied respectively to obtain the abnormal regions. Based on the abnormal regions and the single seed segmentation mask, an association table of abnormal regions and single seeds is generated, and the fusion spectral feature vector of each abnormal region is extracted. S4: Based on the association table between abnormal regions and single seeds, extract the overall morphological contour features of single seeds from the white light reflectance map, and extract the local texture features of each abnormal region from the white light reflectance map. S5: The morphological integrity parameter calculated based on the overall morphological contour features of the same single seed is weighted and summed with the internal lesion parameters calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed. S6: Determine defect seeds based on defect confidence scores, and generate nozzle flexible airflow impact commands based on the location of defect seeds to remove them; In step S1, the first near-infrared absorption image and the second near-infrared absorption image are grayscale images representing the spatial distribution of absorption intensity, obtained by comparing the reflected light intensity of quinoa seeds to the first preset near-infrared band and the second preset near-infrared band with a preset reference light intensity. The first near-infrared light source is used to detect abnormal moisture levels inside the seed, with its main emission wavelength ranging from 960 nm to 980 nm. The second near-infrared light source is used to detect mold growth, with its center wavelength ranging from 1190 nm to 1210 nm.
2. The method for screening and controlling quinoa seeds according to claim 1, characterized in that, In step S1, the steps of simultaneously acquiring the white light reflectance image, the first near-infrared absorption image, and the second near-infrared absorption image of quinoa seeds include: White light reflection image, first near-infrared absorption image and second near-infrared absorption image are collected in a preset time sequence, and the sum of the collection time intervals ensures that the displacement of a single seed moving along the transport direction does not exceed one-tenth of the average size of a single seed.
3. The method for screening and controlling quinoa seeds according to claim 2, characterized in that, In step S1, the steps for obtaining the single-seed segmentation mask include: Edge detection and adaptive threshold segmentation are performed on the white light reflectance image to obtain an initial binary image. Morphological opening operation is performed on the initial binary image to eliminate noise, and hole filling is performed to obtain an optimized binary image. Calculate the distance transformation map of the optimized binary map, and use the local maxima points on the distance transformation map as foreground markers for the watershed algorithm; A morphological dilation operation is performed on the optimized binary image, and the difference between the dilation result and the optimized binary image is calculated to obtain a determined background region as the background marker. Using foreground and background markers as control signals, a watershed algorithm is performed on the distance transformation map to obtain independent segmentation regions for each individual seed. Assign a unique integer identifier to each individual seed's independent segmentation region, and generate a single-seed segmentation mask with the same size as the white light reflectance map.
4. The method for screening and controlling quinoa seeds according to claim 3, characterized in that, In step S2, the generation of the first feature difference map and the second feature difference map includes: The gray values of each pixel in the first near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the first feature difference map. The gray values of each pixel in the second near-infrared absorption map are divided pixel by pixel with the corresponding pixel gray values in the white light reflection map, and the results are numerically normalized to obtain the second feature difference map.
5. The method for screening and controlling quinoa seeds according to claim 4, characterized in that, In step S3, adaptive threshold segmentation includes: The first adaptive threshold is obtained by adding the overall gray-level mean of the first feature difference map to the first adjustment amount, wherein the first adjustment amount is the product of the gray-level standard deviation of the first feature difference map and the first sensitivity coefficient, and the first sensitivity coefficient is dynamically adjusted based on the overall contrast of the first feature difference map. The second adaptive threshold is obtained by adding the overall gray-level mean of the second feature difference map to the second adjustment amount, wherein the second adjustment amount is the product of the gray-level standard deviation of the second feature difference map and the second sensitivity coefficient, and the second sensitivity coefficient is dynamically adjusted based on the overall contrast of the second feature difference map.
6. The method for screening and controlling quinoa seeds according to claim 5, characterized in that, In step S3, the acquisition of the abnormal region includes: The first feature difference map is compared with the first adaptive threshold, and the region with a pixel value greater than the first adaptive threshold is identified as a moisture abnormality region. The second feature difference map is compared with the second adaptive threshold, and the region with a pixel value greater than the second adaptive threshold is identified as a mold abnormality region. The moisture abnormality region and the mold abnormality region constitute an abnormal region.
7. The method for screening and controlling quinoa seeds according to claim 6, characterized in that, In step S5, the calculation steps for the morphological integrity parameter include: The circularity of a single seed's outline is calculated based on the area and perimeter of the single seed segmentation mask. The convex hull defect rate of a single seed is calculated based on the difference between the convex hull area and the actual area of the single seed segmentation mask. The morphological integrity parameter is obtained by weighting the contour roundness and the convex hull defect rate.
8. The method for screening and controlling quinoa seeds according to claim 7, characterized in that, In step S5, the calculation steps for internal lesion parameters include: Based on the local texture features of the abnormal region, the texture lesion component of the abnormal region is calculated. The texture lesion component is obtained by calculating the entropy value of the gray-level co-occurrence matrix of the corresponding region in the white light reflectance map of the abnormal region. Based on the fused spectral feature vector, the spectral lesion component of the abnormal region is calculated. The spectral lesion component is obtained by calculating the spectral deviation between the fused spectral feature vector of the abnormal region and the pre-stored standard healthy seed spectral vector. The internal lesion parameters are obtained by weighted summation of the texture lesion component and the spectral lesion component.
9. A quinoa seed screening and control system, characterized in that, The method for screening and controlling quinoa seeds as described in any one of claims 1 to 8, wherein the screening and control system comprises: The multispectral image acquisition module is used to simultaneously acquire the white light reflectance image, the first near-infrared absorption image and the second near-infrared absorption image of quinoa seeds, and obtain the single seed segmentation mask based on the white light reflectance image by instance segmentation based on edge detection and watershed algorithm. The feature difference map generation module is used to generate a first feature difference map based on the white light reflectance map and the first near-infrared absorption map, and to generate a second feature difference map based on the white light reflectance map and the second near-infrared absorption map. The anomaly detection association module is used to obtain the abnormal regions by applying adaptive threshold segmentation and morphological processing to the first feature difference map and the second feature difference map, respectively. Based on the abnormal regions and the single seed segmentation mask, an association table of abnormal regions and single seeds is generated, and the fusion spectral feature vector of each abnormal region is extracted. The multi-dimensional feature extraction module is used to extract the overall morphological contour features of a single seed from the white light reflectance image based on the association table between abnormal regions and single seeds, and to extract the local texture features of each abnormal region from the white light reflectance image. The defect confidence scoring module is used to perform a weighted summation of the morphological integrity parameter calculated based on the overall morphological contour features of the same single seed and the internal lesion parameter calculated based on the local texture features and fused spectral feature vectors of each abnormal region of the same single seed to obtain the defect confidence score of the single seed. The rejection and screening execution module is used to determine defect seeds based on defect confidence scores, and generate nozzle flexible airflow impact commands based on the location of the defect seeds to reject them.
Citation Information
Patent Citations
Rapid vehicle customs clearance checking method
CN118038424A