Bamboo shoot quality detection method and system based on hyperspectral image and medium

Through hyperspectral image technology, the characteristic bands of bamboo shoots and the spectral deviation are extracted, which solves the problems of low efficiency and destructiveness of traditional bamboo shoot quality detection methods, and realizes lossless and efficient detection of bamboo shoot quality, which is suitable for large-scale production.

CN119147480AInactive Publication Date: 2024-12-17GUANGDONG AIB POLYTECHNIC COLLEGE

Patent Information

Application Number
CN202411399982.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional bamboo shoot quality testing methods take a long time, are inefficient and may damage samples, making it impossible to achieve lossless and efficient quality testing.

Method used

Using a detection method based on hyperspectral image, the hyperspectral image of the target bamboo shoots is obtained, the characteristic bands are extracted, and the spectral deviation is calculated to achieve lossless and efficient detection of bamboo shoot quality.

Benefits of technology

It realizes automated, non-destructive and efficient inspection of bamboo shoot quality, and is suitable for large-scale production inspection, improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119147480A_ABST
    Figure CN119147480A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a bamboo shoot quality detection method and system based on a hyperspectral image and a medium, and the method comprises the following steps: acquiring a first hyperspectral image acquired from a target bamboo shoot; obtaining K characteristic wave bands of a target bamboo shoot, extracting K first spectral images in one-to-one correspondence with the K characteristic wave bands from the first hyperspectral image, and respectively determining reflectivity matrixes of the K first spectral images; determining the spectral deviation degree corresponding to the first spectral image based on the reflectivity matrix, and determining the quality of the target bamboo shoot based on the spectral deviation degree of each first spectral image; the method can realize lossless and efficient detection of bamboo shoot quality.
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 method, system and medium for detecting bamboo shoot quality based on hyperspectral images. Background Art

[0002] The freshness of bamboo shoots comes from the free amino acids and sugars in them, especially glutamic acid and aspartic acid, which are the source of the freshness of bamboo shoots, while sugar gives them a sweet and crisp taste. The younger the bamboo shoots are, the higher the content of amino acids and sugars, the less fiber, and the better the flavor and taste.

[0003] However, bamboo shoots have extremely vigorous life activities. When bamboo shoots are harvested, the sources of amino acids and sugars are stopped, but their transformation continues, even more vigorously. Studies have tested the respiration of bamboo shoots after harvesting and found that there is even a peak after 5 hours. Amino acids have been largely decomposed and sugars have been fibrotic, resulting in a decline in the quality of bamboo shoots and affecting their edibility.

[0004] Therefore, it is extremely important to analyze and predict the nutritional content and quality of bamboo shoots. Traditional bamboo shoot quality detection methods rely on manual sensory evaluation or chemical analysis, which are time-consuming, inefficient, and may damage the sample. With the development of hyperspectral imaging technology, the spectral information of bamboo shoots can be quickly and non-destructively acquired, thereby realizing efficient detection of its quality. How to use hyperspectral images of bamboo shoots to perform non-destructive and efficient quality detection of bamboo shoots has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] To solve the above problems, the present invention provides a bamboo shoot quality detection method, system and medium based on hyperspectral imaging, aiming to achieve non-destructive and efficient detection of bamboo shoot quality.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] On the one hand, an embodiment of the present invention provides a method for detecting bamboo shoot quality based on hyperspectral images, the method comprising the following steps:

[0008] Acquire a first hyperspectral image collected from the target bamboo shoots;

[0009] Acquire K characteristic bands of the target bamboo shoots, extract K first spectral images corresponding to the K characteristic bands from the first hyperspectral image, and determine the reflectance matrices of the K first spectral images respectively;

[0010] The spectral deviation of the corresponding first spectral image is determined based on the reflectance matrix, and the quality of the target bamboo shoots is determined based on the spectral deviation of each first spectral image.

[0011] Optionally, the K characteristic bands of the target bamboo shoots are predetermined by:

[0012] Acquire a sample image set, wherein the sample image set includes a plurality of second hyperspectral images; wherein the second hyperspectral images are hyperspectral images collected from standard bamboo shoot samples;

