Spectrometer data correction method and system
Through the processing of infrared images and grayscale images of leaves, combined with radiation ability ratio correction and random forest models, the problem of the effects of temperature and light in infrared spectrum analysis of crop leaves is solved, and accurate disease diagnosis is achieved.
Patent Information
- Application Number
- CN202410724612.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In greenhouse planting, infrared spectrum analysis of crop leaves is affected by temperature and light conditions, resulting in detection errors and making it difficult to achieve accurate disease diagnosis.
By acquiring infrared images and grayscale images of leaves, the diseased areas are identified, the radiation ability ratio is calculated as a convolution kernel, infrared image correction is performed, and a random forest model is used for disease identification.
It effectively removes detection errors caused by different temperatures, improves the recognition accuracy of infrared spectrum images, and achieves accurate diagnosis of early crop diseases.
Smart Images

Figure CN118730952A_ABST
Abstract
Description
[0001] Technology Neighborhood
[0002] The present application relates to the field of spectral image processing technology, and in particular to a spectrometer data correction method and system. Background Art
[0004] The process of crops being attacked by diseases can be divided into the invasion period, the latent period, and the onset period. The invasion period refers to the period when pathogens destroy and infect plant cells, the latent period refers to the period when pathogens establish a parasitic relationship after infecting plant cells, and the onset period refers to the period when pathogens successfully parasitize, begin to reproduce and spread, and symptoms appear.
[0005] During the invasion and latent stages, crops do not show obvious symptoms and are difficult to diagnose from the appearance of the crops; during the onset stage, symptoms appear on the crops and can be diagnosed by naked eye observation, but the pathogens have already begun to spread during this period. Therefore, if the infection can be detected and diagnosed during the latent stage of crops, that is, early diagnosis of crops can be achieved, pesticides can be used quantitatively.
[0006] In order to achieve early diagnosis of crops, spectral analysis can be performed on crop leaves. Normal leaves and diseased leaves have different reflectivity to infrared light of different wavelengths, so the difference between the two can be shown in the spectrum. That is, diseased leaves infected by different types of diseases have different amplitudes of each band on their infrared spectrum. By comparing the standard spectrum of each type in the database, the cause of the diseased leaves can be diagnosed.
[0007] In common greenhouse cultivation, the greenhouse does not have a laboratory-standard spectral analysis environment, and usually a portable infrared spectrometer is used for inspection and analysis. The same crop leaf will present different infrared images at different temperatures and different light conditions, resulting in the infrared spectrum of the detected leaf not matching the standard spectrum or matching incorrectly.
[0008] Therefore, in order to accurately compare the infrared spectra of the leaves to be tested, the present application provides a spectrometer data correction method and system. Summary of the invention
[0009] In order to overcome the problems existing in the related art, the first aspect of the present application provides a spectrometer data correction method, comprising:
[0010] S1, obtaining a leaf infrared image and a leaf grayscale image; the leaf infrared image is a multi-band infrared image of the leaf to be detected under near-infrared light; the leaf grayscale image is a grayscale image of the leaf to be detected, and the leaf grayscale image is a single-channel image;
[0011] S2, identifying the diseased area on the leaf grayscale image to determine the image coordinates of the diseased area;
[0012] S3. Cut the infrared image of the leaf according to the image coordinates of the diseased area to obtain N sub-images of the diseased area; wherein N is an integer greater than or equal to 1.
[0013] S4, obtaining the detection environment temperature and determining the convolution kernel;
[0014] S5, extracting features of the diseased area sub-image according to the convolution kernel to obtain a feature vector of the diseased area;
[0015] S6. Input the disease area feature vector into a disease recognition model, and output the crop disease type.
[0016] In one implementation, determining the convolution kernel specifically includes:
[0017] The ratio between the first radiation capability and the second radiation capability of the blade to be detected is used as the sum of the element values of the convolution kernel.
[0018] In one embodiment, the first radiation capacity is the radiation capacity of the blade to be detected at the detection environment temperature, and the first radiation capacity is the radiation capacity of the blade to be detected at the standard temperature;
[0019] The calculation formula of the radiation capacity ratio is:
[0020]
[0021] Among them, E1 is the first radiation capability, E2 is the second radiation capability, and k is the radiation capability ratio.
[0022] In one embodiment, the calculation formulas for the first radiation capability and the second radiation capability are:
[0023]
[0024] Where E is the radiation capacity; ε is the blackness of the blade to be tested, T is the absolute temperature of the blade to be tested, and C0 is a known constant of 5.67W / m 2 K 4 .
[0025] In one implementation, the extracting features of the diseased area sub-image according to the convolution kernel specifically includes:
[0026] The convolution calculation formula is:
[0027] I a =K·I b
[0028] Among them, I a is the matrix representation of the corrected multispectral image, I b is the matrix representation of the standard multispectral image, and K is the convolution matrix.
[0029] In one embodiment, the disease recognition model is a pre-trained random forest model.
[0030] In one embodiment, the random forest model includes at least two decision trees.
[0031] A second aspect of the present application provides a spectrometer data correction system, comprising: a NIR camera module, a Mono camera module, and a spectral image processing module;
[0032] The NIR camera module is used to capture multi-spectral infrared images of the leaves to be inspected;
[0033] The Mono camera module is used to capture a grayscale image of the leaf to be inspected;
[0034] The spectral image processing module is used to execute the spectrometer data correction method.
[0035] The technical solution provided by this application may have the following beneficial effects:
[0036] The present application corrects the infrared image by the radiation capacity ratio of the blade to be detected. The corrected infrared image can effectively remove the detection error caused by temperature difference, thereby ensuring the accuracy of the subsequent image feature recognition step.
[0037] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0039] Figure 1 A schematic diagram of a process flow of a spectrometer data correction method according to an embodiment of the present application;
[0040] Figure 2 A schematic diagram of the logical structure of a spectrometer data correction system shown in an embodiment of the present application;
[0041] Figure 3 Another schematic flow chart of the spectrometer data correction method shown in the embodiment of the present application. DETAILED DESCRIPTION
[0042] The preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to the technicians in this field.
[0043] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0044] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0045] The principle of crop spectral analysis is that in the near-infrared band of the spectrum, the spectral characteristics of vegetation are mainly controlled by the internal structure of plant leaves. The spectral characteristics of healthy green plant leaves in the near-infrared band are high reflectivity (45%-50%), high transmittance (45%-50%), and low absorption (<5%).
[0046] In common greenhouse cultivation, the greenhouse does not have a laboratory-standard spectral analysis environment, and usually a portable infrared spectrometer is used for inspection and analysis. The same crop leaf will present different infrared images at different temperatures and different light conditions, resulting in the infrared spectrum of the detected leaf not matching the standard spectrum or matching incorrectly.
[0047] Therefore, crop diagnosis based on infrared spectroscopy needs to eliminate interference from external factors such as temperature and light during infrared imaging so that subsequent infrared spectra can be compared normally.
[0048] The present application embodiment first provides a spectrometer data correction system, such as Figure 2 As shown, it includes: NIR camera module, Mono camera module and spectral image processing module;
[0049] The NIR camera module is used to capture multi-spectral infrared images of the leaves to be inspected;
[0050] The Mono camera module is used to capture a grayscale image of the leaf to be inspected;
[0051] The spectral image processing module is used to execute a spectrometer data correction method provided in an embodiment of the present application.
[0052] Furthermore, the above-mentioned spectrometer data correction method is as follows: Figure 1 As shown, the following steps are included:
[0053] S1, obtaining infrared images and grayscale images of leaves;
[0054] Among them, the leaf infrared image is a multi-band infrared image of the leaf to be detected under near-infrared light; the leaf grayscale image is a grayscale image of the leaf to be detected, and the leaf grayscale image is a single-channel image.
[0055] In the embodiment of the present application, the spectrometer is provided with a NIR camera module, which transmits near-infrared light of multiple bands to the blade to be detected and converts the infrared radiation signal reflected by the blade to be detected into an electrical signal to obtain an infrared image of the blade (i.e., an image matrix I b ).
[0056] The NIR camera module is a near-infrared camera module, and near-infrared light is infrared light with a wavelength in the range of 700nm to 2500nm.
[0057] Specifically, the image matrix I of the leaf infrared image is b The spectrometer has multiple channels, and each channel records the infrared radiation intensity value reflected by the pixel point of the leaf to be detected. The spectrometer is equipped with infrared photosensitive elements of multiple bands, which can record the infrared light of each band reflected by the leaf, and generate a multi-spectral infrared image in the form of a matrix I b stored in the form of.
[0058] Since the leaf infrared image has multiple channels and a relatively high resolution, it means that the leaf infrared image has a large number of pixels, and each pixel is represented by a multi-channel vector.
[0059] In portable spectrometers, due to the limitation of computing performance, it takes a long time to process the infrared image of leaves. However, the infrared image of the leaves to be tested includes diseased areas and non-disease areas. Only the diseased areas are analyzed spectrally and the image data of the non-disease areas are eliminated, which can speed up the image processing.
[0060] Therefore, before processing the infrared image of the leaf, the embodiment of the present application will cut the infrared image of the leaf and mark the coordinates of the diseased area on the leaf.
[0061] In the subsequent infrared data processing, only the infrared data corresponding to the above-mentioned image coordinates need to be processed.
[0062] S2, identifying the diseased area on the leaf grayscale image to determine the image coordinates of the diseased area;
[0063] Furthermore, the spectrometer is also provided with a mono camera module, which captures a black and white image of the blade to be inspected.
[0064] Taking leaf spot infection as an example, during the infection period of fungal infection, the symptoms on the leaf surface are not obvious, but the fungal spores extending out of the leaf surface can be identified through a high-resolution mono camera.
[0065] Specifically, the leaf grayscale image obtained by the mono camera module is represented as an image matrix I c .
[0066] In the leaf grayscale image, each pixel of the leaf to be detected corresponds to the image matrix I c Each pixel in the leaf grayscale image is represented by a grayscale value in the range of [0, 256].
[0067] The embodiment of the present application uses the grayscale image of the leaf to identify the contour or area of the diseased area, wherein the diseased area refers to a shallow spot area, a powdery area or a band area on the leaf surface.
[0068] Specifically, the image coordinate marking of the diseased area can be implemented by an edge detection algorithm or an image area recognition algorithm, which will not be described in detail here.
[0069] In the embodiment of the present application, since the multi-band infrared image has a large number of channels and the computing power of the portable spectrometer is limited, in order to avoid unnecessary image processing of non-diseased areas, the computing speed of the spectral analysis step is increased.
[0070] The embodiment of the present application marks the image coordinates of the diseased area through the grayscale image of the leaf. In the subsequent infrared image data processing, it is only necessary to perform spectral analysis on the image coordinates of the diseased area in the infrared image.
[0071] S3, cutting the infrared image of the leaf according to the image coordinates of the diseased area to obtain N sub-images of the diseased area;
[0072] As shown in step S3, the infrared image of the leaf is cut according to the image coordinates of the diseased area to obtain a plurality of sub-images of the diseased area.
[0073] After step S3, since the reflectivity of the leaves to infrared light is different at different temperatures, different spectral analysis graphs will be obtained for the leaves at different detection temperatures.
[0074] Therefore, based on the principle of spectral analysis, if testing at the testing environment temperature results in a spectrum different from that of the standard testing environment, inaccurate qualitative and quantitative analysis results will be obtained.
[0075] In the embodiment of the present application, the infrared image data is corrected through step S4.
[0076] S4, obtaining the detection environment temperature and determining the convolution kernel;
[0077] Specifically, the ratio between the first radiation capacity and the second radiation capacity of the blade to be detected is used as the sum of the convolution kernels, wherein the first radiation capacity is the radiation capacity of the blade to be detected at the detection environment temperature, and the second radiation capacity is the radiation capacity of the blade to be detected at the standard temperature.
[0078] The calculation formula of the radiation capacity ratio is:
[0079]
[0080] Wherein, E1 is the first radiation capability, and E2 is the second radiation capability; the calculation formulas of the first radiation capability and the second radiation capability are:
[0081]
[0082] Where E is the radiation capacity; ε is the blackness, which is the ratio of the leaf to be tested to the black body; C0 is a known constant of 5.67W / m 2 K 4 ; T is absolute temperature.
[0083] Furthermore, the convolution calculation formula is:
[0084] I a =K·I b
[0085] Among them, I a is the matrix representation of the corrected multispectral image, I b is the matrix representation of the standard multispectral image, and K is the convolution matrix.
[0086] Specifically, the convolution kernel is generated according to the ambient temperature-blade infrared radiation function. The elements of the convolution matrix K are expressed as K ij, indicating the weight of the corresponding element.
[0087] Before defining the convolution kernel, it is necessary to establish a function equation based on the temperature of the blade in the detection environment and the standard infrared spectrum temperature in the database for comparison.
[0088] In the principles of heat transfer, the radiation capacity of an object conforms to the following formula:
[0089]
[0090] Wherein, E is the radiation capacity, in this embodiment of the application, the object refers to the blade to be detected; ε is the blackness, that is, the ratio of the blade to be detected and the black body, which is used as a known coefficient in this embodiment of the application; C0 is a known constant of 5.67W / m 2 K 4 ; T is the absolute temperature of the blade to be tested, which is the room temperature of the testing environment in the embodiment of the present application.
[0091] Therefore, according to the radiation capacity formula, the ratio of the leaf radiation capacity under the two environments is
[0092]
[0093] Among them, E1 is the radiation capacity of the blade under the temperature of the detection environment, and E2 is the radiation capacity of the blade under the standard infrared spectrum environment.
[0094] In the embodiment of the present application, the definition steps of the convolution matrix K are as follows: Figure 3 As shown, the following steps are included:
[0095] S31, define the convolution kernel size;
[0096] S32, setting the element value of the convolution kernel according to the local neighborhood feature to extract the local neighborhood feature;
[0097] S33. Set the sum of convolution kernels to k.
[0098] Before convolving the leaf multispectral image, the sum of the convolution kernels is first set equal to the ratio of the radiation capacity of the leaves to be detected at different temperatures.
[0099] During the convolution, the matrix element values of the leaf multispectral image are convolved and then enlarged or reduced according to the radiation capacity ratio, thereby removing the infrared image error caused by the different temperatures of the leaves to be detected.
[0100] S5, extracting features of the infrared image of the diseased area according to the convolution kernel to obtain a feature vector of the diseased area;
[0101] After the convolution process, the diseased area feature vector of the diseased area sub-image is obtained as the input of the random forest model in step S6.
[0102] S6. Input the disease area feature vector into a disease recognition model, and output the crop disease type.
[0103] The disease recognition model is pre-trained based on the random forest model. The random forest model is used to classify the disease types of crop leaves.
[0104] Specifically, the spectrometer obtains N processed diseased area sub-images and performs convolution according to the image matrix of the N diseased area sub-images.
[0105] The feature vectors extracted by convolution are fused to form a matrix composed of N feature vectors, where each vector block represents a sub-image of the diseased area. Finally, the feature vectors of the total matrix are input into the disease recognition model for classification.
[0106] In the embodiment of the present application, the infrared image is corrected by the radiation capacity ratio of the blade to be detected. The corrected infrared image can effectively remove the detection error caused by the temperature difference, thereby ensuring the accuracy of the subsequent image feature recognition step.
[0107] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0108] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A spectrometer data correction method, characterized in that: include: S1, obtaining infrared images and grayscale images of leaves; The leaf infrared image is a multi-band infrared image of the leaf to be detected under near-infrared light; The leaf grayscale image is a grayscale image of the leaf to be detected, and the leaf grayscale image is a single-channel image; S2, identifying the diseased area on the leaf grayscale image to determine the image coordinates of the diseased area; S3. Cut the infrared image of the leaf according to the image coordinates of the diseased area to obtain N sub-images of the diseased area; wherein N is an integer greater than or equal to 1. S4, obtaining the detection environment temperature and determining the convolution kernel; S5, extracting features of the diseased area sub-image according to the convolution kernel to obtain a feature vector of the diseased area; S6. Input the disease area feature vector into a disease recognition model, and output the crop disease type.
2. A spectrometer data correction method according to claim 1, characterized in that: The determining of the convolution kernel specifically includes: The ratio between the first radiation capability and the second radiation capability of the blade to be detected is used as the sum of the element values of the convolution kernel.
3. A spectrometer data correction method according to claim 2, characterized in that: The first radiation capacity is the radiation capacity of the blade to be detected at the detection environment temperature, and the first radiation capacity is the radiation capacity of the blade to be detected at the standard temperature; The calculation formula of the radiation capacity ratio is: Among them, E1 is the first radiation capability, E2 is the second radiation capability, and k is the radiation capability ratio.
4. A spectrometer data correction method according to claim 3, characterized in that: The calculation formulas of the first radiation capability and the second radiation capability are: Where E is the radiation capacity; ε is the blackness of the blade to be tested, T is the absolute temperature of the blade to be tested, and C0 is a known constant of 5.67W / m 2 K 4 .
5. A spectrometer data correction method according to claim 1, characterized in that: The extracting features of the diseased area sub-image according to the convolution kernel specifically includes: The convolution calculation formula is: I a =K·I b Among them, I a is the matrix representation of the corrected multispectral image, I b is the matrix representation of the standard multispectral image, and K is the convolution matrix.
6. A spectrometer data correction method according to claim 1, characterized in that: The disease recognition model is a pre-trained random forest model.
7. A spectrometer data correction method according to claim 1, characterized in that: The random forest model includes at least two decision trees.
8. A spectrometer data correction system, characterized in that: include: NIR camera module, Mono camera module and spectral image processing module; The NIR camera module is used to capture multi-spectral infrared images of the leaves to be inspected; The Mono camera module is used to capture a grayscale image of the leaf to be inspected; The spectral image processing module is used to execute the spectrometer data correction method as described in any one of claims 1 to 7.
Citation Information
Cited By
Potato leaf disease area positioning method, system and device
CN120655580A
