Seed lotus variety identification method and system based on unmanned aerial vehicle image
By scaling the image, filter removing noise and background segmentation in the drone image acquisition, combined with the generation of feature parameters of grayscale symbiosis matrix, the problems of noise influence, background confusion and insufficient characteristics are solved, and more accurate and reliable seed lotus variety identification is achieved.
Patent Information
- Application Number
- CN202411929110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-22
AI Technical Summary
The prior art fails to effectively remove noise in drone image acquisition, resulting in blur or distortion of images, affecting the accuracy of feature extraction and recognition; at the same time, unsegmented background leads to confusion in feature extraction, affecting the accuracy of recognition results; too little feature extraction cannot fully capture image information, resulting in inaccurate recognition.
Through image scaling, filters to remove noise and grayscale processing, clear images are obtained; bilateral filters and entropy values are used to calculate the divided image as the lotus leaf part and the background part, and the lotus leaf part is extracted for feature extraction; the feature parameters of the grayscale symbiosis matrix are calculated to generate texture comparison, energy and rule indexes, which are used to identify seed lotus varieties.
Effectively remove noise, improve image clarity and feature extraction accuracy; reduce irrelevant information by segmenting the background, improve the distinction and expression ability of features; improve the accuracy and distinction of recognition results through rich feature parameters.
Smart Images