[0013] The transmission spectrum of each of the second hyperspectral images and the fiber content of the corresponding bamboo shoot standard sample are obtained, a linear regression model of the transmission spectrum and fiber content of each of the second hyperspectral images is established, the regression correlation coefficient of each of the linear regression models is calculated, and the sampling bands corresponding to K larger regression correlation coefficients are selected as feature bands to obtain K feature bands.

[0014] Optionally, determining the spectral deviation of the corresponding first spectral image based on the reflectance matrix, and determining the quality of the target bamboo shoots based on the spectral deviation of each first spectral image includes:

[0015] For each first spectral image, determining an intensity value of each pixel in the first spectral image, and dividing the first spectral image into a plurality of sequentially adjacent spectral regions based on the intensity value;

[0016] Obtaining a reflectance threshold of each characteristic band, determining a characteristic band corresponding to the first spectral image, and using the reflectance threshold of the characteristic band as the reflectance threshold of the first spectral image;

[0017] Determine a reflectivity matrix of each spectral region in the first spectral image, determine a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectivity matrix and a reflectivity threshold, and determine a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient; wherein the reflectivity matrix includes the reflectivity of each pixel in the spectral region;

[0018] Obtaining an area ratio of each spectral region in the first spectral image, and determining a spectral deviation of the first spectral image based on a coefficient of variation and an area ratio of each spectral region;

[0019] Determine the characteristic band corresponding to each first spectral image, normalize the regression correlation coefficient corresponding to the characteristic band to obtain the weight of the first spectral image, and determine the quality of the target bamboo shoots based on the weight and spectral deviation of the first spectral image.

[0020] Optionally, the reflectance threshold for each feature band is predetermined by:

[0021] For each of the second hyperspectral images, selecting the second spectral images corresponding to the K characteristic bands in the second hyperspectral image, averaging the reflectances of the pixels in the second spectral image, and obtaining the average reflectance of the second spectral image;

[0022] The second spectral images with the same characteristic band in each of the second hyperspectral images are grouped together to obtain K sets corresponding to the K characteristic bands; the average reflectances of all the second spectral images in each set are averaged to obtain the average reflectance of the characteristic band corresponding to the set;

[0023] The average reflectivity of the characteristic band is multiplied by the adjustment coefficient to obtain the reflectivity threshold of the characteristic band; wherein the value range of the adjustment coefficient is (0, 1).

[0024] Optionally, determining a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectance matrix and the reflectance threshold, and determining a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient, comprises:

[0025] Obtain the reflectance threshold of the characteristic band corresponding to the spectral region;

[0026] A sliding window is used to traverse the spectral region, and a target matrix is ​​intercepted row by row and column by column in the reflectance matrix by the sliding window, and a difference between a reflectance mean value of the target matrix and the reflectance threshold value is determined as a reflectance difference value of the target matrix;

[0027] Determine a mean reflectance value of each row of the target matrix, and determine a first coefficient of variation of the spectral region based on the mean reflectance value of each row of the target matrix;

[0028] Selecting multiple columns of target matrices from the spectral region, averaging the reflectance differences of the multiple columns of target matrices to obtain a reflectance mean of the multiple columns of target matrices, and determining a second variation coefficient of the spectral region based on the reflectance mean of the multiple columns of target matrices and the reflectance mean of the spectral region,

[0029] The first variation coefficient and the second variation coefficient of the spectral region are multiplied and the square root is calculated to obtain the variation coefficient of the spectral region.

[0030] Optionally, the first variation coefficient is calculated by the following formula:

[0031]

[0032] Wherein, p=2,…,P, p represents the number of spectral regions, P represents the total number of spectral regions, Cp1 represents the first variation coefficient of the pth spectral region, i=2,…,M, i represents the number of rows of the target matrix, M is the total number of a row of the target matrix intercepted by the sliding window, N is the total number of a column of the target matrix intercepted by the sliding window, S(i) represents the mean reflectivity of the i-th row of the target matrix, and S(i-1) represents the mean reflectivity of the i-1th row of the target matrix.

