Tea hyperspectral image ROI region screening method and computer equipment

Through hyperspectral image processing technology, the tea leaves and main leaf vein areas were separated, and the reflectance evaluation model was constructed, which solved the background interference and uneven component distribution in tea bud target detection in the existing technology, and achieved the precise screening of the target components of tea leaves and detection.

CN119206180AActive Publication Date: 2024-12-27SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202411313213.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-27
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

The existing tea bud leaf target detection methods have large interference in the background area during regression frame detection, and the distribution of target components on the leaves is uneven, making it difficult to accurately separate the meat leaf and main leaf vein areas.

Method used

Using hyperspectral image processing technology, the meat leaf and main leaf vein areas were separated through pre-processing, image segmentation, reflectivity calculation and clustering analysis, and the reflectivity evaluation model was constructed, and the optimal ROI area containing the target components was selected.

Benefits of technology

The precise separation of the meat and main vein areas of tea leaves is achieved, the detection accuracy and distribution uniformity of the target components of tea buds and leaves is improved, and the final ROI area containing more target components is selected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206180A_ABST
    Figure CN119206180A_ABST
Patent Text Reader

Abstract

The invention provides a tea hyperspectral image ROI region screening method and computer equipment, and the method comprises the steps: calculating the reflectivity of a main vein image and M-type mesophyll ROI, and obtaining M + 1-type reflectivity. And carrying out image segmentation on the preprocessed image, and removing a main leaf vein image from the leaf image to obtain a mesophyll image. And calculating a correlation coefficient between the target component of the tea leaf and each reflectivity, constructing a reflectivity evaluation model according to the correlation coefficient, and selecting an optimal reflectivity and a corresponding final ROI region by using the reflectivity evaluation model. The correlation coefficient can reflect the relation between local image features of mesophyll and main leaf veins and the reflectivity, and the fitting degree and prediction precision of the reflectivity evaluation model to the hyperspectral image of the tea leaf can be comprehensively measured in combination with different evaluation modes. According to the method, the mesophyll region and the main vein region of the tea leaf are separated, and the optimal reflectivity and the corresponding final ROI region are screened out by using the reflectivity evaluation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of spectral data processing, and in particular to a method and computer equipment for screening ROI regions of tea hyperspectral images. Background Art

[0002] Tea is rich in nutrients such as tea polyphenols, catechins, amino acids, caffeine, etc., and has become a beverage with a large consumption. The demand for high-quality tea is increasing. In recent years, the tea bud and leaf segmentation method based on computer vision has been widely used in tea quality analysis.

[0003] In order to better optimize the robot's detection and positioning performance of fresh tea buds, many researchers have done extensive research on traditional image processing algorithms and deep learning algorithms. There are two problems with the existing tea bud target detection methods. The first problem is that most tea bud target detection methods use regression frames to detect tea bud targets. The regression frame contains background areas, which has a great interference on the segmentation performance. The second problem is that the distribution of the detected tea bud target components on the leaves is uneven. A certain target component is concentrated in a certain area on the leaves, such as cellulose concentrated in the veins and nutrients concentrated in the mesophyll.

[0004] Therefore, a method is needed to separate the mesophyll area and the main vein area of ​​the tea leaf, establish the correlation coefficient between the target component and the reflectivity, and thus accurately select the ROI area containing more target components. Summary of the invention

[0005] In order to overcome the problems existing in the related art, one of the purposes of the present invention is to provide a ROI area screening method for tea hyperspectral images, which can separate the mesophyll area and the main vein area of ​​the tea leaves, establish the correlation coefficient between the target component and the reflectivity, and thus accurately select the ROI area containing more target components.

[0006] A method for screening ROI regions of tea hyperspectral images, comprising:

[0007] Acquire a hyperspectral image of tea leaves, and preprocess the hyperspectral image to obtain a preprocessed image;

[0008] Performing image segmentation on the preprocessed image to obtain a main vein image and a leaf image;

[0009] removing the main vein image from the leaf image to obtain a leaf flesh image;

