A nondestructive testing method for rice seeds

Through hyperspectral imaging and Markov random field model, combined with texture gradient and mixed kernel function, the destructiveness and misjudgment problems of rice seed detection are solved, and efficient and accurate non-destructive detection is achieved.

CN120495901BActive Publication Date: 2025-09-12CHENGDU VOCATIONAL COLLEGE OF AGRI SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510948935.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-09-12
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

Traditional rice seed testing methods are destructive, highly subjective, and inefficient. In addition, non-destructive testing based on spectral characteristics is susceptible to contamination and uneven lighting, resulting in a high rate of misjudgment of impurities.

Method used

Hyperspectral imaging technology is used to extract the spatial texture features of rice seeds through the Harris matrix and Markov random field model, combined with texture gradient and mixed kernel function, to achieve non-destructive detection.

Benefits of technology

It realizes efficient, accurate and non-destructive testing of rice seeds, reduces labor costs, is suitable for multi-variety testing, and reduces missed detection and misjudgment of tiny impurities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495901B_ABST
    Figure CN120495901B_ABST
Patent Text Reader

Abstract

This invention discloses a nondestructive testing method for rice seeds, which relates to the field of image processing technology. The method comprises the following steps: S1. capturing a current seed image using a hyperspectral camera; S2. preprocessing the current seed image to determine the spatial texture characteristics of each pixel based on the texture gradient value of the latest seed image; and S3. determining the presence of impurities in the rice seeds based on the spatial texture characteristics of the latest seed image. This method is adaptive to different rice seed varieties, eliminating the need for model retraining, meeting the multi-variety testing needs of seed companies and reducing labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a non-destructive detection method for rice seeds. Background Art

[0002] Rice seed quality testing is critical for ensuring agricultural yields and food security. Traditional testing methods (such as germination tests and manual visual inspection) are destructive, subjective, and inefficient, making them inefficient and unable to meet the modern seed industry's demand for high-throughput and precise nondestructive testing. In recent years, with the advancement of spectral imaging and computer vision technologies, nondestructive testing techniques based on hyperspectral imaging and texture feature analysis have become a research hotspot. However, the spectral reflectance characteristics of different substances (such as seed endosperm, impurities, and insect-infested areas) vary significantly. Therefore, relying solely on spectral features is susceptible to interference from factors such as seed surface contamination and uneven lighting, resulting in a high rate of misidentification of impurities. Summary of the Invention

[0003] In order to solve the above problems, the present invention proposes a non-destructive detection method for rice seeds.

[0004] The technical solution of the present invention is: a non-destructive testing method for rice seeds comprises the following steps:

[0005] S1, using a hyperspectral camera to collect the current seed image;

[0006] S2. Preprocess the current seed image and determine the spatial texture features of each pixel based on the texture gradient value of the latest seed image;

[0007] S3. Determine whether there are impurities in the rice seeds based on the spatial texture features of the latest seed image.

[0008] Furthermore, S2 includes the following sub-steps:

[0009] S21, performing denoising processing on the current seed image;

[0010] S22, obtaining the Harris matrix of each pixel in the latest seed image after denoising;

[0011] S23, generating a texture gradient value for the latest seed image according to the Harris matrix of each pixel point in the latest seed image;

[0012] S24. Extracting spatial texture features of each pixel in the latest seed image according to the texture gradient value of the latest seed image.

[0013] The beneficial effect of the above further solution is that in the present invention, the denoised image can reduce the deviation of the subsequent Harris matrix calculation, especially under low light or complex background conditions, to ensure the stability of feature extraction. The traditional Harris matrix is ​​used for corner detection, and here the intensity of the gradient change of the texture around the pixel point is quantified by its determinant value. The larger the determinant value, the more significant the texture change in the area (such as the difference between impurities and seed surfaces), providing mathematical support for texture gradient calculation. The Harris matrix is ​​sensitive to local structural changes and can capture texture heterogeneity caused by tiny impurities (such as sand grains with a diameter of <0.5mm), solving the problem of traditional methods missing tiny impurities.

[0014] Furthermore, S23 includes the following sub-steps:

[0015] S231, using the row and column values ​​of the Harris matrix of each pixel as the gradient coefficient of the pixel;

