Target freshness detection method and system

By obtaining the optimal band ratio features and texture features of hyperspectral images of crop seeds and combining them with a support vector machine model, rapid non-destructive testing of crop seeds is achieved, solving the problems of high difficulty and high cost in equipment development and realizing efficient freshness detection.

CN114693608BActive Publication Date: 2025-09-09INTELLIGENT EQUIPMENT RESEARCH CENTER BEIJING ACADEMY OF AGRICULTURE AND FORESTRY SCIENCES
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210239461.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2025-09-09
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

In the existing technology, the development of rapid non-destructive testing equipment for crop seeds is difficult and costly.

Method used

By obtaining the optimal band ratio features and texture features of the hyperspectral image of the target to be detected, the support vector machine model is used to perform rapid and non-destructive detection of the freshness of crop seeds.

Benefits of technology

It greatly reduces the difficulty and cost of developing rapid non-destructive testing equipment, and realizes the rapid and accurate detection of the freshness of crop seeds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114693608B_ABST
    Figure CN114693608B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for detecting the freshness of an object. The method comprises: obtaining an optimal band ratio feature and a texture feature of a hyperspectral image of the object to be detected; and determining the freshness of the object to be detected based on the optimal band ratio feature and the texture feature. The system executes the method. The present invention utilizes the optimal band ratio of the hyperspectral image of the object to be detected to obtain the texture feature of the optimal band ratio image. Based on the optimal band ratio feature and the texture feature, the method enables rapid nondestructive testing of the freshness of the object to be detected, such as crop seeds, significantly reducing the difficulty and cost of developing rapid nondestructive testing equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target detection technology, and in particular to a target freshness detection method and system. Background Art

[0002] Crops are considered a primary source of food, feed, fuel, and industrial materials. High-quality crop seeds can increase yields and ensure consistent plant growth, facilitating modern mechanized operations such as drone-based pesticide spraying and detasseling. However, due to differences in storage time and methods, the age of crop seeds significantly affects germination rates and subsequent growth. New crop seeds not only have a high germination rate but also develop stronger embryos. In contrast, aged crop seeds have a low germination rate and experience accelerated nutrient loss with storage time, resulting in a weaker embryo.

[0003] In the prior art, the development of rapid non-destructive testing equipment for crop seeds is difficult and costly. Summary of the Invention

[0004] The target freshness detection method and system provided by the present invention are used to solve the above-mentioned problems existing in the prior art. By utilizing the optimal band ratio of the hyperspectral image of the target to be detected to obtain the texture features of the optimal band ratio image, and based on the optimal band ratio features and texture features, rapid non-destructive detection of the freshness of the target to be detected, such as crop seeds, is achieved, greatly reducing the difficulty and cost of developing rapid non-destructive testing equipment.

[0005] The present invention provides a method for detecting target freshness, comprising:

[0006] Obtaining the optimal band ratio feature of the hyperspectral image of the target to be detected and the texture feature of the optimal band ratio image;

[0007] The freshness of the target to be detected is determined according to the optimal band ratio feature and the texture feature.

[0008] According to a method for detecting target freshness provided by the present invention, obtaining the optimal band ratio feature of the hyperspectral image of the target to be detected and the texture feature of the optimal band ratio image includes:

[0009] Determining the optimal band ratio feature based on spectral data extracted from the hyperspectral image of the target to be detected;

[0010] Determining an optimal band ratio according to the optimal band ratio feature, and determining the optimal band ratio image according to the optimal band ratio;

[0011] The texture feature is determined according to the optimal band ratio image.

[0012] According to a method for detecting target freshness provided by the present invention, the hyperspectral image of the target to be detected is obtained by:

[0013] A hyperspectral imaging system based on a preset spectral range acquires the hyperspectral image.

[0014] According to a method for detecting target freshness provided by the present invention, determining the optimal band ratio feature based on spectral data extracted from a hyperspectral image of the target to be detected includes:

[0015] Acquire a black reference image and a white reference image of the target to be detected;

[0016] Correcting the hyperspectral image based on the black reference image and the white reference image to obtain a corrected hyperspectral image;

[0017] Spectrum extraction and variance analysis are performed on the corrected hyperspectral image to determine the optimal band ratio feature.

[0018] According to a method for detecting target freshness provided by the present invention, determining the texture feature based on the optimal band ratio image includes:

[0019] Performing texture feature extraction on the optimal band ratio image to obtain histogram statistical features and gray level co-occurrence matrix texture features of the optimal band ratio image;