[0010] Extracting a mesophyll ROI matrix from the mesophyll image, and dividing M types of mesophyll ROIs according to the distances between different mesophyll ROI matrices;

[0011] Calculate the reflectivity of the main vein image and the M-type leaf flesh ROI to obtain the M+1-type reflectivity;

[0012] Calculating the correlation coefficient between the target component of the tea leaves and each of the reflectances, and constructing a reflectance evaluation model according to the correlation coefficients;

[0013] The reflectivity evaluation model is used to select the optimal reflectivity and the corresponding final ROI area.

[0014] In a preferred technical solution of the present invention, the image segmentation of the preprocessed image to obtain the main vein image and the leaf image includes:

[0015] Inputting the preprocessed image into an image segmentation model for image segmentation to obtain a leaf image;

[0016] Filtering a plurality of first-category edge pixel points of the leaf from the leaf image;

[0017] According to the coordinates of the first type of edge pixel points, the leaf image is translated and cut to obtain a plurality of main vein regions;

[0018] A plurality of the main vein regions are combined to obtain a main vein image.

[0019] In a preferred technical solution of the present invention, the leaf image is translated and cut according to the coordinates of the first type of edge pixel points to obtain a plurality of main vein regions, including:

[0020] Selecting a starting point from the first type of edge pixel points; wherein the first type of edge pixel points correspond to the edge of the tea leaf;

[0021] Draw a detection frame with the starting point as the center;

[0022] The detection frame is translated to cut the leaf image until the entire leaf region is traversed to obtain a plurality of detection frame images;

[0023] Extracting an image edge from each of the detection frame images, removing the first type of edge pixel points from the image edge, and obtaining the second type of edge pixel points;

[0024] The second-category edge pixel points belonging to the same detection frame image are connected to obtain a plurality of main vein regions.

[0025] In a preferred technical solution of the present invention, the M types of mesophyll ROIs are divided according to the distances between different mesophyll ROI matrices, including:

[0026] The KNN clustering algorithm is used to cluster the Euclidean distances between the different leaf flesh ROI matrices to obtain M types of leaf flesh ROIs.

[0027] In a preferred technical solution of the present invention, the calculation of the reflectivity of the main vein image and the M-type leaf flesh ROI to obtain the M+1-type reflectivity includes:

[0028] Acquire P main vein images, and calculate the first type reflectivity of the P main vein images;

[0029] Selecting K first-category reflectances with the highest similarity from the P main vein images, and calculating the average of the K first-category reflectances with the highest similarity to obtain the reflectance of the main vein image;

[0030] Obtain P i-th leaf flesh ROIs, and calculate the second-class reflectance of the P i-th leaf flesh ROIs;

[0031] Select K reflectances of the second category with the highest similarity from P i-th mesophyll ROIs, calculate the average of the K reflectances of the second category with the highest similarity, and obtain the reflectance of the i-th mesophyll ROI; wherein 1≤i≤M.

[0032] In a preferred technical solution of the present invention, the calculation of the correlation coefficient between the target component of the tea leaves and each of the reflectances includes:

[0033] Obtaining N tea leaves and corresponding N*(M+1) reflectivities;

[0034] Calculate the correlation coefficients between the target components of the N tea leaves and the corresponding N*(M+1) reflectivities; wherein the target components include moisture content, cellulose content and tea polyphenol content.

[0035] In a preferred technical solution of the present invention, the preprocessing of the hyperspectral image to obtain the preprocessed image includes:

[0036] Performing black-and-white correction on the hyperspectral image to obtain a black-and-white corrected image;

[0037] Performing grayscale conversion on the black-and-white corrected image to obtain a grayscale image;

[0038] Guided filtering is performed on the grayscale image to obtain a preprocessed image.

[0039] In a preferred technical solution of the present invention, the step of constructing a reflectivity evaluation model according to the correlation coefficient includes:

[0040] Performing principal component analysis on the hyperspectral image to obtain principal components;

[0041] If the correlation coefficient is greater than the correlation coefficient threshold, a partial least squares regression estimation model between the principal component and the target component is constructed.