[0016] S232. Generate a texture gradient value for the latest seed image according to the gradient coefficient of each pixel point.

[0017] The beneficial effect of the above further solution is that: in the present invention, the row and column values ​​are used as gradient coefficients, which are directly related to the local texture intensity of the pixel point, and the Harris matrix calculation and logarithmic transformation complexity are low. The value is generated adaptively based on the image content.

[0018] Furthermore, in S232, the texture gradient value of the latest seed image The calculation formula is:

[0019] ;

[0020] Where, represents the logarithmic function with base 2, Indicates the The gradient coefficient of each pixel, Indicates the total number of pixels in the latest seed image, Represents the standard deviation of the gradient coefficients of all pixels in the latest seed image.

[0021] The beneficial effects of this further solution are as follows: In this invention, the numerator compresses the dynamic range of large gradient values, preventing a few abnormally high gradient values ​​from dominating the overall calculation, while enhancing the contribution of small gradient values, making the texture gradient distribution more balanced. The denominator normalizes the result to reflect overall texture fluctuations, allowing direct comparison of S values ​​obtained from different seeds or different imaging conditions.

[0022] Furthermore, S24 includes the following sub-steps:

[0023] S241, using the texture gradient value of the latest seed image as the weight of the hybrid kernel function;

[0024] S242, extracting the Harris matrices of the four neighboring pixels of the pixel point, and summing the Harris matrices of the four neighboring pixels to obtain a correlation matrix;

[0025] S243. Construct a hybrid kernel function according to the weight of the hybrid kernel function, the Harris matrix of the pixel points, and the correlation matrix, and use the hybrid kernel function to determine the spatial texture features of each pixel point.

[0026] The beneficial effect of the above further scheme is: in the present invention, the texture gradient value is used as the weight of the hybrid kernel function, so that the kernel function gives higher weight to the texture complex area (such as the edge of impurities), thereby enhancing the sensitivity of local features. The Harris matrix of the four neighborhood pixels is extracted and summed to generate a correlation matrix to capture the structural consistency (such as the smooth area of ​​the seed surface) or heterogeneity (such as the junction of impurities and seeds) of the local neighborhood. The hybrid kernel function simultaneously fuses the current pixel Harris matrix and the neighborhood correlation matrix to achieve joint encoding of single-point features and spatial context, avoiding misjudgment caused by traditional methods due to ignoring neighborhood information (such as misjudging local noise as impurities). The summation of the four neighborhood Harris matrices smoothes noise (such as sensor noise or uneven lighting) through a local averaging effect, while retaining structural information (such as texture directionality).

[0027] Furthermore, in S243, the hybrid kernel function The expression is:

[0028] ;

[0029] Where, represents the weight of the mixed kernel function, represents the kernel bandwidth parameter, Represents the Harris matrix of the pixel point, Represents the correlation matrix of pixels, represents the index, Represents the F1 norm operation.

[0030] The above further solution has the following beneficial effects: In the present invention, the F1 norm is more robust to outliers than the F2 norm (Euclidean distance), preserves independent difference information in each dimension, and is more suitable for detecting texture edges. The kernel bandwidth δ can be dynamically adjusted with texture complexity (e.g., determined through unsupervised learning), balancing detail capture with global consistency.

[0031] Furthermore, S3 includes the following sub-steps:

[0032] S31, taking the spatial texture features of the pixel points as random variables of the pixel points;

[0033] S32. Based on the random variables of each pixel point, use the Markov random field to determine whether there is impurity in the latest seed image.

[0034] The beneficial effect of the above further solution is that in the present invention, MRF (Markov Random Field) explicitly models spatial dependencies by defining a neighborhood system (such as a 4-neighborhood, an 8-neighborhood) and a potential function between pixels.

[0035] The beneficial effects of the present invention are as follows: the present invention realizes efficient and accurate non-destructive detection of impurities in rice seeds through the collaborative innovation of hyperspectral imaging, texture feature extraction and Markov random field modeling. The present invention captures the intensity of texture changes through the row and column values ​​of the Harris matrix, strengthens the spatial constraints of the image, and improves the detection rate of tiny impurities; and combines the current pixel Harris matrix with the neighborhood correlation matrix, quantifies texture differences through exponential decay and norm, and enhances the expression ability of complex texture patterns (such as insect tracks). In summary, the present invention is adaptive to different varieties of rice seeds, does not require retraining of the model, meets the multi-variety detection needs of seed companies, and reduces labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Flowchart of the nondestructive testing method for rice seeds. DETAILED DESCRIPTION