[0020] The texture feature is determined according to the histogram statistical feature and the gray level co-occurrence matrix texture feature.

[0021] According to a method for detecting the freshness of an object provided by the present invention, determining the freshness of the object to be detected based on the optimal band ratio feature and the texture feature includes:

[0022] Determining a training sample and a test sample according to the band ratio feature and the texture feature;

[0023] Inputting the training samples into a support vector machine model for training to obtain the classification model;

[0024] The test sample is input into the classification model to determine the freshness.

[0025] The present invention also provides a target freshness detection system, comprising: an acquisition module and a detection module;

[0026] The acquisition module is used to obtain the optimal band ratio characteristics of the hyperspectral image of the target to be detected and the texture characteristics of the optimal band ratio image;

[0027] The detection module is used to determine the freshness of the target to be detected based on the optimal band ratio feature and the texture feature.

[0028] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-described target freshness detection methods is implemented.

[0029] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described target freshness detection methods.

[0030] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for detecting the freshness of an object.

[0031] The target freshness detection method and system provided by the present invention obtain the texture features of the optimal band ratio image by utilizing the optimal band ratio of the target to be detected, and based on the optimal band ratio features and texture features, realize rapid non-destructive detection of the freshness of the target to be detected, such as crop seeds, greatly reducing the difficulty and cost of developing rapid non-destructive detection equipment. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0033] Figure 1 1 is a flow chart of a target freshness detection method provided by the present invention;

[0034] Figure 2 This is one of the schematic diagrams of the result of the classification model provided by the present invention on the freshness of the target;

[0035] Figure 3 This is the second schematic diagram of the result of the classification model provided by the present invention detecting the freshness of the target;

[0036] Figure 4 Schematic diagram of the target freshness detection system provided by the present invention;

[0037] Figure 5 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0038] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0039] Because hyperspectral imaging technology involves a large amount of data and the equipment is relatively expensive, it is very unfavorable to the development of rapid non-destructive testing equipment. Therefore, this paper proposes a multi-feature fusion method based on hyperspectral imaging technology to quickly detect the freshness of corn seeds. The multi-feature data fusion is performed by using the texture features and spectral features of the feature image, simplifying hyperspectral imaging technology into multispectral imaging technology, realizing rapid non-destructive testing of corn seed freshness, and greatly reducing the difficulty and cost of equipment development. The specific implementation is as follows:

[0040] Figure 1 FIG. 1 is a flow chart of the target freshness detection method provided by the present invention, as shown in FIG. Figure 1 As shown, the method includes:

[0041] Step 100: Obtaining the optimal band ratio feature and band ratio image texture feature of the hyperspectral image of the target to be detected;

[0042] Step 200: Determine the freshness of the target to be detected based on the optimal band ratio feature and the texture feature.

[0043] It should be noted that the execution subject of the above method may be a computer device.

[0044] Alternatively, hyperspectral imaging technology has been widely used in the quality detection of targets (e.g., crop seeds, such as corn seeds and wheat seeds) due to its rapid and non-destructive advantages. However, in practical applications, target detection based on hyperspectral imaging technology still requires the full spectrum or multiple characteristic bands to participate in modeling, which is very unfavorable for the development of rapid non-destructive testing equipment. Based on this, the present invention proposes a target freshness detection method to overcome the above problems. Specifically:

[0045] Take corn seeds as an example to collect samples. Specifically:

[0046] For example, corn seed samples of Jingke 968 were harvested in 2018, 2019, and 2020. All corn seed samples were uniform in size and free of obvious defects. The sample size for each year was 120 seeds. To ensure experimental consistency and reduce interference from external factors, the corn seeds were placed at room temperature for 24 hours before collecting hyperspectral images. The corn seed variety, harvest year, and sample size can be adjusted based on actual conditions and are not specifically limited in this disclosure.

[0047] Based on the collected hyperspectral images of corn seeds, the optimal band ratio features of the corn seeds are obtained, and based on the optimal band ratio of the corn seeds, the texture features of the optimal band ratio image are obtained. For example, the texture features of the corn seeds can be obtained from the optimal band ratio image of the corn seeds by adopting the texture feature extraction method.