[0042] In a preferred technical solution of the present invention, the use of the reflectivity evaluation model to select the optimal reflectivity and the corresponding final ROI area includes:

[0043] The model determination coefficient R 2 evaluating the partial least squares regression estimation model to obtain a first score;

[0044] The partial least squares regression estimation model is evaluated using relative analytical error (RPD) to obtain a second score;

[0045] The normalized root mean square error NRMSE is used to evaluate the partial least squares regression estimation model to obtain a third score;

[0046] Calculate a comprehensive score based on the first score, the second score, and the third score;

[0047] The reflected ROI region corresponding to the maximum value of the comprehensive score is used as the final ROI region.

[0048] A second object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of any of the above-mentioned methods for screening ROI areas of tea hyperspectral images when executing the computer program.

[0049] The beneficial effects of the present invention are:

[0050] The tea leaf hyperspectral image ROI area screening method provided by the present invention comprises obtaining a hyperspectral image of tea leaves, preprocessing the hyperspectral image, and obtaining a preprocessed image. The preprocessed image is segmented to obtain a main vein image and a leaf image. The tea leaves include main veins and mesophyll. The main vein image is removed from the leaf image to obtain the mesophyll image. The mesophyll image is a grayscale image, and the mesophyll image is converted into the form of a grayscale matrix. The distance between different matrices is calculated, and the mesophyll ROI is divided into M categories according to the size of the distance between the matrices. The mesophyll and the main vein represent different areas of the leaf, and the mesophyll occupies most of the area of ​​the leaf, so the mesophyll has multiple types, and different types of mesophyll have different reflectivities. The reflectivities of the main vein image and the M-type mesophyll ROI are calculated, and a total of M+1 types of reflectivities are obtained. The correlation coefficient between the target component of the tea leaf and each reflectivity is calculated, and a reflectivity evaluation model is constructed according to the correlation coefficient, and the reflectivity evaluation model is used to select the optimal reflectivity and the corresponding final ROI area. The correlation coefficient can reflect the relationship between the local image features of the mesophyll and main veins and the reflectivity. The reflectivity evaluation model includes a variety of evaluation methods. Combining different evaluation methods, the fitting degree and prediction accuracy of the reflectivity evaluation model for the hyperspectral image of tea leaves can be comprehensively measured. The above method separates the mesophyll area and the main vein area of ​​the tea leaves, and uses the reflectivity evaluation model to screen out the optimal reflectivity and the corresponding final ROI area. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a flow chart of the tea hyperspectral image ROI area screening method of the present invention;

[0052] Figure 2 is a schematic diagram of a preprocessed image of the present invention;

[0053] Figure 3 is a binary image of the leaf image of the present invention;

[0054] Figure 4 is a binary image of the main vein image of the present invention;

[0055] Figure 5 is a profile diagram of a tea leaf of the present invention;

[0056] Figure 6 It is an outline diagram of the main leaf vein of the present invention. DETAILED DESCRIPTION

[0057] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention 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 invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0058] Example 1

[0059] like Figure 1-Figure 6 As shown, this embodiment provides a method for screening ROI regions of tea hyperspectral images, including:

[0060] S1: Acquire a hyperspectral image of tea leaves, and preprocess the hyperspectral image to obtain a preprocessed image.

[0061] Step S1 includes the following steps S11-S13:

[0062] S11: performing black-and-white correction on the hyperspectral image to obtain a black-and-white corrected image.

[0063] S12: performing grayscale conversion on the black-and-white corrected image to obtain a grayscale image.

[0064] S13: performing guided filtering on the grayscale image to obtain a preprocessed image.

[0065] The hyperspectral image is corrected for black and white according to the following formula:

[0066]

[0067] Among them, I0 is the black and white corrected image, lg represents the logarithmic function, I is the hyperspectral image, and I D is a black frame image, I W is a white frame image. The black frame image and the white frame image are used to calibrate the hyperspectral image of tea leaves collected by the hyperspectral camera.