[0037] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, the present invention provides a non-destructive testing method for rice seeds, comprising the following steps:

[0039] S1, using a hyperspectral camera to collect the current seed image;

[0040] S2. Preprocess the current seed image and determine the spatial texture features of each pixel based on the texture gradient value of the latest seed image;

[0041] S3. Determine whether there are impurities in the rice seeds based on the spatial texture features of the latest seed image.

[0042] In this embodiment of the present invention, S2 includes the following sub-steps:

[0043] S21, performing denoising processing on the current seed image;

[0044] S22, obtaining the Harris matrix of each pixel in the latest seed image after denoising;

[0045] S23, generating a texture gradient value for the latest seed image according to the Harris matrix of each pixel point in the latest seed image;

[0046] S24. Extracting spatial texture features of each pixel in the latest seed image according to the texture gradient value of the latest seed image.

[0047] In the present invention, the denoised image can reduce the deviation of the subsequent Harris matrix calculation, especially in low light or complex background conditions, to ensure the stability of feature extraction. The traditional Harris matrix is ​​used for corner detection, and here the intensity of the gradient change of the texture around the pixel point is quantified by its determinant value. The larger the determinant value, the more significant the texture change in the area (such as the difference between impurities and seed surfaces), providing mathematical support for texture gradient calculation. The Harris matrix is ​​sensitive to local structural changes and can capture texture heterogeneity caused by tiny impurities (such as sand particles with a diameter of <0.5mm), solving the problem of traditional methods missing tiny impurities.

[0048] In this embodiment of the present invention, S23 includes the following sub-steps:

[0049] S231, using the row and column values ​​of the Harris matrix of each pixel as the gradient coefficient of the pixel;

[0050] S232. Generate a texture gradient value for the latest seed image according to the gradient coefficient of each pixel point.

[0051] In the present invention, the row and column values ​​are used as gradient coefficients, which are directly related to the local texture intensity of the pixel point. The Harris matrix calculation and logarithmic transformation complexity are low. The value is generated adaptively based on the image content.

[0052] In the embodiment of the present invention, in S232, the texture gradient value of the latest seed image The calculation formula is:

[0053] ;

[0054] Where, represents the logarithmic function with base 2, Indicates the The gradient coefficient of each pixel, Indicates the total number of pixels in the latest seed image, Represents the standard deviation of the gradient coefficients of all pixels in the latest seed image.

[0055] In this paper, the numerator compresses the dynamic range of large gradient values ​​to prevent a few abnormally high gradient values ​​from dominating the overall calculation, while also enhancing the contribution of small gradient values, resulting in a more balanced texture gradient distribution. The denominator normalizes the result to reflect overall texture fluctuations, allowing direct comparison of S values ​​from different seeds or imaging conditions.

[0056] In this embodiment of the present invention, S24 includes the following sub-steps:

[0057] S241, using the texture gradient value of the latest seed image as the weight of the hybrid kernel function;

[0058] S242, extracting the Harris matrices of the four neighboring pixels of the pixel point, and summing the Harris matrices of the four neighboring pixels to obtain a correlation matrix;

[0059] S243. Construct a hybrid kernel function according to the weight of the hybrid kernel function, the Harris matrix of the pixel points, and the correlation matrix, and use the hybrid kernel function to determine the spatial texture features of each pixel point.

[0060] In the present invention, the texture gradient value is used as the weight of the hybrid kernel function, so that the kernel function gives higher weight to the texture complex area (such as the edge of impurities), thereby enhancing the sensitivity of local features. The Harris matrix of the four neighborhood pixels is extracted and summed to generate a correlation matrix to capture the structural consistency (such as the smooth area of ​​the seed surface) or heterogeneity (such as the junction of impurities and seeds) of the local neighborhood. The hybrid kernel function simultaneously fuses the current pixel Harris matrix and the neighborhood correlation matrix to achieve joint encoding of single-point features and spatial context, avoiding misjudgment caused by traditional methods due to ignoring neighborhood information (such as misjudging local noise as impurities). The summation of the four neighborhood Harris matrices smoothes noise (such as sensor noise or uneven lighting) through a local averaging effect, while retaining structural information (such as texture directionality).