[0048] Based on the obtained optimal band ratio characteristics and texture characteristics of the corn seeds, the freshness detection of the corn seeds is completed. For example, the harvest year of the corn seeds can be determined based on the optimal band ratio characteristics and texture characteristics of the corn seeds, and the freshness detection of the corn seeds can be completed according to the harvest year. In one embodiment, corn seeds with a harvest year before 2019 can be determined as old seeds, and corn seeds with a harvest year of 2020 can be determined as new seeds.

[0049] The target freshness detection method provided by the present invention obtains the texture features of the optimal band ratio image by utilizing the optimal band ratio of the target to be detected, and based on the optimal band ratio features and texture features, realizes rapid non-destructive detection of the freshness of the target to be detected, such as crop seeds, greatly reducing the difficulty and cost of developing rapid non-destructive detection equipment.

[0050] Furthermore, in one embodiment, step 100 may specifically include:

[0051] Step 101: determining an optimal band ratio feature based on spectral data extracted from a hyperspectral image of a target to be detected;

[0052] Step 102: determining an optimal band ratio according to the optimal band ratio feature, and determining an optimal band ratio image according to the optimal band ratio feature;

[0053] Step 103: Determine texture features based on the optimal band ratio image.

[0054] Furthermore, in one embodiment, the hyperspectral image of the target to be detected in step 101 is obtained by:

[0055] Step 1011: Acquire a hyperspectral image based on a hyperspectral imaging system in a preset spectral range.

[0056] Optionally, in step 101, a hyperspectral imaging system within a preset spectral range (eg, 930-2548 nm) may be used to extract an image of the corn seed, such as a germ side image, to obtain a hyperspectral image of the corn seed.

[0057] It should be noted that the hyperspectral imaging system can specifically include: an imaging spectrometer, a halogen lamp, a CCD camera, and a horizontal motion platform. The hyperspectral image acquisition parameters include: CCD camera exposure time, horizontal motion platform movement speed, and object distance are 3ms, 25mm / s, and 365mm, respectively.

[0058] Based on the collected hyperspectral images of corn seeds, spectral data of the corn seeds are obtained, and based on the spectral data of the target, optimal band ratio features are obtained. Based on the obtained optimal band ratio features, an optimal band ratio image can be obtained, and then the texture features of the optimal band ratio image are obtained. Specifically, by extracting spectral features and texture features of the collected hyperspectral images of corn seeds within a preset spectral range, multidimensional features for evaluating the freshness of corn seeds are obtained.

[0059] The target freshness detection method provided by the present invention simplifies hyperspectral imaging technology into multispectral imaging technology by utilizing the optimal band ratio characteristics and texture characteristics of the target to be detected. When developing rapid non-destructive detection equipment for the freshness of the target to be detected (such as corn seeds), the method avoids the use of expensive hyperspectral cameras that are not conducive to the development of rapid non-destructive detection equipment. Instead, it uses band cameras corresponding to the optimal band ratio, thereby improving the development efficiency of rapid non-destructive detection equipment and reducing costs.

[0060] Furthermore, in one embodiment, step 101 may further specifically include:

[0061] Step 1012: Acquire a black reference image and a white reference image of the target to be detected;

[0062] Step 1013: Correct the hyperspectral image based on the black reference image and the white reference image to obtain a corrected hyperspectral image;

[0063] Step 1014: perform spectrum extraction and variance analysis on the corrected hyperspectral image to determine the optimal band ratio feature.

[0064] Optionally, the inconsistency of the light source intensity in different bands and the dark current in the CCD camera will cause large noise in certain bands. Therefore, the original hyperspectral image of the corn seeds (obtained by the hyperspectral imaging system within the above-mentioned preset spectral range) needs to be corrected using a black and white reference image. In addition, because the signal-to-noise ratio at the beginning and end of the full spectral range is low, the spectrum within 1000-2000nm is intercepted for analysis. A white reference image is obtained using a polytetrafluoroethylene white plate, and a black reference image is obtained by turning off the light source and tightening the lens cover. The corrected hyperspectral image is obtained by the following formula:

[0065]

[0066] Among them, R c is the corrected hyperspectral image, R raw is the original hyperspectral image, R dark is the black reference image, R white is a white reference image.

[0067] In step 10123, an optimal band ratio characteristic of the corn seed hyperspectral image is obtained based on an ANOVA analysis of variance of the band ratio. Specifically, an ANOVA analysis is performed on the spectral data corresponding to the hyperspectral images of corn seeds harvested in different years. The band ratio representing the maximum difference between groups is selected using the F value. The band ratio with the highest F value indicates that the differences between different groups are most significant at this band ratio. A contour plot of the F values ​​obtained from the ANOVA analysis shows that the maximum F value is obtained when the band ratio is 1987nm / 1079nm, indicating that the differences between groups are most significant at this band ratio. Therefore, the present invention uses 1987nm / 1079nm as the optimal band ratio and obtains an optimal band ratio image.