[0068] When collecting hyperspectral images, the quality of the collected images will be affected by factors such as dark current noise, detector sensitivity, and optical transmission characteristics. Black and white correction corrects the noise and deviation in the original data by collecting white frame images with a reflectivity close to 100% and black frame images with a reflectivity close to 0%, thereby improving the quality and accuracy of hyperspectral images.

[0069] The RGB pixel values ​​of the black-and-white corrected image are weighted summed to convert the black-and-white corrected image in RGB form into a grayscale image. The black-and-white corrected image is converted to grayscale according to the following formula:

[0070] Gray=0.299*R+0.587*G+0.114*B;

[0071] Among them, Gray is the grayscale value of the grayscale image, R is the value of the red channel of the black and white corrected image, G is the value of the green channel of the black and white corrected image, and B is the value of the blue channel of the black and white corrected image.

[0072] The definition of guided filtering uses a local linear model. The guided filtering model assumes that a point on a function has a linear relationship with its neighboring points. A complex function can be represented by many local linear functions. When the value of a point on a function is required, it is only necessary to calculate the values ​​of all linear functions containing the point and average them. The grayscale image is regarded as a two-dimensional function, which cannot be represented by an analytical expression. The guided filtering assumes that the output and input are linearly related in a two-dimensional window. The formula for guided filtering is as follows:

[0073] q i =a k I i +b k ;

[0074] Among them, q i is the preprocessed image, I i For the guide image, a k is the multiplicative coefficient, b k is the additive coefficient, and i represents the image number.

[0075] Guided filtering is a process of denoising the input grayscale image while minimizing the difference between the output preprocessed image and the input grayscale image, so that the preprocessed image q i With the grayscale image p i have the same image characteristics.

[0076] S2: performing image segmentation on the preprocessed image to obtain a main vein image and a leaf image.

[0077] Step S2 includes the following steps S21-S24:

[0078] S21: Inputting the preprocessed image into an image segmentation model for image segmentation to obtain a leaf image.

[0079] S22: Filter out a plurality of first-category edge pixel points of the leaf from the leaf image.

[0080] S23: performing translation cutting on the leaf image according to the coordinates of the first type of edge pixel points to obtain a plurality of main vein regions.

[0081] S24: combining the plurality of main vein regions to obtain a main vein image.

[0082] This embodiment takes the Mask-RCNN model as an example of an image segmentation model. The Mask-RCNN model includes a backbone network, a region generation network, a proposal layer, and a target detection layer. The Mask-RCNN model can output high-quality instance segmentation masks while effectively detecting targets.

[0083] The image corresponding to the leaf mask output by the Mask-RCNN model is used as the leaf image, and the edge points on the mask, that is, the points at the intersection of the pixel value of 0 and the pixel value of 1, are used as the first type of edge pixel points. The leaf image is translated and cut according to the coordinates of the first type of edge pixel points to obtain multiple main vein regions. According to the relative position relationship between different main vein regions, multiple main vein regions are spliced ​​to obtain a main vein image.

[0084] Step S23 includes the following steps S231-S235:

[0085] S231: Selecting a starting point from the first category of edge pixel points; wherein the first category of edge pixel points corresponds to the edge of the tea leaf.

[0086] S232: Draw a detection frame with the starting point as the center.

[0087] S233: translating the detection frame to cut the leaf image until the entire leaf region is traversed to obtain a plurality of detection frame images.

[0088] S234: extracting image edges from each of the detection frame images, removing the first category of edge pixel points from the image edges, and obtaining second category of edge pixel points.

[0089] S235: Connect the second-category edge pixel points belonging to the same detection frame image to obtain a plurality of main vein regions.

[0090] The contour of the edge of the tea leaf is closed, so a pixel point can be randomly selected from the first type of edge pixel points representing the edge of the tea leaf, and the pixel point can be used as the starting point.

[0091] A rectangular detection frame is used, and the size of the rectangular detection frame is adjusted according to the size of the leaf image. In this embodiment, the size of the rectangular detection frame is 2*2 as an example. The rectangular detection frame is translated along the extension direction, horizontal direction, vertical direction or inclined direction of the main vein with the starting point as the center. The translation step of the rectangular detection frame is 1. The rectangular detection frame after each translation is screenshoted with the coordinates of the upper left corner of the rectangular detection frame, and the detection frame image is saved.