[0033] Optionally, determining the second variation coefficient of the spectral region based on the reflectivity mean of the multi-column target matrix and the reflectivity mean of the spectral region includes:

[0034] Selecting n columns of target matrices from two adjacent spectral regions respectively, and determining the trend coefficient of the spectral region based on the n columns of target matrices in the two adjacent spectral regions;

[0035] Obtaining the reflectance average of two adjacent spectral regions, and determining the second variation coefficient of the spectral region in combination with the trend coefficient of the spectral region;

[0036] The trend coefficient of the spectral region is calculated by the following formula:

[0037]

[0038] The second variation coefficient is calculated by the following formula:

[0039]

[0040] Wherein, p=2,…,P, Cp2 represents the second variation coefficient of the p-th spectral region, j=2,…,n, 2<n<N / 2, j represents the number of columns of the target matrix, λp represents the trend coefficient of the p-th spectral region, S(p) represents the mean reflectance of the p-th spectral region, S(p-1) represents the mean reflectance of the p-1-th spectral region, S(j) represents the mean reflectance of the j-th column of the target matrix, S(j-1) represents the mean reflectance of the j-1-th column of the target matrix, S(p,j) represents the mean reflectance of the j-th column of the target matrix in the p-th spectral region, S(p,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-th spectral region, S(p-1,j) represents the mean reflectance of the j-th column of the target matrix in the p-1-th spectral region, and S(p-1,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-1-th spectral region.

[0041] Optionally, the spectral deviation of the first spectral image is calculated by the following formula:

[0042]

[0043] Wherein, D represents the spectral deviation of the first spectral image, Sp represents the pixel area of ​​the pth spectral region, and S represents the pixel area of ​​the first spectral image.

[0044] On the other hand, an embodiment of the present invention provides a bamboo shoot quality detection system based on hyperspectral images, comprising:

[0045] at least one processor;

[0046] at least one memory for storing at least one program;

[0047] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0048] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to perform the above method.

[0049] The beneficial effects of the present invention are as follows: the present invention discloses a bamboo shoot quality detection method, system and medium based on hyperspectral images. The present invention collects the first hyperspectral images of target bamboo shoots without destroying the target bamboo shoots; extracts K first spectral images corresponding to K characteristic bands one by one, and processes the reflectivity matrix of the K first spectral images, thereby improving the detection efficiency; determines the spectral deviation of the corresponding first spectral image based on the reflectivity matrix, and detects the quality of the bamboo shoots based on the spectral deviation of each first spectral image, and realizes efficient detection of bamboo shoot quality through the correlation between spectral deviation and bamboo shoot quality. The present invention can automatically realize non-destructive and efficient detection of bamboo shoot quality, and is suitable for large-scale production detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 It is a schematic diagram of a process of a bamboo shoot quality detection method based on hyperspectral images according to an embodiment of the present invention;

[0052] Figure 2 It is a structural schematic diagram of a bamboo shoot quality detection system based on hyperspectral imaging according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects disclosed in the present invention, so as to fully understand the purpose, scheme and effect disclosed in the present invention. It should be noted that the embodiments and features in the embodiments in this application can be combined with each other without conflict.

[0054] refer to Figure 1 ,like Figure 1 The present invention provides a method for detecting bamboo shoot quality based on hyperspectral images, which comprises the following steps:

[0055] S100, acquiring a first hyperspectral image collected from a target bamboo shoot;

[0056] Specifically, the bamboo shoots to be inspected are randomly inspected and the inspected bamboo shoots are used as target bamboo shoots; a hyperspectral imager is used to collect a hyperspectral image of the target bamboo shoots, and the bamboo shoot area in the hyperspectral image is extracted to obtain a first hyperspectral image.

[0057] S200, obtaining K characteristic bands of the target bamboo shoots, extracting K first spectral images corresponding to the K characteristic bands from the first hyperspectral image, and determining reflectance matrices of the K first spectral images respectively;

[0058] Specifically, the characteristic band can significantly reflect the reflectivity of the target bamboo shoots and has a good recognition effect. Selecting the first spectral image corresponding to the characteristic band and performing targeted processing on the reflectivity matrix of the selected first spectral image can improve the detection efficiency and obtain a better prediction effect.

[0059] S300, determining a spectral deviation corresponding to a first spectral image based on the reflectance matrix, and determining the quality of the target bamboo shoots based on the spectral deviation of each first spectral image.

[0060] Specifically, the spectral deviation corresponding to the first spectral image is determined by the reflectance matrix, the quality deviation of the target bamboo shoots is reflected by the spectral deviation, and the quality of the target bamboo shoots is expressed by the spectral deviation to achieve quantitative quality detection.

[0061] The present invention can automatically realize non-destructive and efficient detection of bamboo shoot quality by processing the first hyperspectral image of target bamboo shoots, and is suitable for large-scale production detection.

[0062] In some embodiments, the K characteristic bands of the target bamboo shoots are predetermined by:

[0063] S201, obtaining a sample image set, wherein the sample image set includes a plurality of second hyperspectral images; wherein the second hyperspectral images are hyperspectral images collected from bamboo shoot standard samples;

[0064] S202, obtaining the transmission spectrum of each of the second hyperspectral images and the fiber content of the corresponding bamboo shoot standard sample, establishing a linear regression model of the transmission spectrum and fiber content of each of the second hyperspectral images, calculating the regression correlation coefficient of each of the linear regression models, selecting K sampling bands corresponding to larger regression correlation coefficients as feature bands, and obtaining K feature bands.

[0065] Specifically, bamboo shoots of the same variety as the target bamboo shoots are selected as standard bamboo shoot samples, and hyperspectral images of the bamboo shoot samples are collected using a hyperspectral imager, and the bamboo shoot area in the hyperspectral image is extracted to obtain a second hyperspectral image. The linear regression model of the average transmission spectra and fiber content of multiple second spectral images is obtained by partial least squares regression or logistic regression. The larger the regression correlation coefficient, the more obvious the representation of the fiber content by the average transmission spectrum. By selecting the bands corresponding to N larger regression correlation coefficients as characteristic bands and focusing on processing the first spectral image of the characteristic band, the calculation efficiency can be improved and a better prediction effect can be obtained.

[0066] It should be noted that the standard sample of bamboo shoots refers to bamboo shoots that are of high-quality grade in terms of freshness and tenderness, that is, the highest quality bamboo shoots. The fiber content of the standard sample of bamboo shoots is measured by the ratio of the fiber squeezed from the standard sample of bamboo shoots to the weight of the standard sample of bamboo shoots. The fiber content can reflect the freshness and tenderness of the bamboo shoots. The lower the fiber content, the fresher the bamboo shoots.

[0067] When collecting hyperspectral images, irrelevant noise may exist in the spectral data due to the influence of factors such as the instrument or detection environment and light intensity. Therefore, it is necessary to preprocess the hyperspectral image collected from the bamboo shoot standard sample as the second hyperspectral image. Preprocessing methods such as inverse cotangent correction, wavelet threshold denoising, and median filtering can be used to eliminate the noise in the original spectral data.

[0068] In some embodiments, determining the spectral deviation of the corresponding first spectral image based on the reflectance matrix, and determining the quality of the target bamboo shoots based on the spectral deviation of each first spectral image, includes:

[0069] S310, for each first spectral image, determining an intensity value of each pixel in the first spectral image, and dividing the first spectral image into a plurality of sequentially adjacent spectral regions based on the intensity value;

[0070] Specifically, after denoising the first spectral image, the target bamboo shoot nodes are identified through a watershed algorithm based on the intensity value of each pixel in the first spectral image, and the first spectral image is divided vertically into a plurality of adjacent spectral regions, each spectral region corresponding to a section region in the bamboo shoot.

[0071] S320, obtaining a reflectance threshold of each characteristic band, determining a characteristic band corresponding to the first spectral image, and using the reflectance threshold of the characteristic band as the reflectance threshold of the first spectral image;

[0072] S330, determining a reflectivity matrix of each spectral region in the first spectral image, determining a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectivity matrix and a reflectivity threshold, and determining a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient; wherein the reflectivity matrix includes the reflectivity of each pixel in the spectral region;

[0073] S340, obtaining an area ratio of each spectral region in the first spectral image, and determining a spectral deviation of the first spectral image based on a variation coefficient and an area ratio of each spectral region;

[0074] S350, determining the characteristic band corresponding to each first spectral image, normalizing the regression correlation coefficient corresponding to the characteristic band to obtain the weight of the first spectral image, and determining the quality of the target bamboo shoots based on the weight and spectral deviation of the first spectral image.

[0075] Specifically, the reflectance of each pixel in the spectral region is averaged to obtain the average reflectance of each spectral region in the first spectral image; the first variation coefficient represents the reflectance change of each pixel in the spectral region, and the second variation coefficient represents the reflectance change of the adjacent spectral region as a whole. The variation coefficient of each spectral region can reflect the change speed of sugar fiberization in the target bamboo shoots to a certain extent, and provide a reference for the quality identification of the target bamboo shoots. The value obtained by combining the weight and spectral deviation of the first spectral image is used as the quality detection result of the target bamboo shoots.

[0076] In some embodiments, the reflectivity threshold of each characteristic band is predetermined by:

[0077] S321, for each of the second hyperspectral images, selecting second spectral images corresponding to K characteristic bands in the second hyperspectral image, averaging the reflectances of each pixel in the second spectral image, and obtaining an average reflectance of the second spectral image;

[0078] S322, grouping the second spectral images of the same characteristic band in each of the second hyperspectral images into one group to obtain K groups corresponding to the K characteristic bands; averaging the average reflectances of all the second spectral images in each group to obtain the average reflectance of the characteristic band corresponding to the group;

[0079] S323, multiplying the average reflectivity of the characteristic band by the adjustment coefficient to obtain a reflectivity threshold of the characteristic band; wherein the adjustment coefficient has a value range of (0, 1).

[0080] In some embodiments, determining a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectance matrix and the reflectance threshold, and determining a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient, comprises:

[0081] S331, obtaining a reflectance threshold of a characteristic band corresponding to a spectral region;

[0082] S332, using a sliding window to traverse the spectral region, intercepting the target matrix row by row and column by column in the reflectance matrix through the sliding window, and determining the difference between the reflectance mean of the target matrix and the reflectance threshold as the reflectance difference of the target matrix;

[0083] It should be noted that the size of the sliding window should be smaller than the first spectral region. The size of the sliding window can be set according to actual conditions. The smaller the sliding window, the higher the processing precision of the first spectral region; the larger the sliding window, the higher the calculation efficiency.

[0084] S333, determining a mean reflectivity of each row of the target matrix, and determining a first variation coefficient of the spectral region based on the mean reflectivity of each row of the target matrix;

[0085] S334, selecting a plurality of target matrices from the spectral region, averaging the reflectance differences of the plurality of target matrices to obtain a reflectance mean of the plurality of target matrices, and determining a second variation coefficient of the spectral region based on the reflectance mean of the plurality of target matrices and the reflectance mean of the spectral region;

[0086] S335 , multiplying the first variation coefficient and the second variation coefficient of the spectral region and calculating the square root thereof to obtain the variation coefficient of the spectral region.

[0087] It should be noted that the tips of bamboo shoots are usually tender, while the bottoms have more fibers and a tougher taste. The bamboo shoot nodes are the hardest and serve as the basis for dividing spectral regions. The bamboo shoot flesh wrapped in the bamboo shoot skin is the main edible part, and the first variation coefficient can be used to characterize the comparison between the bamboo shoot flesh and the bamboo shoot skin in each section of the bamboo shoot. For two adjacent sections of the bamboo shoot, it is necessary to comprehensively consider the changes in the two sections of the bamboo shoot. Therefore, the reflectivity difference between adjacent spectral regions is comprehensively compared, and the second variation coefficient can be used to characterize the fiberization speed of each section of the bamboo shoot. Combining the first variation coefficient and the second variation coefficient, the fiberization speed of the target bamboo shoot in the horizontal and longitudinal directions can be characterized.

[0088] In some embodiments, the first variation coefficient is calculated by the following formula:

[0089]

[0090] Wherein, p=2,…,P, p represents the number of spectral regions, P represents the total number of spectral regions, Cp1 represents the first variation coefficient of the pth spectral region, i=2,…,M, i represents the number of rows of the target matrix, M is the total number of a row of the target matrix intercepted by the sliding window, N is the total number of a column of the target matrix intercepted by the sliding window, S(i) represents the mean reflectivity of the i-th row of the target matrix, and S(i-1) represents the mean reflectivity of the i-1th row of the target matrix.

[0091] It should be noted that when p=1, the first variation coefficient of the first spectral region is 1; each row of the target matrix corresponds to the horizontal direction of the target bamboo shoots, and each column of the target matrix corresponds to the vertical direction of the target bamboo shoots. For the interior of the spectral region, the horizontal variation is more obvious. Therefore, the first variation coefficient of the spectral region is calculated using the mean reflectivity of each row of the target matrix, which reflects the change in the reflectivity difference of the spectral region.

[0092] In some embodiments, determining the second variation coefficient of the spectral region based on the reflectance mean of the multi-column target matrix and the reflectance mean of the spectral region comprises:

[0093] Selecting n columns of target matrices from two adjacent spectral regions respectively, and determining the trend coefficient of the spectral region based on the n columns of target matrices in the two adjacent spectral regions;

[0094] Obtaining the reflectance average of two adjacent spectral regions, and determining the second variation coefficient of the spectral region in combination with the trend coefficient of the spectral region;

[0095] The trend coefficient of the spectral region is calculated by the following formula:

[0096]

[0097] The second variation coefficient is calculated by the following formula:

[0098]

[0099] Wherein, p=2,…,P, Cp2 represents the second variation coefficient of the p-th spectral region, j=2,…,n, 2<n<N / 2, j represents the number of columns of the target matrix, λp represents the trend coefficient of the p-th spectral region, S(p) represents the mean reflectance of the p-th spectral region, S(p-1) represents the mean reflectance of the p-1-th spectral region, S(j) represents the mean reflectance of the j-th column of the target matrix, S(j-1) represents the mean reflectance of the j-1-th column of the target matrix, S(p,j) represents the mean reflectance of the j-th column of the target matrix in the p-th spectral region, S(p,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-th spectral region, S(p-1,j) represents the mean reflectance of the j-th column of the target matrix in the p-1-th spectral region, and S(p-1,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-1-th spectral region.

[0100] It should be noted that when p=1, the second variation coefficient of the first spectral region is 1; n columns of target matrices are selected from two adjacent spectral regions to obtain the trend coefficient of the spectral region; each row of the target matrix corresponds to the horizontal direction of the target bamboo shoots, and each column of the target matrix corresponds to the vertical direction of the target bamboo shoots. For the inside of the spectral region, the horizontal change is more obvious. Therefore, the first variation coefficient of the spectral region is calculated with the mean reflectivity of each row of the target matrix, which reflects the change in the reflectivity difference of the spectral region.

[0101] In some embodiments, the coefficient of variation is given by the formula The spectral deviation of the first spectral image is calculated by the following formula:

[0102]

[0103] Wherein, D represents the spectral deviation of the first spectral image, Cp represents the coefficient of variation of the p-th spectral region, Sp represents the pixel area of ​​the p-th spectral region, and S represents the pixel area of ​​the first spectral image.

[0104] In this embodiment, the pixel area represents the total number of pixels in the spectral region. The product of the coefficient of variation and the area ratio of each spectral region is calculated respectively, and the sum is obtained to obtain the spectral deviation of the first spectral image, which can comprehensively reflect the influence of each spectral region on the overall first spectral image.

[0105] In some embodiments, the quality of the target bamboo shoots is calculated by the following formula:

[0106]

[0107] Wherein, Dk represents the spectral deviation of the kth first spectral image, Wk represents the weight of the kth first spectral image, and Wk is obtained by normalizing the kth regression correlation coefficient.

[0108] refer to Figure 2 The embodiment of the present invention further provides a bamboo shoot quality detection system based on hyperspectral images, comprising:

[0109] at least one processor;

[0110] at least one memory for storing at least one program;

[0111] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0112] The contents of the above method embodiments are all applicable to this embodiment. The functions specifically implemented by this embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments, which will not be repeated here.

[0113] Although the description of the present disclosure has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims by reference to the appended claims, taking into account the prior art, so as to effectively cover the intended scope of the present disclosure. In addition, the above description of the present disclosure is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present disclosure that have not yet been foreseen may still represent equivalent changes to the present disclosure.

Claims

1. A bamboo shoot quality detection method based on hyperspectral images, characterized in that: The method comprises the following steps: Acquire a first hyperspectral image collected from the target bamboo shoots; Acquire K characteristic bands of the target bamboo shoots, extract K first spectral images corresponding to the K characteristic bands from the first hyperspectral image, and determine the reflectance matrices of the K first spectral images respectively; The spectral deviation of the corresponding first spectral image is determined based on the reflectance matrix, and the quality of the target bamboo shoots is determined based on the spectral deviation of each first spectral image.

2. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 1, characterized in that: The K characteristic bands of the target bamboo shoots are predetermined in the following manner: Acquire a sample image set, wherein the sample image set includes a plurality of second hyperspectral images; wherein the second hyperspectral images are hyperspectral images collected from standard bamboo shoot samples; The transmission spectrum of each of the second hyperspectral images and the fiber content of the corresponding bamboo shoot standard sample are obtained, a linear regression model of the transmission spectrum and fiber content of each of the second hyperspectral images is established, the regression correlation coefficient of each of the linear regression models is calculated, and the sampling bands corresponding to K larger regression correlation coefficients are selected as feature bands to obtain K feature bands.

3. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 2, characterized in that: The determining of the spectral deviation of the corresponding first spectral image based on the reflectance matrix, and determining the quality of the target bamboo shoots based on the spectral deviation of each first spectral image, comprises: For each first spectral image, determining an intensity value of each pixel in the first spectral image, and dividing the first spectral image into a plurality of sequentially adjacent spectral regions based on the intensity value; Obtaining a reflectance threshold of each characteristic band, determining a characteristic band corresponding to the first spectral image, and using the reflectance threshold of the characteristic band as the reflectance threshold of the first spectral image; Determine a reflectivity matrix of each spectral region in the first spectral image, determine a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectivity matrix and a reflectivity threshold, and determine a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient; wherein the reflectivity matrix includes the reflectivity of each pixel in the spectral region; Obtaining an area ratio of each spectral region in the first spectral image, and determining a spectral deviation of the first spectral image based on a coefficient of variation and an area ratio of each spectral region; Determine the characteristic band corresponding to each first spectral image, normalize the regression correlation coefficient corresponding to the characteristic band to obtain the weight of the first spectral image, and determine the quality of the target bamboo shoots based on the weight and spectral deviation of the first spectral image.

4. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 3, characterized in that: The reflectance threshold for each feature band is predetermined in the following way: For each of the second hyperspectral images, selecting the second spectral images corresponding to the K characteristic bands in the second hyperspectral image, averaging the reflectances of the pixels in the second spectral image, and obtaining the average reflectance of the second spectral image; The second spectral images with the same characteristic band in each of the second hyperspectral images are grouped together to obtain K sets corresponding to the K characteristic bands; the average reflectances of all the second spectral images in each set are averaged to obtain the average reflectance of the characteristic band corresponding to the set; The average reflectivity of the characteristic band is multiplied by the adjustment coefficient to obtain the reflectivity threshold of the characteristic band; wherein the value range of the adjustment coefficient is (0, 1).

5. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 3, characterized in that: The step of determining a first variation coefficient of each spectral region and a second variation coefficient of an adjacent spectral region based on the reflectance matrix and the reflectance threshold, and determining a variation coefficient of each spectral region based on the first variation coefficient and the second variation coefficient, comprises: Obtain the reflectance threshold of the characteristic band corresponding to the spectral region; A sliding window is used to traverse the spectral region, and a target matrix is ​​intercepted row by row and column by column in the reflectance matrix by the sliding window, and a difference between a reflectance mean value of the target matrix and the reflectance threshold value is determined as a reflectance difference value of the target matrix; Determine a mean reflectance value of each row of the target matrix, and determine a first coefficient of variation of the spectral region based on the mean reflectance value of each row of the target matrix; Selecting multiple columns of target matrices from the spectral region, averaging the reflectance differences of the multiple columns of target matrices to obtain a reflectance mean of the multiple columns of target matrices, and determining a second variation coefficient of the spectral region based on the reflectance mean of the multiple columns of target matrices and the reflectance mean of the spectral region, The first variation coefficient and the second variation coefficient of the spectral region are multiplied and the square root is calculated to obtain the variation coefficient of the spectral region.

6. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 5, characterized in that: The first variation coefficient is calculated by the following formula: Wherein, p=2,…,P, p represents the number of spectral regions, P represents the total number of spectral regions, Cp1 represents the first variation coefficient of the pth spectral region, i=2,…,M, i represents the number of rows of the target matrix, M is the total number of a row of the target matrix intercepted by the sliding window, N is the total number of a column of the target matrix intercepted by the sliding window, S(i) represents the mean reflectivity of the i-th row of the target matrix, and S(i-1) represents the mean reflectivity of the i-1th row of the target matrix.

7. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 6, characterized in that: The determining of the second variation coefficient of the spectral region based on the reflectivity mean of the multi-column target matrix and the reflectivity mean of the spectral region comprises: Selecting n columns of target matrices from two adjacent spectral regions respectively, and determining the trend coefficient of the spectral region based on the n columns of target matrices in the two adjacent spectral regions; Obtaining the reflectance average of two adjacent spectral regions, and determining the second variation coefficient of the spectral region in combination with the trend coefficient of the spectral region; The trend coefficient of the spectral region is calculated by the following formula: The second variation coefficient is calculated by the following formula: Wherein, p=2,…,P, Cp2 represents the second variation coefficient of the p-th spectral region, j=2,…,n, 2<n<N / 2, j represents the number of columns of the target matrix, λp represents the trend coefficient of the p-th spectral region, S(p) represents the mean reflectance of the p-th spectral region, S(p-1) represents the mean reflectance of the p-1-th spectral region, S(j) represents the mean reflectance of the j-th column of the target matrix, S(j-1) represents the mean reflectance of the j-1-th column of the target matrix, S(p,j) represents the mean reflectance of the j-th column of the target matrix in the p-th spectral region, S(p,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-th spectral region, S(p-1,j) represents the mean reflectance of the j-th column of the target matrix in the p-1-th spectral region, and S(p-1,j-1) represents the mean reflectance of the j-1-th column of the target matrix in the p-1-th spectral region.

8. The method for detecting bamboo shoot quality based on hyperspectral images according to claim 7, characterized in that: The spectral deviation of the first spectral image is calculated by the following formula: Wherein, D represents the spectral deviation of the first spectral image, Sp represents the pixel area of ​​the pth spectral region, and S represents the pixel area of ​​the first spectral image.

9. A bamboo shoot quality detection system based on hyperspectral images, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 8.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 8 when executed by the processor.

Citation Information

Patent Citations

  • Lighting method, lighting system, and storage medium

    CN108811236A

  • Dendrocalamus latiflorus nutritional ingredient detection method and system based on hyperspectral image and storage medium

    CN113392916A

  • Analogue technology for imaging spectrograph remote-sensing image in satellite

    CN1776453A

Cited By

  • Quality detection method of mitochondrial nutrient goat milk powder based on image processing

    CN119861044A

  • A quality detection method for mitochondrial nutrient goat milk powder based on image processing

    CN119861044B

  • Three-white melon quality detection method and system based on hyperspectral image and medium

    CN120404618A

  • Three-white melon quality detection method, system and medium based on hyperspectral imaging

    CN120404618B