[0068] And by extracting texture features from the optimal band ratio image, the texture features of corn seeds are obtained.

[0069] The target freshness detection method provided by the present invention obtains the optimal band ratio characteristics and texture characteristics of the target to be detected (such as corn seeds) by using variance analysis and texture feature extraction, laying the foundation for the subsequent rapid non-destructive detection of the freshness of the target to be detected, such as crop seeds, based on the optimal band ratio characteristics and texture characteristics, and reducing the difficulty and cost of developing rapid non-destructive detection equipment.

[0070] Furthermore, in one embodiment, step 103 may specifically include:

[0071] Step 1031: extracting texture features from the optimal band ratio image to obtain histogram statistical features and gray-level co-occurrence matrix texture features of the optimal band ratio image;

[0072] Step 1032: Determine texture features based on the histogram statistical features and the gray level co-occurrence matrix texture features.

[0073] Optionally, image texture features play a vital role in the classification system, so the hidden image texture features are extracted from the optimal band ratio image, and the histogram statistics (HS) and gray level co-occurrence matrix (GLCM) texture features are extracted respectively. Specifically: the average intensity of the histogram (H intensity ), average consistency (H consistency ), skewness (H skewness ), kurtosis (H kurtosis ), average contrast (H contrast ) and entropy (H entropy ) is one of the texture features of corn seeds (i.e., histogram statistical features), and the calculation formula is as follows:

[0074]

[0075]

[0076]

[0077]

[0078]

[0079]

[0080] Among them, z i is a random variable of gray level i, L is the maximum gray level in the image, p(z i ) represents the z in the image i probability.

[0081] At the same time, the contrast of the gray level co-occurrence matrix (G contrast ), correlation (G correlation ), Energy (G energy ) and uniformity (G homogeneity ) is used as one of the texture features of corn seeds (i.e., gray-level co-occurrence matrix texture features), and the calculation formula is as follows:

[0082]

[0083]

[0084]

[0085]

[0086]

[0087]

[0088]

[0089]

[0090] Where X is the number of columns of the gray-level co-occurrence matrix, Y is the number of rows of the gray-level co-occurrence matrix, and p(i, j) is the gray-level co-occurrence matrix.

[0091] The target freshness detection method provided by the present invention obtains the optimal band ratio characteristics and texture characteristics of the target to be detected (such as corn seeds) by using variance analysis and texture feature extraction, laying the foundation for the subsequent identification of the freshness of the target to be detected, such as crop seeds, based on the optimal band ratio characteristics and texture characteristics, greatly reducing the difficulty and cost of developing rapid non-destructive testing equipment.

[0092] Furthermore, in one embodiment, step 200 may specifically include:

[0093] Step 201: Determine training samples and test samples based on the optimal band ratio feature and texture feature;

[0094] Step 202: input the training sample into the support vector machine model for training to obtain the classification model;

[0095] Step 203: Input the test sample into the classification model to determine the freshness.

[0096] Optionally, 240 kernels are randomly selected from all corn seed samples, and the corresponding optimal band ratio features and the texture features of the optimal band ratio images are used as model inputs to establish a classification model. Due to the characteristics of the combination of hyperspectral image atlases, the amount of hyperspectral data is large, and there is a large amount of redundant and collinear information between spectral variables, which has a great impact on the extraction of effective spectral information, resulting in a complex model and a large amount of calculation. Therefore, the present invention establishes a support vector machine (SVM) model based on the optimal band ratio features combined with the texture features to achieve the identification of the freshness of corn seeds. At the same time, in order to standardize the texture features of corn seeds, the texture features of each type of corn seeds are subjected to standard normalization processing. After testing, the obtained classification model predicts the calibration samples, and the classification accuracy rate reaches 98.75%.

[0097] Verification of the classification model: In order to verify the prediction accuracy and stability of the above classification model based on multi-feature fusion (fusion of optimal band ratio features and texture features), the optimal band ratio features and texture features of the remaining 120 corn seeds were used as test samples to verify the above classification model. The verification set samples were calculated at 1987nm and 1079nm. The obtained optimal band ratio features and texture features were used as inputs of the above classification model. Finally, the classification accuracy of the test samples was 97.5%. The confusion matrix of the test sample classification results is shown as follows: Figure 2 The results show that the harvest year of the target to be detected (such as corn seeds) can be detected based on the obtained classification model.