[0092] The size of the detection frame image is small, and the image edge of the detection frame image can be quickly extracted after one translation. Then the first-class edge pixels belonging to the leaf edge are removed, and the remaining pixels in each main vein area are the second-class edge pixels. All the main vein areas that only contain the second-class edge pixels are combined to obtain the main vein image. The main vein image is as follows Figure 4 and Figure 6 As shown, the main leaf veins are in the form of long and thin strips.

[0093] S3: removing the main vein image from the leaf image to obtain a mesophyll image.

[0094] S4: extracting a mesophyll ROI matrix from the mesophyll image, and dividing M types of mesophyll ROIs according to the distances between different mesophyll ROI matrices.

[0095] The KNN (K-Nearest Neighbor) clustering algorithm is used to cluster the Euclidean distances between the different leaf flesh ROI matrices to obtain M types of leaf flesh ROIs. The Euclidean distances between the grayscale matrices are calculated, and the KNN clustering algorithm is used to divide them into three categories according to the size of the Euclidean distance, that is, M=3, to obtain three types of leaf flesh ROIs.

[0096] S5: Calculate the reflectivity of the main vein image and the M-type leaf flesh ROI to obtain the M+1-type reflectivity.

[0097] Step S5 includes the following steps S51-S54:

[0098] S51: Acquire P main vein images, and calculate the first type reflectivity of the P main vein images.

[0099] S52: Filter out K first-category reflectances with the highest similarity from the P main leaf vein images, calculate the average of the K first-category reflectances with the highest similarity, and obtain the reflectance of the main leaf vein image.

[0100] S53: Obtain P i-th leaf flesh ROIs, and calculate the second-class reflectivity of the P i-th leaf flesh ROIs.

[0101] S54: Filter out K reflectances of the second category with the highest similarity from P i-th mesophyll ROIs, calculate the average of the K reflectances of the second category with the highest similarity, and obtain the reflectance of the i-th mesophyll ROI; wherein 1≤i≤M.

[0102] The number of main vein images, first-class mesophyll ROIs, second-class mesophyll ROIs, and third-class mesophyll ROIs is P, and P>5. The reflectance of the main vein images and the three types of mesophyll ROIs is extracted. There are 4 types of reflectances in total. For each type of reflectance, the five reflectances with the highest similarity are selected, that is, K=5. The average of the five reflectances is calculated to obtain 4 types of reflectances.

[0103] S6: Calculate the correlation coefficient between the target component of the tea leaves and each of the reflectances, and construct a reflectance evaluation model based on the correlation coefficients.

[0104] S7: Use the reflectivity evaluation model to select the optimal reflectivity and the corresponding final ROI area.

[0105] The hyperspectral images corresponding to the four types of reflectance obtained in step S5 are subjected to principal component analysis in turn and target components are selected, and the target components include moisture content, cellulose content and tea polyphenol content.

[0106] The correlation coefficient between the target component of the tea leaves and each reflectivity is calculated, and a reflectivity evaluation model is constructed based on the correlation coefficient. The reflectivity evaluation model is used to select the optimal reflectivity and the corresponding final ROI area. The correlation coefficient can reflect the relationship between the local image features and reflectivity of the mesophyll and main veins. The reflectivity evaluation model includes a variety of evaluation methods. Combining different evaluation methods, the fitting degree and prediction accuracy of the reflectivity evaluation model for the hyperspectral image of tea leaves can be comprehensively measured. The above method separates the mesophyll area and the main vein area of ​​the tea leaves, and uses the reflectivity evaluation model to screen out the optimal reflectivity and the corresponding final ROI area.