Figure CN119863722A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of seed lotus variety identification, and in particular to a seed lotus variety identification method and system based on unmanned aerial vehicle images. Background Art
[0002] Each type of lotus has its own special texture characteristics. Some lotus leaves have deep textures, while others have shallow textures. Some lotus leaves have rough textures, while others have fine textures. Some lotus leaves have evenly distributed textures, while others have messy textures. Each type of lotus has different texture characteristics, so the variety of lotus can be identified by analyzing the texture characteristics of the lotus leaves. For example, the texture of Indian water lilies: The leaves of Indian water lilies have deep and clear textures, rough veins, relatively neatly arranged veins, and evenly distributed textures. The leaves of Asian lotuses can have shallow and fuzzy textures, fine veins, and evenly distributed veins.
[0003] Different varieties of lotus leaves have unique texture features. These texture features include depth, thickness, uniformity, etc. Although these features may not be easy to identify with the naked eye, they can be quantified and converted into recognizable features through image processing. Modern digital photography technology can obtain high-resolution lotus leaf images. These high-resolution images contain more detailed information, which helps to identify and extract the texture features of the leaves. The development of image processing technology and feature extraction algorithms enables us to extract complex texture features from images. For example, algorithms such as gray-level co-occurrence matrix, local binary pattern, and directional gradient histogram can effectively describe the texture information in the image.
[0004] In the prior art, the publication number CN112989912A discloses a method for identifying oil tea fruit varieties based on drone images. By collecting flight altitude calculation rules and collecting images according to the rules, the image data is expanded by flipping, translating, cropping and brightness adjustment, etc., to build an oil tea fruit image data set and divide the data set into a training set and a test set. Secondly, the proposed oil tea fruit variety recognition model based on the bilinear attention network is trained with the training set images, and the best oil tea fruit variety recognition model is found through the test set. Next, for any input drone aerial photography oil tea fruit image, the bilinear EfficientNetB0 network is used to extract the oil tea fruit image features, and the extracted features are focused through the attention mechanism to determine the image feature-level area that should be focused on for oil tea fruit variety recognition; finally, the bilinear pooling is used to fuse the oil tea fruit image features extracted by the bilinear network to obtain the fused feature vector, and the fused feature vector is processed by the classifier to obtain the oil tea fruit variety recognition result. However, the existing technology has some shortcomings. First, the images collected by the drone are not subjected to noise removal processing. The noise will make the image blurred or distorted, reducing the clarity and quality of the image. When performing feature extraction and analysis, the noise may interfere with the real features in the image, resulting in inaccurate or unstable extracted features. When performing classification or recognition tasks, the noise may cause misclassification or missed recognition, reducing the accuracy and reliability of the algorithm.
[0005] Secondly, the existing technology extracts features without segmenting the background. The information in the background may be confused with the target features, so that irrelevant information is included in the feature extraction process, thereby affecting the accurate description of the target, so that the extracted features are distorted or biased, thereby affecting the accuracy and reliability of the features; resulting in inaccurate and unreliable recognition results;
[0006] Finally, the two features extracted are too few. The tea oil fruit image contains rich feature information. If too few features are extracted, this information may not be fully captured, resulting in information loss, making it impossible for the model to fully understand and describe the image, and it may even cause the inability to accurately distinguish different varieties, reducing the accuracy and discrimination of the variety recognition model.
[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0008] The object of the present invention is to provide a seed lotus variety identification method and system based on drone images to solve the problems raised in the above background technology.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] A seed lotus variety identification method based on drone images, the specific steps include:
[0011] Step 1: Obtain the original image of the seed lotus taken by the drone, scale the original image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain the first recognition image;
[0012] Step 2: Filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in the 256 gray levels to form a gray histogram, and calculate the entropy value of the image when the gray histogram is segmented at different gray levels, compare all possible entropy values, select the best segmentation threshold, divide the first recognition image into a lotus leaf part and a background part, and extract the lotus leaf part as the second recognition image;
[0013] Step 3: Perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract the characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference;
[0014] Step 4: Establish a texture contrast model through the gray-level co-occurrence matrix contrast and the average gray value to generate a texture contrast index; generate a texture energy model and a texture regularity model through the texture coverage, the gray-level co-occurrence matrix energy and the gray-level co-occurrence matrix inverse moment difference, and generate a texture energy index and a texture regularity index;
[0015] Step 5: Compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value respectively, analyze the comparison results comprehensively and identify the seed lotus variety.
[0016] Preferably, the coordinates of the pixels of the image after image scaling are marked, with the bottommost pixel row being the first row and the leftmost pixel column being the first column, so that each pixel has a unique coordinate value.
[0017] Preferably, the optimal segmentation threshold is selected based on the following specific logic:
[0018] Traverse all possible entropy values, divide the identified image into lotus leaf part and background part by entropy value, and calculate the corresponding entropy value according to the following formula:
[0019]
[0020] H(T) represents the entropy value of the image. p(i) represents the probability of each gray level i appearing in the statistical image, T represents the gray value when segmenting the image, p0 is the gray distribution of the lotus leaf area, p b Represents the grayscale distribution of the background area;
[0021] When the entropy value is the largest, the entropy value at this time is defined as the optimal segmentation threshold of the first recognition image.
[0022] Preferably, the specific logic of generating the gray level co-occurrence matrix is:
[0023] Take any point (x, y) of the second recognition image and name it as the reference point, and any point (x+a, y+b) that deviates from this point, where a and b are positive integers greater than zero, and name this point as the deviation point; the probability of the gray value of this point pair appearing is p(g1, g2). If the point (x, y) moves across the entire image, various p(g1, g2) values will be obtained, and there are 64 combinations of p(g1, g2). For the entire image, count the number of occurrences of each p(g1, g2) value, and then arrange them into a square matrix, which is called a gray-level co-occurrence matrix. The specific expression of the gray-level co-occurrence matrix is:
[0024]
[0025] P is the gray-level co-occurrence matrix, p ij It represents the probability of the occurrence of the i-th reference point and the j-th deviation point, i is the gray level of the reference point, and j is the gray level of the deviation point.
[0026] 6. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that:
[0027] The formula for calculating the gray level co-occurrence matrix characteristic parameters contrast, energy, and inverse moment difference is:
[0028]
[0029] ASM is the gray-level co-occurrence matrix energy, Con is the gray-level co-occurrence matrix contrast, IDM is the gray-level co-occurrence matrix inverse moment difference, and P(i, j) is the element in the i-th row and j-th column of the gray-level co-occurrence matrix, where i represents the number of rows in the gray-level co-occurrence matrix and j represents the number of columns in the gray-level co-occurrence matrix.
[0030] Preferably, the texture contrast index, texture energy index and texture regularity index are generated; the specific logic based on which is:
[0031]
[0032] represents the texture contrast index, Con represents the gray-level co-occurrence matrix contrast, represents the average gray value, represents the texture energy index, ASM represents the gray level co-occurrence matrix energy, B represents the texture coverage, represents the texture regularity index, and IDM represents the inverse moment difference of the gray-level co-occurrence matrix.
[0033] Preferably, the specific logic for determining the seed lotus variety is as follows:
[0034] When the texture contrast index Texture Energy Index Texture regularity index; Determine that the seed lotus species is Indian water lily;
[0035] Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus variety as Hualien;
[0036] Texture Contrast Index Texture Energy Index Texture regularity index; Determine that the seed lotus variety is Asian lotus;
[0037] Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus species as pink water lily;
[0038] in is the texture contrast index, is the texture contrast threshold; is the texture energy index, Texture energy threshold; is the texture regularity index, is the texture rule threshold.
[0039] In addition, the present invention also provides a seed lotus variety identification system based on drone images, which is used to implement the seed lotus variety identification method mentioned above, and specifically includes the following modules:
[0040] The image preprocessing module is used to obtain the seed lotus image taken by the drone, scale the seed lotus image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain a first recognition image;
[0041] The background segmentation module is used to filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a gray histogram, calculate the entropy value of the image when the gray histogram is segmented at different gray levels, compare all possible entropy values, select the best segmentation threshold, divide the first recognition image into a lotus leaf part and a background part, and extract the lotus leaf part as the second recognition image;
[0042] A feature extraction module is used to perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel points on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference;
[0043] The feature analysis module is used to establish a texture contrast model through the grayscale co-occurrence matrix contrast and the average grayscale value to generate a texture contrast index; the texture energy model and the texture rule model are generated through the texture coverage and the grayscale co-occurrence matrix energy and the grayscale co-occurrence matrix inverse moment difference to generate a texture energy index and a texture rule index;
[0044] The species identification module is used to compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value, comprehensively analyze the comparison results, and identify the seed lotus species.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] The present invention collects seed lotus images through drones. Noise may cover or blur features in the images. The present invention performs noise removal on the collected drone images. Noise removal can make the features in the images clearer and more prominent, and is helpful to more accurately identify and analyze targets in the images. When performing subsequent tasks such as image processing, feature extraction, and classification, noise removal can improve the accuracy and stability of the algorithm, thereby improving the effect of subsequent processing and reducing the error rate.
[0047] The present invention divides an image into a lotus leaf part and a background part by a threshold segmentation method, extracts the target lotus leaf part for feature extraction, and removes irrelevant information such as the background by accurately extracting the features of the target part. This makes the features more concentrated on the key attributes of the target, which is beneficial to improving the distinguishability and expression ability of the features.
[0048] The present invention extracts the texture coverage, average gray value, contrast, energy and inverse moment difference of the gray level co-occurrence matrix of the lotus leaf, which can more comprehensively describe and characterize the characteristics of the image, comprehensively reflect the properties of the lotus leaf and thus improve the accuracy of image classification. Because the feature quantity is rich enough, different target categories or image contents can be distinguished more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of the process of the seed lotus variety identification method of the present invention;
[0050] Figure 2 It is a structural schematic diagram of the seed lotus variety identification system in the present invention. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0052] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0053] Example:
[0054] See also Figure 1 , the present invention provides a technical solution:
[0055] A seed lotus variety identification method based on drone images, the specific steps include:
[0056] Step 1: Obtain the seed lotus image taken by the drone, scale the seed lotus image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain the first recognition image;
[0057] In this embodiment, adjusting the leaf image size to 224*224 means adjusting the width and height of the image to the same fixed size, i.e., 224 pixels. Adjusting the image to the same size can ensure that each image has the same size when using this method for inference recognition, which simplifies the inference process. Image resizing may introduce certain distortion or information loss. Adjusting the image to the common 224*224 size can avoid excessive distortion and retain important features in the image. The scaled image is subjected to denoising. The seed lotus images collected by the drone mainly include uniform noise, Gaussian noise, salt and pepper noise, and impulse noise. The bilateral filter is a filter that combines spatial distance and pixel value similarity. It can retain the edge information of the image while removing Gaussian noise or uniform noise. The operation steps of the bilateral filter are as follows:
[0058] 1. Define a sliding window centered on the target pixel.
[0059] 2. For each pixel within the window, calculate the spatial distance and the similarity between the pixel values.
[0060] 3. Update the target pixel value based on the similarity weighted average to retain the edge information of the image.
[0061] The bilateral filter is suitable for situations where it is necessary to retain the edge of the image while removing noise, especially when it is necessary to retain image details. Because it considers both the spatial distance of pixels and the similarity of pixel values, it can effectively retain the edge information of the image and remove noise.
[0062] The principle of the median filter is to update the target pixel value based on the median value of the pixels in the neighborhood. It is suitable for processing salt and pepper noise or impulse noise. These noises usually appear in the form of random bright or dark spots that are significantly different from the surrounding pixel values. The operation steps of the median filter are as follows:
[0063] 1. For each pixel, define a neighborhood (e.g. a 3x3 or 5x5 window).
[0064] 2. In each neighborhood, sort the pixel values by size and select the value in the middle as the new pixel value.
[0065] 3. Use the median value as the new pixel value to replace the original pixel value.
[0066] The median filter works well for salt and pepper noise and impulse noise because it is not affected by noise, can maintain the edge information of the image, and does not introduce additional blur.
[0067] Then, the coordinates of the pixels of the image after image scaling and denoising are marked, with the bottom pixel row as the first row and the leftmost pixel column as the first column, so that each pixel has a unique coordinate value.
[0068] In this embodiment, in order to facilitate the subsequent threshold segmentation and simplify the subsequent calculations, the seed lotus image collected by the drone is grayed. Graying is the process of converting a color image into a grayscale image, and the specific formula for making the values of the three components R (red), G (green), and B (blue) equal is:
[0069] Y=0.298*R+0.587*G+0.114*B
[0070] Wherein, Y is the gray value of the pixel in the first recognition image, and R, G, and B are the red component value, green component value, and blue component value of the pixel of the leaf image after image scaling, respectively.
[0071] Step 2: filtering the first recognition image using a bilateral filter, counting the frequency of pixels at each level in 256 gray levels to form a gray histogram, and calculating the entropy value of the image when the gray histogram is segmented at different gray levels, comparing all possible entropy values, selecting the best segmentation threshold, segmenting the lotus leaf part and the background part, and extracting the lotus leaf part as the second recognition image;
[0072] In this embodiment, the frequency p(i) of each gray level i in the image is counted, and the gray level T is used to segment the image. Objects with gray values lower than T constitute the lotus leaf part, and objects with gray values higher than T constitute the background part. The entropy value of the first recognition image is
[0073]
[0074] H(T) represents the dimensional entropy of the image. p(i) represents the probability of each gray level i appearing in the statistical image, T represents the gray value when segmenting the image, p0 is the gray distribution of the lotus leaf area, p b Represents the grayscale distribution of the background area; represents the gray distribution probability of the lotus leaf area, Represents the grayscale distribution probability of the background area.
[0075] Entropy is a measure of the amount of information or uncertainty in an image. When the entropy value is the largest, it means that the pixels in the image have the greatest degree of uncertainty or confusion. When the entropy value is the largest, the differences between the various parts of the image are the greatest, so it is easier to find the boundaries between different areas during segmentation; the entropy value at this time is defined as the optimal segmentation threshold for the first recognition image.
[0076] When segmenting into background part and lotus leaf part, if the gray value of the pixel point is less than or equal to T, it is judged that the pixel point belongs to the mesophyll part.
[0077] Step 3: Perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract the characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference;
[0078] In this embodiment, all possible inter-class variances are traversed, and the second recognition image is divided into a texture part and a leaf flesh part according to the value of each threshold. The number of pixels of the leaf flesh part and the texture part is counted, and the mean of the grayscale values of the pixels of the leaf flesh part and the texture part is calculated. The inter-class variance corresponding to the threshold is calculated according to the following formula:
[0079] σ(t) 2 =w B (t)*w F (t)*(μ B (t)-μ F (t)) 2
[0080] Among them, σ(t) 2 represents the inter-class variance when the threshold is t, t∈[0, 255], and t∈N + ,w B (t), w F (t) are the number of pixels in the leaf flesh part and the texture part when the threshold is t, μ B (t), μ F (t) are the mean grayscale values of the pixels in the mesophyll part and the texture part when the threshold is t;
[0081] The value when the inter-class variance reaches the maximum is calculated, and the value is defined as the optimal separation threshold of the second recognition image.
[0082] When segmenting into the mesophyll part and the texture part, if the grayscale value of the pixel point is less than or equal to t, the pixel point is judged to belong to the mesophyll part; if the grayscale value of the pixel point is greater than t, the pixel point is judged to belong to the texture part. The foreground part is the leaf part in this embodiment.
[0083] The grayscale level of a grayscale image is generally 256. When calculating the texture features derived from the grayscale co-occurrence matrix, the grayscale level of the image is required to be much smaller than 256, otherwise the calculation will become extremely complex and time-consuming; therefore, when calculating the spatial grayscale co-occurrence matrix, the grayscale level of the original image is often compressed to a smaller range without affecting the texture features, generally 8 or 16 levels, in order to reduce the size of the co-occurrence matrix. Grayscale gradation is the process of reducing the grayscale level of an image from 256 to a convenient level for calculation. The specific operation of grayscale gradation in this embodiment is: after dividing the grayscale value of each pixel by 32 and rounding it, the second recognition image of 256 grayscale levels can be transformed into a third recognition image of 8 grayscale levels.
[0084] Take any point (x, y) of the second recognition image and name it as the reference point, and any point (x+a, y+b) that deviates from this point, where a and b are positive integers greater than zero, and name this point as the deviation point; the probability of the gray value of this point pair appearing is p(g1, g2). If the point (x, y) moves across the entire image, various p(g1, g2) values will be obtained, and there are 64 combinations of p(g1, g2). For the entire image, count the number of occurrences of each p(g1, g2) value, and then arrange them into a square matrix, which is called a gray-level co-occurrence matrix. The specific expression of the gray-level co-occurrence matrix is:
[0085]
[0086] P is the gray-level co-occurrence matrix, p ij It represents the probability of the occurrence of the i-th level of the reference point and the j-th level of the deviation point, i is the gray level of the reference point, and j is the gray level of the deviation point. P is a method used to describe the texture characteristics of an image. It reflects the spatial relationship between the gray levels of different pixels in the image, that is, the frequency of a specific gray value pair between two pixels at a given direction and distance. It provides statistical information on the image texture and can be used to describe the details and structure of the image. By analyzing the gray level co-occurrence matrix P, the texture characteristics of the image, such as contrast, uniformity, and energy, can be extracted.
[0087] The formula for calculating the gray level co-occurrence matrix characteristic parameters contrast, energy, and inverse moment difference is:
[0088]
[0089] ASM is the gray-level co-occurrence matrix energy, Con is the gray-level co-occurrence matrix contrast, IDM is the gray-level co-occurrence matrix inverse moment difference, and P(i, j) is the element in the i-th row and j-th column of the gray-level co-occurrence matrix, where i represents the number of rows in the gray-level co-occurrence matrix and j represents the number of columns in the gray-level co-occurrence matrix.
[0090] Gray-level co-occurrence matrix contrast Con reflects the depth of the image texture grooves. The deeper the texture grooves, the greater the contrast and the deeper the grooves; conversely, the smaller the contrast, the shallower the grooves; the gray-level co-occurrence matrix energy ASM reflects the coarseness of the image texture relative to the texture itself; the smaller the ASM, the finer the image texture relative to the texture itself; conversely, the larger the ASM, the coarser the image texture relative to the texture itself; the gray-level co-occurrence matrix inverse moment difference IDM reflects the homogeneity of the image. The larger the IDM, the greater the local change of the image texture and the more irregular the local texture; conversely, the larger the IDM, the smaller the local change of the image texture and the more regular the local texture.
[0091] Step 4: Establish a texture contrast model through the gray-level co-occurrence matrix contrast and the average gray value to generate a texture contrast index; generate a texture energy model and a texture regularity model through the texture coverage, gray-level co-occurrence matrix energy, and gray-level co-occurrence matrix inverse moment difference, and generate a texture energy index and a texture regularity index.
[0092] The texture coverage is obtained by dividing the texture pixel points in the second recognition image by the total pixel points, and the average gray value is obtained by summing the gray values of the second recognition image and dividing it by the total number of pixels in the second recognition image. The texture contrast index, texture energy index, and texture regularity index are generated according to the texture coverage and the characteristic parameters of the grayscale co-occurrence matrix; the formula based on which is:
[0093]
[0094] represents the texture contrast index, Con represents the gray-level co-occurrence matrix contrast, represents the average gray value, represents the texture energy index, ASM represents the gray level co-occurrence matrix energy, represents the texture regularity index, and IDM represents the inverse moment difference of the gray-level co-occurrence matrix.
[0095] Texture Contrast Index Combining the contrast that reflects the depth of the graphic texture with the average gray value of the lotus leaf that reflects the clarity of the texture comprehensively reflects the clarity of the image and the depth of the texture grooves. The larger the texture, the deeper the grooves, and the clearer the visual effect; Texture Energy Index The energy reflecting the coarseness of the texture is combined with the texture coverage of the texture ratio to comprehensively reflect the coarseness of the image texture relative to the entire image; The smaller it is, the finer the texture image is relative to the entire image; otherwise The larger the value, the coarser the texture is relative to the entire image; Texture regularity index The inverse moment difference of the gray-level co-occurrence matrix IDM, which reflects the degree of texture regularity, is combined with the texture coverage B, which reflects the texture ratio, to comprehensively reflect the homogeneity of the image. The larger the IDM, the greater the image texture variation and the more uneven the texture distribution; conversely, the larger the IDM, the smaller the image texture variation and the more uniform the texture distribution.
[0096] Based on the texture contrast index, texture energy index, texture regularity index; and based on the characteristics of Indian water lily, Hualien, Asian lotus, and pink water lily, the seed lotus varieties can be comprehensively identified.
[0097] Step 5: Compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value respectively, analyze the comparison results comprehensively and identify the seed lotus variety.
[0098] In this embodiment,
[0099] The specific logic for identifying seed lotus varieties is as follows:
[0100] When the texture contrast index Texture Energy Index Texture regularity index; Determine that the seed lotus species is Indian water lily;
[0101] Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus variety as Hualien;
[0102] Texture Contrast Index Texture Energy Index Texture regularity index; Determine that the seed lotus variety is Asian lotus;
[0103] Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus species as pink water lily;
[0104] in is the texture contrast index, is the texture contrast threshold; is the texture energy index, Texture energy threshold; is the texture regularity index, is the texture rule threshold.
[0105] See also Figure 2 The present invention further provides a seed lotus variety system based on drone images, the system implementing the seed lotus variety identification method, including:
[0106] The image preprocessing module is used to obtain the seed lotus image taken by the drone, scale the seed lotus image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain a first recognition image;
[0107] The background segmentation module is used to filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a gray histogram, calculate the entropy value of the image when the gray histogram is segmented at different gray levels, compare all possible entropy values, select the best segmentation threshold, divide the first recognition image into a lotus leaf part and a background part, and extract the lotus leaf part as the second recognition image;
[0108] A feature extraction module is used to perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel points on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference;
[0109] The feature analysis module is used to establish a texture contrast model through the grayscale co-occurrence matrix contrast and the average grayscale value to generate a texture contrast index; the texture energy model and the texture rule model are generated through the texture coverage and the grayscale co-occurrence matrix energy and the grayscale co-occurrence matrix inverse moment difference to generate a texture energy index and a texture rule index;
[0110] The species identification module is used to compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value, comprehensively analyze the comparison results, and identify the seed lotus species.
[0111] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0112] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for identifying seed lotus varieties based on drone images, characterized in that: The specific steps include: Step 1: Obtain the original image of the seed lotus taken by the drone, scale the original image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain the first recognition image; Step 2: Filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in the 256 gray levels to form a gray histogram, and calculate the entropy value of the image when the gray histogram is segmented at different gray levels, compare all possible entropy values, select the best segmentation threshold, divide the first recognition image into a lotus leaf part and a background part, and extract the lotus leaf part as the second recognition image; Step 3: Perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract the characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference; Step 4: Establish a texture contrast model through the gray-level co-occurrence matrix contrast and the average gray value to generate a texture contrast index; generate a texture energy model and a texture regularity model through the texture coverage, the gray-level co-occurrence matrix energy and the gray-level co-occurrence matrix inverse moment difference, and generate a texture energy index and a texture regularity index; Step 5: Compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value respectively, analyze the comparison results comprehensively and identify the seed lotus variety.
2. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: The coordinates of the pixels of the scaled image are marked, with the bottom pixel row as the first row and the leftmost pixel column as the first column, so that each pixel has a unique coordinate value.
3. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: The specific logic for selecting the optimal segmentation threshold is as follows: Traverse all possible entropy values, divide the identified image into lotus leaf part and background part by entropy value, and calculate the corresponding entropy value according to the following formula: H(T) represents the entropy value of the image. p(i) represents the probability of each gray level i appearing in the statistical image, T represents the gray value when segmenting the image, p0 is the gray distribution of the lotus leaf area, p b Represents the grayscale distribution of the background area; When the entropy value is the largest, the entropy value at this time is defined as the optimal segmentation threshold of the first recognition image.
4. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: The specific logic of generating the gray-level co-occurrence matrix is: Take any point (x, y) of the second recognition image and name it as the reference point, and any point (x+a, y+b) that deviates from this point, where a and b are positive integers greater than zero, and name this point as the deviation point; the probability of the gray value of this point pair appearing is p(g1, g2). If the point (x, y) moves across the entire image, various p(g1, g2) values will be obtained, and there are 64 combinations of p(g1, g2). For the entire image, count the number of occurrences of each p(g1, g2) value, and then arrange them into a square matrix, which is called a gray-level co-occurrence matrix. The specific expression of the gray-level co-occurrence matrix is: P is the gray-level co-occurrence matrix, p ij It represents the probability of the occurrence of the i-th reference point and the j-th deviation point, i is the gray level of the reference point, and j is the gray level of the deviation point.
5. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: The formula for calculating the gray level co-occurrence matrix characteristic parameters contrast, energy, and inverse moment difference is: ASM is the gray-level co-occurrence matrix energy, Con is the gray-level co-occurrence matrix contrast, IDM is the gray-level co-occurrence matrix inverse moment difference, and P(i, j) is the element in the i-th row and j-th column of the gray-level co-occurrence matrix, where i represents the number of rows in the gray-level co-occurrence matrix and j represents the number of columns in the gray-level co-occurrence matrix.
6. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: Generate texture contrast index, texture energy index, and texture regularity index; the specific logic is as follows; represents the texture contrast index, Con represents the gray-level co-occurrence matrix contrast, represents the average gray value, represents the texture energy index, ASM represents the gray level co-occurrence matrix energy, B represents the texture coverage, represents the texture regularity index, and IDM represents the inverse moment difference of the gray-level co-occurrence matrix.
7. The method for identifying lotus varieties based on drone images according to claim 1, characterized in that: The specific logic for distinguishing seed lotus varieties is as follows: When the texture contrast index Texture Energy Index Texture regularity index; Determine that the seed lotus species is Indian water lily; Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus variety as Hualien; Texture Contrast Index Texture Energy Index Texture regularity index; Determine that the seed lotus variety is Asian lotus; Texture Contrast Index Texture Energy Index Texture regularity index; Determine the seed lotus species as pink water lily; in is the texture contrast index, is the texture contrast threshold; is the texture energy index, Texture energy threshold; is the texture regularity index, is the texture rule threshold.
8. A seed lotus variety identification system based on drone images, characterized by: The system is used to implement the seed lotus variety identification method according to any one of claims 1 to 7, comprising: The image preprocessing module is used to obtain the seed lotus image taken by the drone, scale the seed lotus image, adjust the image size to 224*224, use a filter to remove noise in the image, and then grayscale the image to obtain a first recognition image; The background segmentation module is used to filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a gray histogram, calculate the entropy value of the image when the gray histogram is segmented at different gray levels, compare all possible entropy values, select the best segmentation threshold, divide the first recognition image into a lotus leaf part and a background part, and extract the lotus leaf part as the second recognition image; A feature extraction module is used to perform threshold segmentation on the second recognition image again to divide the second recognition image into a texture part and a mesophyll part; divide the texture part pixels in the second recognition image by the total number of pixels to obtain a texture coverage rate, sum the grayscale values of the second recognition image and divide it by the total number of pixels in the second recognition image to obtain an average grayscale value, then perform grayscale polarization processing on the second recognition image to obtain a third recognition image with a grayscale level of 8, perform statistical operations on the probability of occurrence of each grayscale of the pixel points on the third recognition image to obtain a grayscale co-occurrence matrix, and calculate and extract characteristic parameters of the grayscale co-occurrence matrix, wherein the characteristic parameters include contrast, energy, and inverse moment difference; The feature analysis module is used to establish a texture contrast model through the grayscale co-occurrence matrix contrast and the average grayscale value to generate a texture contrast index; the texture energy model and the texture rule model are generated through the texture coverage and the grayscale co-occurrence matrix energy and the grayscale co-occurrence matrix inverse moment difference to generate a texture energy index and a texture rule index; The species identification module is used to compare the texture contrast index, texture energy index and texture regularity index with the preset texture contrast critical value, texture energy critical value and texture regularity critical value, comprehensively analyze the comparison results, and identify the seed lotus species.
Citation Information
Patent Citations
Camellia oleifera fruit variety identification method based on unmanned aerial vehicle image
CN112989912A
Plant blade image segmentation method based on Lab space and local area dynamic threshold
CN103473550A
Brain image segmentation method and system based on local similarity activity contour model
CN107633522A
Matrix analysis-based image texture extraction method
CN107833247A
Image threshold segmentation method and device based on fuzzy set and Otsu
CN108510499A