[0098] In addition, in order to explain the effectiveness of the classification model, Table 1 shows the results of the classification model based on full band, band ratio, texture feature and multi-feature fusion.

[0099] Table 1

[0100]

[0101] It can be clearly seen from Table 1 that the modeling results based on the multi-feature fusion method greatly simplify the complexity of the classification model and compress the number of bands while ensuring prediction accuracy compared with the full-band model. In addition, the modeling results based on multi-feature fusion are better than the modeling results before feature fusion. The selected optimal band ratio provides a reference for the subsequent development of online and portable devices.

[0102] However, general production only needs to identify new seeds and old seeds. Therefore, in one embodiment, corn seeds harvested in 2020 are defined as new seeds, and seeds harvested in other years are defined as old seeds. A classification model is established, and the classification accuracy of the classification model for the target to be detected reaches 99.1%, which has a good prediction effect. The confusion matrix is ​​as follows: Figure 3 As shown, it can be clearly seen that the target freshness detection method proposed in the present invention has excellent freshness identification performance for new and old corn seeds, and the freshness identification of only one seed is wrong.

[0103] The target freshness detection method provided by the present invention overcomes the shortcomings of expensive hyperspectral equipment, large amount of hyperspectral data and large amount of model calculation by establishing a corn seed freshness classification model based on band ratios combined with image texture features. It can classify and identify the freshness of corn seeds with high classification accuracy by simply using two-band images, laying a theoretical foundation for applying hyperspectral imaging technology to identify the freshness of different corn seeds in actual production, and providing a methodological reference for the construction, application and subsequent development of rapid non-destructive detection systems for other qualities of corn seeds.

[0104] The target freshness detection system provided by the present invention is described below. The target freshness detection system described below and the target freshness detection method described above can be referenced to each other.

[0105] Figure 4 FIG. 1 is a schematic diagram of the structure of the target freshness detection system provided by the present invention. Figure 4 Shown, including:

[0106] Acquisition module 410 and detection module 411;

[0107] An acquisition module 410 is used to acquire the optimal band ratio feature and the texture feature of the optimal band image of the target to be detected;

[0108] The detection module 411 is used to determine the freshness of the target to be detected based on the optimal band ratio feature and the texture feature.

[0109] The target freshness detection system provided by the present invention obtains the texture features of the optimal band ratio image by utilizing the optimal band ratio of the target to be detected, and based on the optimal band ratio features and texture features, realizes rapid non-destructive detection of the freshness of the target to be detected, such as crop seeds, greatly reducing the difficulty and cost of developing rapid non-destructive detection equipment.

[0110] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided by the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 511, a memory 512, and a bus 513, wherein the processor 510, the communication interface 511, and the memory 512 communicate with each other via the bus 513. The processor 510 may call the logic instructions in the memory 512 to execute the following method:

[0111] Obtaining the optimal band ratio feature of the target to be detected and the texture feature of the optimal band ratio image;

[0112] The freshness of the target to be detected is determined based on the optimal band ratio characteristics and texture characteristics.

[0113] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer power screen (which can be a personal computer, server, or network power screen, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0114] Furthermore, the present invention discloses a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions. When the program instructions are executed by a computer, the computer can perform the target freshness detection method provided by each of the above method embodiments, for example, including:

[0115] Obtaining the optimal band ratio feature of the target to be detected and the texture feature of the optimal band ratio image;

[0116] The freshness of the target to be detected is determined based on the optimal band ratio characteristics and texture characteristics.

[0117] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program is implemented to perform the target freshness detection method provided in the above embodiments, for example, including:

[0118] Obtaining the optimal band ratio feature of the target to be detected and the texture feature of the optimal band ratio image;

[0119] The freshness of the target to be detected is determined based on the optimal band ratio characteristics and texture characteristics.