[0107] The tea leaf hyperspectral image ROI area screening method of this embodiment includes obtaining a hyperspectral image of tea leaves, preprocessing the hyperspectral image, and obtaining a preprocessed image. The preprocessed image is segmented to obtain a main vein image and a leaf image. Tea leaves include main veins and mesophyll. The main vein image is removed from the leaf image to obtain a mesophyll image. The mesophyll image is a grayscale image, and the mesophyll image is converted into a grayscale matrix. The distance between different matrices is calculated, and the mesophyll ROI is divided into M categories according to the size of the distance between the matrices. Mesophyll and main veins represent different areas of the leaf. Mesophyll occupies most of the area of ​​the leaf, so mesophyll has multiple types, and different types of mesophyll have different reflectivities. The reflectivity of the main vein image and M-type mesophyll ROI is calculated to obtain a total of M+1 types of reflectivity. The correlation coefficient between the target component of the tea leaf and each reflectivity is calculated, and a reflectivity evaluation model is constructed based on the correlation coefficient. The reflectivity evaluation model is used to select the optimal reflectivity and the corresponding final ROI area. The correlation coefficient can reflect the relationship between the local image features of the mesophyll and main veins and the reflectivity. The reflectivity evaluation model includes a variety of evaluation methods. Combining different evaluation methods, the fitting degree and prediction accuracy of the reflectivity evaluation model for the hyperspectral image of tea leaves can be comprehensively measured. The above method separates the mesophyll area and the main vein area of ​​the tea leaves, and uses the reflectivity evaluation model to screen out the optimal reflectivity and the corresponding final ROI area.

[0108] Example 2

[0109] like Figure 1-Figure 6 As shown, this embodiment provides a method for screening ROI regions of tea leaf hyperspectral images. This embodiment only describes the differences from Embodiment 1. The calculation of the correlation coefficient between the target component of the tea leaf and each of the reflectances includes:

[0110] S61: Obtain N tea leaves and the corresponding N*(M+1) reflectivities.

[0111] S62: Calculate the correlation coefficients between the target components of the N tea leaves and the corresponding N*(M+1) reflectivities; wherein the target components include moisture content, cellulose content and tea polyphenols content.

[0112] In this embodiment, M=3 is taken as an example, each tea leaf corresponds to 4 reflectances, and N tea leaves correspond to N*4 reflectances. The larger the absolute value of the correlation coefficient, the stronger the correlation between the target component and the reflectance, and the better the modeling effect. The correlation coefficient can characterize the characteristics of the leaf flesh and the main vein in each local area of ​​the image, so as to select the most representative ROI.

[0113] The step of constructing a reflectivity evaluation model according to the correlation coefficient comprises:

[0114] S63: Performing principal component analysis on the hyperspectral image to obtain principal components.

[0115] S64: If the correlation coefficient is greater than the correlation coefficient threshold, a partial least squares regression estimation model between the principal component and the target component is constructed.

[0116] The main idea of ​​principal component analysis is to project the original high-dimensional feature space into a new low-dimensional feature space through linear transformation, while trying to keep the variance of the original data so that the difference of the data can be retained in the new low-dimensional space.

[0117] Since there are multiple target components and a large number of hyperspectral images, if a partial least squares regression estimation model is directly established between each hyperspectral image and each target component, the data volume will be large and the operation efficiency will be low. Performing principal component analysis on hyperspectral images can reduce the data volume and improve the operation speed.

[0118] The method of using the reflectivity evaluation model to select the optimal reflectivity and the corresponding final ROI area includes:

[0119] S71: Modeling determination coefficient R 2 The partial least squares regression estimation model is evaluated to obtain a first score.

[0120] S72: Use relative analytical error RPD to evaluate the partial least squares regression estimation model to obtain a second score.

[0121] S73: Use the normalized root mean square error NRMSE to evaluate the partial least squares regression estimation model to obtain a third score.

[0122] S74: Calculate a comprehensive score based on the first score, the second score, and the third score.

[0123] S75: taking the reflected ROI region corresponding to the maximum value of the comprehensive score as the final ROI region.

[0124] The model determination coefficient R 2 , relative analysis error (RPD) and normalized root mean square error (NRMSE) were used to comprehensively evaluate multiple partial least squares regression estimation models, including a total of partial least squares regression estimation models between N target components of tea leaves and the corresponding M+1 reflectances.