[0061] In the embodiment of the present invention, in S243, the hybrid kernel function The expression is:

[0062] ;

[0063] Where, represents the weight of the mixed kernel function, represents the kernel bandwidth parameter, Represents the Harris matrix of the pixel point, Represents the correlation matrix of pixels, represents the index, Represents the F1 norm operation.

[0064] In this paper, the F1 norm is more robust to outliers than the F2 norm (Euclidean distance), preserves independent differences in each dimension, and is more suitable for detecting texture edges. The kernel bandwidth δ can be dynamically adjusted with texture complexity (e.g., determined through unsupervised learning), balancing detail capture with global consistency.

[0065] In this embodiment of the present invention, S3 includes the following sub-steps:

[0066] S31, taking the spatial texture features of the pixel points as random variables of the pixel points;

[0067] S32. Based on the random variables of each pixel point, use the Markov random field to determine whether there is impurity in the latest seed image.

[0068] In the present invention, MRF (Markov Random Field) explicitly models spatial dependencies by defining a neighborhood system (such as a 4-neighborhood, an 8-neighborhood) and a potential function between pixels.

[0069] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.

Claims

1. A nondestructive testing method for rice seeds, characterized in that: The following steps are involved: S1, using a hyperspectral camera to collect the current seed image; S2. Preprocess the current seed image and determine the spatial texture features of each pixel based on the texture gradient value of the latest seed image; S3, determining whether the rice seeds contain impurities based on the spatial texture features of the latest seed image; The S2 includes the following sub-steps: S21, performing denoising processing on the current seed image; S22, obtaining the Harris matrix of each pixel in the latest seed image after denoising; S23, generating a texture gradient value for the latest seed image according to the Harris matrix of each pixel point in the latest seed image; S24, extracting the spatial texture features of each pixel in the latest seed image according to the texture gradient value of the latest seed image; The S3 includes the following sub-steps: S31, taking the spatial texture features of the pixel points as random variables of the pixel points; S32. Based on the random variables of each pixel point, use the Markov random field to determine whether there is impurity in the latest seed image.

2. The nondestructive testing method for rice seeds according to claim 1, characterized in that: The S23 includes the following sub-steps: S231, using the row and column values ​​of the Harris matrix of each pixel as the gradient coefficient of the pixel; S232. Generate a texture gradient value for the latest seed image according to the gradient coefficient of each pixel point.

3. The nondestructive testing method for rice seeds according to claim 2, characterized in that: In the step S232, the texture gradient value of the latest seed image The calculation formula is: ; Where, represents the logarithmic function with base 2, Indicates the The gradient coefficient of each pixel, Indicates the total number of pixels in the latest seed image, Represents the standard deviation of the gradient coefficients of all pixels in the latest seed image.

4. The nondestructive testing method for rice seeds according to claim 1, characterized in that: The S24 includes the following sub-steps: S241, using the texture gradient value of the latest seed image as the weight of the hybrid kernel function; S242, extracting the Harris matrices of the four neighboring pixels of the pixel point, and summing the Harris matrices of the four neighboring pixels to obtain a correlation matrix; S243. Construct a hybrid kernel function according to the weight of the hybrid kernel function, the Harris matrix of the pixel points, and the correlation matrix, and use the hybrid kernel function to determine the spatial texture features of each pixel point.

5. The nondestructive testing method for rice seeds according to claim 4, characterized in that: In S243, the mixed kernel function The expression is: ; Where, represents the weight of the mixed kernel function, represents the kernel bandwidth parameter, Represents the Harris matrix of the pixel point, Represents the correlation matrix of pixels, represents the index, Represents the F1 norm operation.

Citation Information

Patent Citations

  • Local and non-local multi-feature semantics-based hyperspectral image classification method

    CN106529508A

  • Single corn seed moisture content detection method based on near infrared hyperspectrum

    CN113049530A