[0120] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0121] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer power screen (which can be a personal computer, a server, or a network power screen, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for detecting target freshness, characterized in that: include: Obtaining the optimal band ratio feature of the hyperspectral image of the target to be detected and the texture feature of the optimal band ratio image; Determining the freshness of the target to be detected according to the optimal band ratio feature and the texture feature; The step of obtaining the optimal band ratio feature of the hyperspectral image of the target to be detected and the texture feature of the optimal band ratio image comprises: Determining the optimal band ratio feature based on spectral data extracted from the hyperspectral image of the target to be detected; Determining an optimal band ratio according to the optimal band ratio feature, and determining the optimal band ratio image according to the optimal band ratio; determining the texture feature according to the optimal band ratio image; The determining of the texture feature according to the optimal band ratio image includes: Performing texture feature extraction on the optimal band ratio image to obtain histogram statistical features and gray level co-occurrence matrix texture features of the optimal band ratio image; Among them, the average intensity of the histogram is extracted , average consistency , skewness , kurtosis , average contrast and entropy As a histogram statistical feature, the calculation formula is as follows: ; ; ; ; ; ; in, Is the grayscale A random variable, is the maximum gray level in the image, Indicates the image probability; Extracting the contrast of the gray-level co-occurrence matrix , correlation ,energy and uniformity As the gray level co-occurrence matrix texture feature, the calculation formula is as follows: ; ; ; ; ; ; ; ; in, is the number of columns of the gray-level co-occurrence matrix, is the number of rows of the gray-level co-occurrence matrix, is the gray-level co-occurrence matrix; Determining the texture feature according to the histogram statistical feature and the gray level co-occurrence matrix texture feature; Determining the optimal band ratio feature based on spectral data extracted from the hyperspectral image of the target to be detected includes: Acquire a black reference image and a white reference image of the target to be detected; Correcting the hyperspectral image based on the black reference image and the white reference image to obtain a corrected hyperspectral image; Spectrum extraction and variance analysis are performed on the corrected hyperspectral image to determine the optimal band ratio feature.

2. The target freshness detection method according to claim 1, characterized in that: The hyperspectral image of the target to be detected is obtained by: A hyperspectral imaging system based on a preset spectral range acquires the hyperspectral image.

3. The target freshness detection method according to claim 1, characterized in that: The determining the freshness of the target to be detected according to the optimal band ratio feature and the texture feature includes: Determining a training sample and a test sample according to the optimal band ratio feature and the texture feature; Inputting the training samples into a support vector machine model for training to obtain a classification model; The test sample is input into the classification model to determine the freshness.

4. A target freshness detection system, characterized in that: include: Acquisition module and detection module; The acquisition module is used to obtain the optimal band ratio characteristics of the hyperspectral image of the target to be detected and the texture characteristics of the optimal band ratio image; The step of obtaining the optimal band ratio feature of the hyperspectral image of the target to be detected and the texture feature of the optimal band ratio image comprises: Determining the optimal band ratio feature based on spectral data extracted from the hyperspectral image of the target to be detected; Determining an optimal band ratio according to the optimal band ratio feature, and determining the optimal band ratio image according to the optimal band ratio; determining the texture feature according to the optimal band ratio image; The determining of the texture feature according to the optimal band ratio image includes: Performing texture feature extraction on the optimal band ratio image to obtain histogram statistical features and gray level co-occurrence matrix texture features of the optimal band ratio image; Among them, the average intensity of the histogram is extracted , average consistency , skewness , kurtosis , average contrast and entropy As a histogram statistical feature, the calculation formula is as follows: ; ; ; ; ; ; in, Is the grayscale A random variable, is the maximum gray level in the image, Indicates the image probability; Extracting the contrast of the gray-level co-occurrence matrix , correlation ,energy and uniformity As the gray level co-occurrence matrix texture feature, the calculation formula is as follows: ; ; ; ; ; ; ; ; in, is the number of columns of the gray-level co-occurrence matrix, is the number of rows of the gray-level co-occurrence matrix, is the gray-level co-occurrence matrix; Determining the texture feature according to the histogram statistical feature and the gray level co-occurrence matrix texture feature; Determining the optimal band ratio feature based on spectral data extracted from the hyperspectral image of the target to be detected includes: Acquire a black reference image and a white reference image of the target to be detected; Correcting the hyperspectral image based on the black reference image and the white reference image to obtain a corrected hyperspectral image; Performing spectrum extraction and variance analysis on the corrected hyperspectral image to determine the optimal band ratio feature; The detection module is used to determine the freshness of the target to be detected based on the optimal band ratio feature and the texture feature.

5. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the target freshness detection method according to any one of claims 1 to 3 is implemented.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target freshness detection method according to any one of claims 1 to 3 is implemented.

7. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the target freshness detection method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Method for detecting freshness grade of instant sea cucumber by using hyperspectral imaging technology

    CN106404692A