[0125] Modeling determination coefficient R 2 It has the following advantages: (1) Modeling determination coefficient R 2It is a relative value between [0,1], which overcomes the disadvantage of the MSE (mean-square error) method that has no upper bound. (2) Modeling determination coefficient R 2 is a relative value, the modeling determination coefficient R 2 It reflects the proportion of the fitted information to the total information of the sample itself, so the modeling determination coefficient is applicable to different samples and different models.

[0126] RPD is a statistical indicator used to evaluate data consistency. RPD reflects the degree to which the data deviates from the mean, that is, the degree of dispersion of the data.

[0127] The advantage of NRMSE is that it overcomes scale dependence and simplifies the comparison process between different scales or models.

[0128] The model determination coefficient R 2 The weight of is set to 50%, the weight of the relative analysis error RPD is set to 30%, and the weight of the normalized root mean square error NRMSE is set to 20%. The weighted summation or AHP is used to calculate the comprehensive score T of the partial least squares model. The steps of the AHP include: (1) establishing a hierarchical model; (2) constructing a comparison matrix; (3) calculating the weight vector and performing a consistency test; (4) calculating the combined weight vector and performing a combined consistency test.

[0129] The maximum value of the comprehensive score is screened out, and the ROI area of ​​the reflectance corresponding to the maximum value of the comprehensive score is used as the final ROI area. The final ROI area is used to characterize the area with the most concentrated moisture content, cellulose content or tea polyphenols content.

[0130] This embodiment combines the modeling determination coefficient R 2 , relative analysis error RPD and normalized root mean square error NRMSE respectively evaluate the partial least squares regression estimation model to obtain three scores. The three scores are weighted summed or AHP hierarchical analysis is performed to obtain a comprehensive score. The larger the comprehensive score, the higher the accuracy of the correlation estimated by the partial least squares regression estimation model. The reflected ROI area corresponding to the maximum value of the comprehensive score is taken as the final ROI area, and the final ROI area is used to characterize the area with the most concentrated moisture content, cellulose content or tea polyphenols content.

[0131] Example 3

[0132] A computer device is also provided in an embodiment of the present application, which may be a server, wherein the computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target word vectors, etc. The network interface of the computer device is used to communicate with an external terminal via a network connection. Furthermore, the above-mentioned computer device may also be provided with an input device and a display screen, etc.

[0133] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, a method for selecting a ROI region of a tea hyperspectral image is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0134] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0135] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for screening ROI regions of tea hyperspectral images, characterized in that: include: Acquire a hyperspectral image of tea leaves, and preprocess the hyperspectral image to obtain a preprocessed image; Performing image segmentation on the preprocessed image to obtain a main vein image and a leaf image; removing the main vein image from the leaf image to obtain a leaf flesh image; Extracting a mesophyll ROI matrix from the mesophyll image, and dividing M types of mesophyll ROIs according to the distances between different mesophyll ROI matrices; Calculate the reflectivity of the main vein image and the M-type leaf flesh ROI to obtain the M+1-type reflectivity; Calculating the correlation coefficient between the target component of the tea leaves and each of the reflectances, and constructing a reflectance evaluation model according to the correlation coefficients; The reflectivity evaluation model is used to select the optimal reflectivity and the corresponding final ROI area.

2. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The performing image segmentation on the preprocessed image to obtain a main vein image and a leaf image includes: Inputting the preprocessed image into an image segmentation model for image segmentation to obtain a leaf image; Filtering a plurality of first-category edge pixel points of the leaf from the leaf image; According to the coordinates of the first type of edge pixel points, the leaf image is translated and cut to obtain a plurality of main vein regions; A plurality of the main vein regions are combined to obtain a main vein image.

3. The method for screening ROI regions of tea leaf hyperspectral images according to claim 2, characterized in that: The leaf image is translated and cut according to the coordinates of the first type of edge pixel points to obtain a plurality of main vein regions, including: Selecting a starting point from the first type of edge pixel points; wherein the first type of edge pixel points correspond to the edge of the tea leaf; Draw a detection frame with the starting point as the center; The detection frame is translated to cut the leaf image until the entire leaf region is traversed to obtain a plurality of detection frame images; Extracting an image edge from each of the detection frame images, removing the first type of edge pixel points from the image edge, and obtaining the second type of edge pixel points; The second-category edge pixel points belonging to the same detection frame image are connected to obtain a plurality of main vein regions.

4. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The dividing of M types of mesophyll ROIs according to the distances between different mesophyll ROI matrices includes: The KNN clustering algorithm is used to cluster the Euclidean distances between the different leaf flesh ROI matrices to obtain M types of leaf flesh ROIs.

5. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The calculating the reflectivity of the main vein image and the M-type leaf flesh ROI to obtain the M+1-type reflectivity includes: Acquire P main vein images, and calculate the first type reflectivity of the P main vein images; Selecting K first-category reflectances with the highest similarity from the P main vein images, and calculating the average of the K first-category reflectances with the highest similarity to obtain the reflectance of the main vein image; Obtain P i-th leaf flesh ROIs, and calculate the second-class reflectance of the P i-th leaf flesh ROIs; Select K reflectances of the second category with the highest similarity from P i-th mesophyll ROIs, calculate the average of the K reflectances of the second category with the highest similarity, and obtain the reflectance of the i-th mesophyll ROI; wherein 1≤i≤M.

6. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The step of calculating the correlation coefficient between the target component of the tea leaves and each of the reflectances comprises: Obtaining N tea leaves and corresponding N*(M+1) reflectivities; Calculate the correlation coefficients between the target components of the N tea leaves and the corresponding N*(M+1) reflectivities; wherein the target components include moisture content, cellulose content and tea polyphenol content.

7. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The preprocessing of the hyperspectral image to obtain a preprocessed image includes: Performing black-and-white correction on the hyperspectral image to obtain a black-and-white corrected image; Performing grayscale conversion on the black-and-white corrected image to obtain a grayscale image; Guided filtering is performed on the grayscale image to obtain a preprocessed image.

8. The method for screening ROI regions of tea hyperspectral images according to claim 1, characterized in that: The step of constructing a reflectivity evaluation model according to the correlation coefficient comprises: Performing principal component analysis on the hyperspectral image to obtain principal components; If the correlation coefficient is greater than the correlation coefficient threshold, a partial least squares regression estimation model between the principal component and the target component is constructed.

9. The method for screening ROI regions of tea hyperspectral images according to claim 8, characterized in that: The method of using the reflectivity evaluation model to select the optimal reflectivity and the corresponding final ROI area includes: The model determination coefficient R 2 evaluating the partial least squares regression estimation model to obtain a first score; The partial least squares regression estimation model is evaluated using relative analytical error (RPD) to obtain a second score; The normalized root mean square error NRMSE is used to evaluate the partial least squares regression estimation model to obtain a third score; Calculate a comprehensive score based on the first score, the second score, and the third score; The reflected ROI region corresponding to the maximum value of the comprehensive score is used as the final ROI region.

10. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method for screening ROI area of ​​tea hyperspectral image according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Fresh tea leaf classification method based on multiple features and multiple classifiers

    CN111861103A

  • Citrus leaf water stress detection method and system based on hyperspectral imaging and deep learning

    CN117541835A

  • Ground-air spectrum technology combined tea bud yield monitoring method

    CN118552870A

  • Solar module abnormal encapsulation structure

    CN201479044U

  • Machine learning-based hyperspectral detection and visualization method of nitrogen content in soil profile

    US20240099179A1

Cited By

  • Prediction method and device for spectral data of tea powder

    CN119845881A

  • Leaf vein detection method and detection equipment for ryegrass

    CN121305534A

  • Multisource image tea bud ROI extraction method based on semantic segmentation and tea bud discrimination

    CN121564324A

  • An effective reflection spectrum acquisition method and system for optical determination of low temperature stress of elephant grass

    CN122775563A