A mechanized suitability image enhancement analysis method for evaluating lodging resistance of rapeseed varieties
By separating the outline of rapeseed stalks and constructing a saliency scoring map, the problem of high-precision image processing of rapeseed variety lodging resistance in digital agriculture was solved, achieving clear representation of the stalk region and improving image quality.
Patent Information
- Application Number
- CN202511206455.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-08-27
AI Technical Summary
Existing technologies struggle to perform high-precision image processing on the lodging resistance of rapeseed varieties in digital agriculture, resulting in blurred target edges and broken local features, which limits the identification and analysis of crop details.
By calculating the intrinsic variation of pixels and the total variation between adjacent windows, the stem contour associated with rapeseed varieties is separated, a stem structure layer image is established, the main feature vector is extracted to construct the orientation guidance field, and the image is convolved using multi-scale Hessian matrix eigenvalue pairs to generate a stem saliency score map. The score value is then converted into a brightness gain coefficient to obtain an enhanced image for mechanization suitability assessment.
It improved the recognizability and image visualization quality of rapeseed stem areas, enhanced the expressiveness of lodging-related structures, and ensured the integrity of structural features and image resolution.
Smart Images

Figure CN121120467B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and in particular to a method for mechanization suitability image enhancement analysis to assess the lodging resistance of rapeseed varieties. Background Technology
[0002] Digital agriculture is a new agricultural model that uses information technology as its support, data on crop growth and diseases as its foundation, and technologies such as big data analysis, cloud computing, and artificial intelligence to achieve intelligent planting management.
[0003] Current technologies in digital agriculture applications primarily rely on the collection and analysis of data on crop growth and diseases. While these technologies can provide an overall picture of growth status and trends, their capabilities at the image level are significantly lacking. Data acquisition is mostly based on large-scale statistics or environmental perception, which struggles to produce high-precision images for tasks requiring local structural features, such as lodging. The lack of extraction of local pixel variations and spatial orientation information easily leads to blurred target edges and broken local features, limiting the identification and analysis of crop details. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a mechanization suitability image enhancement analysis method for evaluating the lodging resistance of rapeseed varieties.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a mechanization suitability image enhancement analysis method for evaluating the lodging resistance of rapeseed varieties, comprising the following steps:
[0006] Based on the input original rapeseed canopy image, the intrinsic variation of each pixel is calculated within a window of a preset size, and the total variation between adjacent windows is calculated to separate the stem contour associated with the rapeseed variety and establish a rapeseed stem structure layer image.
[0007] Based on the rapeseed stem structure layer image, a pixel-level structure tensor set is calculated. The main feature vector is extracted from the pixel-level structure tensor set to form a direction guiding field. The broken edges are connected and the residual texture is smoothed to generate a stem linear feature sharpening map.
[0008] Based on the stalk linear feature sharpening map, the image is convolved using Gaussian kernels with different standard deviations to obtain multi-scale Hessian matrix eigenvalue pairs. The multi-scale Hessian matrix eigenvalue pairs are substituted into a preset tubular structure response function to extract the maximum response value in all scales and construct a stalk saliency score map.
[0009] Based on the stalk saliency rating map, the rating value of each pixel in the map is converted into a brightness gain coefficient to obtain an enhanced image for mechanization suitability assessment.
[0010] Preferably, the step of acquiring the rapeseed stem structure layer image is as follows:
[0011] Based on the original rapeseed canopy image, the grayscale difference in the horizontal and vertical directions is performed point by point within a pixel window of a preset size. The sum of squared differences is calculated and accumulated within the window. At the same time, the total variation value corresponding to the k adjacent windows of the pixel is recorded simultaneously to obtain the total variation set of the window.
[0012] Calculate the pixel ratio index based on the total variation set of the window;
[0013] Based on the pixel ratio index, a threshold determination is performed to distinguish between low-ratio pixels and high-ratio pixels. Low-ratio pixels are classified as structures and high-ratio pixels are classified as textures. Continuous regions are formed by connecting the structural pixels point by point along the boundary of the connected pixels and separating the stem outline associated with the rapeseed variety, thereby generating a rapeseed stem structure layer image.
[0014] Preferably, the step of obtaining the pixel-level structure tensor set is as follows:
[0015] Based on the rapeseed stem structure layer image, gradient difference is performed on each pixel in the horizontal and vertical directions. The gradient difference results are combined to form a two-dimensional matrix representing the local gray-level changes. The two-dimensional matrices of all pixel positions are arranged sequentially to obtain a pixel-level structure tensor set.
[0016] Preferably, the step of obtaining the stalk linear feature sharpening map is as follows:
[0017] Based on the pixel-level structure tensor set, feature decomposition is performed on each two-dimensional matrix, and the corresponding principal feature vector is extracted as a direction reference. The principal feature vectors of all pixel positions are spatially concatenated to obtain the direction guidance field.
[0018] Based on the directional guiding field, diffusion is performed in the direction indicated by the principal feature vector to extend discontinuous edges, and diffusion is performed in the direction perpendicular to the principal feature vector to eliminate irregular textures. The broken areas are reconnected and the residual fragmented structures are smoothed to generate a stem linear feature sharpening map.
[0019] Preferably, the step of obtaining the eigenvalue pairs of the multi-scale Hessian matrix is as follows:
[0020] Based on the stalk linear feature sharpening map, multiple sets of Gaussian kernel parameters are set for each pixel position. The stalk linear feature sharpening map is convolved under each set of Gaussian kernel parameters. The convolution results are recorded pixel by pixel and stored in scale order to obtain a multi-scale convolution result map.
[0021] Based on the multi-scale convolution result image, the second-order partial derivative is calculated pixel by pixel in the convolution result of each scale to construct the Hessian matrix at each pixel position, and the corresponding two feature values are extracted. The feature values of each pixel are combined in scale order to obtain the multi-scale Hessian matrix feature value pairs.
[0022] Preferably, the steps for obtaining the stem salience score map are as follows:
[0023] Based on the eigenvalue pairs of the multi-scale Hessian matrix, the eigenvalue pairs of each pixel at all scales are sequentially substituted into the preset tubular structure response function to extract the maximum response value of each pixel. The maximum response value is then mapped to the original pixel position to generate a stalk saliency score map.
[0024] Preferably, the step of acquiring the enhanced image for the mechanization suitability assessment is as follows:
[0025] According to the stalk saliency scoring map, the scoring value is read pixel by pixel, truncated according to the preset upper and lower limits and linearly scaled to 0 to 1, and backfilled to the original grid position according to the row index and column index. Invalid pixels are replaced with the median of the four neighborhoods and the boundary pixels are kept unrewritten to obtain the stalk saliency scoring matrix.
[0026] The brightness gain coefficient is calculated based on the stalk saliency score matrix.
[0027] Preferably, the step of acquiring the enhanced image for the mechanization suitability assessment further includes:
[0028] Based on the brightness gain coefficient, each brightness gain coefficient is multiplied by the enhancement intensity control parameter and then added to 1 to obtain the pixel gain. The pixel value of the corresponding grid position of the original rapeseed canopy image is multiplied by the pixel gain item by item and written into the output channel to generate the mechanization suitability assessment enhancement image.
[0029] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0030] This invention distinguishes structure and texture in an image by calculating the intrinsic variation of pixels within a window of a preset size and combining it with the total variation between adjacent windows. This allows for the separation of the stem outline associated with rapeseed varieties and the construction of a clear structural layer image, reducing background texture interference and improving the recognizability of the target area. Furthermore, by calculating the matrix of local gray-level changes pixel by pixel and extracting the principal feature vector to construct a directional guidance field, it further connects broken edges and eliminates residual textures, obtaining more coherent linear features of the stem. This ensures the integrity of subsequent structural extension and boundary tracking. By using multi-scale Gaussian kernels to convolve the sharpened image, it is possible to extract Hessian matrix feature pairs at different scales and obtain the maximum response value at each scale, making the image more spatially resolvable. Finally, the saliency score is mapped to a brightness gain coefficient and superimposed on the original image pixels, achieving the effect of highlighting the stem area while preserving structural features. This enhances the expressiveness of lodging-related structures and improves the overall image visualization quality. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the steps of the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0033] Please see Figure 1 This invention provides a technical solution: a method for image enhancement analysis of the mechanization suitability of rapeseed varieties to assess their lodging resistance, comprising the following steps:
[0034] Based on the input original rapeseed canopy image, the intrinsic variation of each pixel is calculated within a window of a preset size, and the total variation between adjacent windows is calculated to separate the stem contour associated with the rapeseed variety and establish a rapeseed stem structure layer image.
[0035] Based on the rapeseed stem structure layer image, a pixel-level structure tensor set is calculated. The main feature vector is extracted from the pixel-level structure tensor set to form a direction guiding field. The broken edges are connected and the residual texture is smoothed to generate a stem linear feature sharpening map.
[0036] Based on the stalk linear feature sharpening map, the image is convolved using Gaussian kernels with different standard deviations to obtain multi-scale Hessian matrix eigenvalue pairs. The multi-scale Hessian matrix eigenvalue pairs are substituted into the preset tubular structure response function to extract the maximum response value in all scales and construct a stalk saliency score map.
[0037] Based on the saliency score map, the score value of each pixel in the map is converted into a brightness gain coefficient to obtain an enhanced image for mechanization suitability assessment.
[0038] The steps for obtaining the rapeseed stem structure layer image are as follows:
[0039] Based on the original rapeseed canopy image, the grayscale difference in the horizontal and vertical directions is performed point by point within a pixel window of a preset size. The sum of squared differences is calculated and accumulated within the window. At the same time, the total variation value corresponding to the k adjacent windows of the pixel is recorded simultaneously to obtain the total variation set of the window.
[0040] The pixel ratio index is calculated based on the total variation set of the window. The calculation formula is as follows:
[0041]
[0042] Among them, J(W p ) represents the total variation of the window for pixel p. Let p be the average of the total variation of the neighboring windows of pixel p. Let be the standard deviation of the total variation of pixel p in its neighboring windows, α be the adjustment constant for the neighborhood standard deviation, ε be the minimum positive constant to avoid a zero denominator, k be the number of neighboring windows, and W be the standard deviation of the neighboring windows. p,c Let R′ be the c-th neighboring window of pixel p. p This is a ratio indicator for pixels p;
[0043] Based on the pixel ratio index, a threshold is determined to distinguish between low-ratio pixels and high-ratio pixels. Low-ratio pixels are classified as structures and high-ratio pixels are classified as textures. Continuous regions are formed by connecting the structural pixels point by point along the boundary of the connected pixels, and the stem outline associated with the rapeseed variety is separated to generate a rapeseed stem structure layer image.
[0044] Specifically, based on the original rapeseed canopy image, the input image is first uniformly converted to an 8-bit grayscale image. The conversion uses a weighted average method, specifically calculated as follows:
[0045] The grayscale value is calculated as 0.299×R + 0.587×G + 0.114×B. A 5×5 pixel sliding window is then set; this size strikes a balance between local detail and computational efficiency. Starting from the top-left pixel, the entire image is traversed pixel by pixel. For each window W centered at pixel p... p Calculate its internal total variation J(W) pThe calculation process involves summing the squares of the horizontal gradient I(i,j+1)-I(i,j) and the vertical gradient I(i+1,j)-I(i,j) for each pixel (i,j) within the window. This sum of squares is then accumulated across all pixels within the window to obtain the total variation value of the current window. This value reflects the texture complexity and edge strength within the window. Simultaneously, the total variation values of the k neighboring windows are also obtained. Here, k is set to 8, corresponding to the eight adjacent windows in the top, bottom, left, right, top-left, top-right, bottom-left, and bottom-right directions. The same total variation calculation process is performed on each of these eight adjacent windows to obtain a set containing eight total variation values. The total variation value J(W) of the current pixel p is then calculated. p ) and the total variation set of its 8 adjacent windows {J(W p,1 ),J(W p,2 ),...,J(W p,8 Each pixel in the image is stored as a data unit. As the sliding window traverses the entire image, such a data unit is eventually generated for each pixel in the image. All these data units are collected together to obtain the total variation set of the window.
[0046] formula: The above formula quantifies and distinguishes between textured and structural regions in an image by constructing a pixel ratio index. The design idea is that textured regions (such as leaves) are characterized by drastic changes in internal grayscale, but this change pattern is relatively uniform within the local neighborhood, expressed as the total variation J(W) of the window. p ) and neighborhood average total variation μ J (p) are all relatively high, but the standard deviation σ of the total variation in the neighborhood is relatively high. J (p) is low, while structural regions (such as stem edges) are characterized by concentrated gray-scale variations at the edges, resulting in a significant difference in the total variation of the window compared to the surrounding flat regions, manifested as a higher σ. J (p), the numerator of this formula utilizes J(W) p ) and the logarithmic term ln(1+μ J (p)+σ J The product of (p) amplifies the response in the highly variable region, while the denominator controls the response to the neighborhood variability σ by adjusting the constant α. J The sensitivity of (p) makes when σ J (p) When the value is large (in the structural region), the denominator increases significantly, thereby lowering the overall ratio R′. p Conversely, when σ J (p) When the value is small (in the textured area), the denominator is relatively small, maintaining a high ratio R′. p .
[0047] Formula parameter description:
[0048] J(W p ) is the total variation of the window for pixel p. This value is directly extracted from the set of total variation of the window generated in the previous step. It quantifies the total gray-level change of the image within a 5×5 window centered on pixel p. It is the core basis for determining whether the local area is a smooth area, a textured area or an edge area. It is calculated by accumulating the sum of the squares of the horizontal and vertical gray-level differences of all pixels in the window.
[0049] μ J (p) is the average of the total variation of the neighboring windows of pixel p. This value is calculated based on the total variation values of the k neighboring windows of pixel p recorded in the window total variation set. The calculation formula is as follows:
[0050] It reflects the average texture or structural intensity of the area surrounding pixel p, providing a background reference for determining whether the variation of the current window is abnormal.
[0051] σ J (p) represents the standard deviation of the total variation of the neighboring windows of pixel p. This value is also calculated based on the total variation values of the k neighboring windows recorded in the window total variation set. The calculation formula is as follows:
[0052] It measures the consistency of texture or structural intensity in the region surrounding pixel p and is a key parameter for distinguishing uniform textures from structural boundaries. A high standard deviation indicates significant heterogeneity in local regions.
[0053] α is an adjustment constant for the neighborhood standard deviation. This parameter is used to adjust the sensitivity of the pixel ratio index to neighborhood variability. A sample image set containing 100 manually segmented rapeseed stalks is selected. The search range of α is set to [0.5, 2.5] with a step size of 0.1. For each candidate value of α, the R′ of all sample images is calculated. p The graph is shown, and the Otsu algorithm is applied to obtain an optimal segmentation threshold, which is then used to segment R′. p The figure shows the stalk prediction results. By comparing the prediction results with the manually segmented ground truth, the Dice similarity coefficient is calculated. Finally, the α value that gives the highest average Dice similarity coefficient for the entire sample set is selected. After this optimization process, the value of α is determined to be 1.8.
[0054] ε is a very small positive constant, set to 1×10. -7 .
[0055] k is the number of neighboring windows. This parameter defines the range considered when calculating neighborhood statistics. Setting it to 8 represents all other windows in a 3x3 area centered on the current window except for the central window, i.e., the Moore neighborhood. This is a neighborhood definition commonly used in image processing that can fully capture information about the surrounding environment.
[0056] W p,c Let c be the c-th neighboring window of pixel p.
[0057] Calculations based on parameters:
[0058] From the total window variation set obtained in the preceding steps, extract the relevant data of a certain pixel p, whose total window variation J(W) p The total variation values of the k=8 adjacent windows are {2100, 2350, 2400, 3800, 4100, 2800, 1900, 2250}.
[0059] Calculate the average value μ of the total variation of adjacent windows. J (p):
[0060]
[0061] Calculate the standard deviation σ of the total variation of adjacent windows. J (p):
[0062]
[0063] Substituting the preset parameter values: α = 1.8, ε = 1 × 10 -7 .
[0064] Calculate the pixel ratio index R′ p :
[0065]
[0066] This result indicates that the ratio index R′ of pixel p p The calculated result is 6.2198. This value represents the quantitative score of the pixel belonging to the texture region. In subsequent processing, it will be compared with a global threshold to finally determine its category. For example, if the optimal segmentation threshold for the entire image calculated by the Otsu algorithm is 7.5, then since 6.2198 is less than 7.5, the pixel will be classified as a low ratio pixel, i.e., a structure pixel. Conversely, if the calculated result is greater than 7.5, it will be classified as a high ratio pixel, i.e., a texture pixel. By performing this calculation on each pixel in the image, a complete pixel ratio index map is finally generated.
[0067] Based on the pixel ratio index map covering the entire image generated in the previous step, an automatic thresholding process is performed to distinguish low-ratio pixels representing stem structure from high-ratio pixels representing background textures such as leaves. This process uses the Otsu algorithm. First, all pixel values in the entire pixel ratio index map are statistically analyzed to generate a grayscale histogram. Then, the algorithm iterates through all possible ratios as candidate thresholds, dividing pixels into foreground and background groups based on whether they are greater than the candidate threshold. For each candidate threshold, the intra-class variance of the foreground group and the inter-class variance between the two groups are calculated. The goal of the algorithm is to find a threshold that maximizes the inter-class variance. This threshold is considered the optimal segmentation point for distinguishing structure and texture. For example, the optimal segmentation threshold obtained after calculation is 7.5. Subsequently, each pixel in the pixel ratio index map is iterated. If its ratio is less than 7.5, it is marked as 1 (representing structure) at the corresponding position in the newly generated binary image. If it is greater than or equal to 7.5, it is marked as 0 (representing texture). After the initial segmentation, the resulting binary image may contain noise. To optimize the segmentation results, morphological closing operations are applied to isolated structural pixels or small holes within structural regions. Specifically, a 3×3 cross-shaped structuring element is first used to dilate the binary image, filling in the tiny holes inside the stem outline and connecting adjacent broken parts. Then, the same structuring element is used to erode the stem, restoring its original approximate width and eliminating the small edge burrs introduced by the dilation. After morphological processing, connected component analysis is performed on the image, assigning a unique label to each independent white region (structural region). Then, the geometric features of each connected component are calculated, including area (total number of pixels) and aspect ratio. By analyzing a large number of rapeseed sample images, screening criteria are set. For example, components with an area less than 150 pixels are considered noise and are removed. At the same time, components with an aspect ratio less than 4.0 are considered to lack the slender morphological features of the stem and are also removed. Only connected components that meet both area and aspect ratio requirements are retained. The set of these retained connected components constitutes the final rapeseed stem structural layer image.
[0068] The steps to obtain the pixel-level structure tensor set are as follows:
[0069] Based on the rapeseed stem structure layer image, gradient difference is performed on each pixel in the horizontal and vertical directions. The gradient difference results are combined to form a two-dimensional matrix to represent the local gray-level changes. The two-dimensional matrices of all pixel positions are arranged sequentially to obtain the pixel-level structure tensor set.
[0070] Specifically, based on the rapeseed stem structure layer image, to calculate the local gray-level change of each pixel, a Gaussian smoothing filter is first applied to the image, and a 3×3 Gaussian kernel with a standard deviation of 0.5 is used for convolution to slightly suppress high-frequency noise in the image. Subsequently, for each pixel (i,j) of the smoothed image, a 3×3 Sobel operator is used to calculate its horizontal gradient I. x (i,j) and vertical gradient I y Next, to construct the structure tensor describing the local structural information, the gradient information needs to be integrated within a local neighborhood. Here, a 5×5 integration window is set, and a Gaussian kernel with a standard deviation of 1.5 is applied as the weight function w. For all pixels (u,v) within the 5×5 neighborhood centered at pixel (i,j), three integration components are calculated, namely J... xx =∑w(u,v)I x (u,v) 2 J yy =∑w(u,v)I y (u,v) 2 , and J xy =∑w(u,v)I x (u,v)I y The three components (u, v) combine to form a 2×2 symmetric matrix, which is the structure tensor of the pixel (i, j). The matrix captures the magnitude and direction of grayscale changes in the neighborhood of the point. The above calculation process is repeated for each pixel in the rapeseed stem structure layer image, generating a corresponding 2×2 structure tensor matrix for each pixel position. All these matrices are arranged according to their spatial positions in the original image to form a matrix field of the same size as the original image, resulting in a pixel-level structure tensor set.
[0071] The steps for obtaining the stalk linear feature sharpening map are as follows:
[0072] Based on the pixel-level structure tensor set, feature decomposition is performed on each two-dimensional matrix, and the corresponding principal feature vector is extracted as a direction reference. The principal feature vectors of all pixel positions are spatially concatenated to obtain the direction guidance field.
[0073] Based on the directional guiding field, diffusion is performed in the direction indicated by the principal feature vector to extend discontinuous edges, and diffusion is performed in the direction perpendicular to the principal feature vector to eliminate irregular textures. The broken areas are reconnected and the residual fragmented structures are smoothed to generate a stem linear feature sharpening map.
[0074] Specifically, based on the pixel-level structure tensor set obtained in the previous step, eigenvalue decomposition is performed on the 2×2 structure tensor matrix T at each pixel location. For each matrix... Calculate its two eigenvalues λ1 and λ2, and the corresponding two orthogonal eigenvectors v1 and v2. The eigenvalues are calculated by solving the characteristic equation. We obtain that the eigenvector v1 corresponding to the larger eigenvalue λ1 points to the gradient direction, i.e., the direction of the fastest grayscale change, while the eigenvector v2 corresponding to the smaller eigenvalue λ2 points to the direction perpendicular to the gradient, i.e., along the direction of the equal grayscale line. In the linear structure of rapeseed stalks, this direction is the local orientation of the stalk. Therefore, we choose the eigenvector v2 associated with the smaller eigenvalue λ2 as the orientation reference for this pixel, because it represents the local orientation of the stalk structure. We perform this eigenvalue decomposition and eigenvector selection operation on each structural tensor matrix in the pixel-level structural tensor set to calculate a two-dimensional orientation vector for each pixel in the image. Finally, we create a data structure with the same size as the original image to store these orientation vectors. The orientation reference vector v2 calculated for each pixel position (i,j) is stored in the corresponding position (i,j) of this data structure. The set of all these orientation vectors in two-dimensional space is concatenated to obtain the orientation guidance field.
[0075] Based on the established directional guidance field, using an image of the rapeseed stem structure layer as the initial input, and controlling the diffusion process using the directional guidance field, the iteration count is set to 30. In each iteration, the gray value of each pixel (i,j) in the image is updated based on the gray values of its neighboring pixels and the local diffusion behavior defined by the directional guidance field. Specifically, a diffusion tensor D is constructed, which is determined by the feature vectors in the directional guidance field. The diffusion tensor defines the intensity and direction of the diffusion, and its principal axis is aligned with the vector of the directional guidance field. That is, a large diffusion coefficient, such as 1.0, is set along the feature vector v2 direction along the stem direction, while a very small diffusion coefficient, such as 0.01, is set along the feature vector v1 direction perpendicular to it. This means that when updating the pixel value in each iteration, the information ( The grayscale values mainly flow along the direction indicated by the stalk, with almost no diffusion in the vertical direction. This controlled diffusion process allows pixels located at the stalk break to receive information from their neighboring pixels along the stalk direction, gradually filling the gaps and reconnecting the broken areas. At the same time, because vertical diffusion is suppressed, the edges of the stalk are not blurred, but become clearer as the internal grayscale values tend to be consistent. For residual noise-induced fine structures or non-stalk textures in the image, because they lack a consistent linear direction, the diffusion process is isotropic in these areas and is smoothed to eliminate these interferences. After completing all 30 iterations, the stalk contour in the image becomes continuous, complete, and internally smooth, resulting in a stalk linear feature sharpening map.
[0076] The steps for obtaining eigenvalue pairs of a multi-scale Hessian matrix are as follows:
[0077] Based on the stalk linear feature sharpening map, multiple sets of Gaussian kernel parameters are set for each pixel position. The stalk linear feature sharpening map is convolved under each set of Gaussian kernel parameters. The convolution results are recorded pixel by pixel and stored in scale order to obtain a multi-scale convolution result map.
[0078] Based on the multi-scale convolution result image, the second-order partial derivative is calculated pixel by pixel in the convolution result of each scale to construct the Hessian matrix at each pixel position, and the corresponding two feature values are extracted. The feature values of each pixel are combined in scale order to obtain the feature value pairs of the multi-scale Hessian matrix.
[0079] Specifically, based on the stem linear feature sharpening map, a set of Gaussian kernel parameters for multi-scale analysis is first defined. This set of parameters consists of a series of increasing standard deviations σ, used to match rapeseed stems of different thicknesses. Specifically, based on prior analysis of a large number of rapeseed canopy images, the pixel width of rapeseed stems is determined to be roughly distributed between 2 and 8 pixels. Therefore, a standard deviation sequence covering this range is selected, with the initial standard deviation set to 1.0, the ending standard deviation to 4.0, and the step size to 0.5, resulting in a set containing 7 scale values: {1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0}. For each of these 7 scale values σ... i Each generates a corresponding two-dimensional Gaussian kernel, the size of which is based on 6σ. i The principle is to determine and round up to the nearest odd number, for example, when σ i When σ = 2.0, the kernel size is (6 × 2.0) + 1 = 13, or 13 × 13. Subsequently, for each scale σ i The generated Gaussian kernel is then convolved with the entire stem linear feature sharpening map in a 2D manner. This operation iterates through each pixel in the image, replacing its value with a weighted average of the values of its neighboring pixels centered at that pixel. The weights are determined by the Gaussian kernel's value within that neighborhood. This process is repeated once for each scale, producing seven convolved and smoothed images of the same size as the original image. These seven images are then sorted according to their corresponding standard deviation σ. i The images are stacked or organized into a three-dimensional data matrix in ascending order, where the first two dimensions are the spatial coordinates of the image and the third dimension is the scale index, resulting in a multi-scale convolutional image.
[0080] Based on the multi-scale convolution result images generated in the previous step, each image representing a specific scale is processed. The processing begins with the convolution result image corresponding to scale σ = 1.0, traversing each pixel (x, y) in the image, and using the central difference method to approximate the second-order partial derivative at that point. Specifically, the second-order partial derivative L in the horizontal direction is calculated. xxThe second-order partial derivative L in the vertical direction is obtained by calculating L(x+1,y)-2L(x,y)+L(x-1,y). yy The cross partial derivative L is obtained by calculating L(x,y+1)-2L(x,y)+L(x,y-1). xy This is obtained by calculating (L(x+1,y+1)-L(x-1,y+1)-L(x+1,y-1)+L(x-1,y-1)) / 4, where L(x,y) is the grayscale value of the current pixel. After obtaining these three partial derivative values, they are combined into a 2×2 Hessian matrix. Next, the Hessian matrix is decomposed into eigenvalues, yielding two eigenvalues λ1 and λ2. These eigenvalues are then sorted by their absolute values, such that |λ1| ≤ |λ2|. This process is repeated for all pixels in the current scale of the image, generating a Hessian matrix and its eigenvalue pair for each pixel. The processing is then advanced to the next scale, the convolution result image with σ = 1.5, and the exact same calculation steps are repeated until all seven scales of the image have been processed. Finally, for any pixel location (x, y) in the image, a sequence of seven eigenvalue pairs is obtained, each eigenvalue pair... Corresponding to an analytical scale σ i By combining the sequence of eigenvalue pairs of all pixels, we obtain the eigenvalue pairs of the multi-scale Hessian matrix.
[0081] The steps for obtaining the stalk significance score map are as follows:
[0082] Based on the eigenvalue pairs of the multi-scale Hessian matrix, the eigenvalue pairs of each pixel at all scales are sequentially substituted into the preset tubular structure response function to extract the maximum response value of each pixel. The maximum response value is then mapped to the original pixel position to generate a stalk saliency score map.
[0083] Specifically, based on the obtained multi-scale Hessian matrix eigenvalue pairs, the tubular structure response value is calculated for each pixel in the image. This process requires a pre-defined tubular structure response function. The design of this function is based on the second derivative characteristics of an ideal tubular structure (such as a rapeseed stalk) in the image. That is, the second derivative along the stalk direction is close to zero (corresponding to eigenvalue λ1≈0), while the absolute value of the second derivative perpendicular to the stalk direction is very large (corresponding to a large absolute value of eigenvalue λ2). The response function used here is: in, Used to measure the flatness of a structure To measure the strength of the structure, parameters β and c are used to adjust the sensitivity of the function to these two metrics. The value of β is selected by testing 50 image patches containing typical stalk and non-stalk structures, choosing the value that best distinguishes between the two, and is finally set to 0.5. Parameter c is set to half the maximum value of the S-value calculated for all pixels at all scales. This is an adaptive normalization parameter. It iterates through each pixel (x, y) in the image, extracting its corresponding sequence of feature values at 7 scales, and then assigning σ to each scale. i eigenvalue pairs Substituting into the above response function, a response value V(σ) is calculated. i This process yields a sequence of 7 response values for each pixel. The largest response value from this sequence is then selected as the final saliency score for that pixel. This maximum value indicates the degree of similarity between the pixel and the tubular structure at the most suitable scale. Finally, a blank image of the same size as the original image is created, and the final score value Score(x,y) calculated for each pixel (x,y) is assigned to the pixel intensity at the corresponding position in the new image to generate a stalk saliency score map.
[0084] The steps for obtaining enhanced images for mechanization suitability assessment are as follows:
[0085] Based on the stalk saliency scoring map, the scoring values are read pixel by pixel, truncated according to preset upper and lower limits, and linearly scaled to 0 to 1. The values are then backfilled to the original grid positions according to the row index and column index. Invalid pixels are replaced with the median of the four neighborhoods while keeping the boundary pixels unchanged, thus obtaining the stalk saliency scoring matrix.
[0086] Based on the stalk saliency scoring matrix, the brightness gain coefficient is calculated using the following formula:
[0087]
[0088] Where, q i,j Let g′ be the score value at row index i and column index j in the stalk significance scoring matrix. i,j σ is the brightness gain coefficient at row index i and column index j. q (i,j) represents the standard deviation of the score values in a fixed neighborhood centered at row index i and column index j, β is the slope parameter, θ is the center parameter, γ is the local variation sensitivity parameter, i is the row index, and j is the column index;
[0089] Based on the brightness gain coefficient, each brightness gain coefficient is multiplied by the enhancement intensity control parameter and then added to 1 to obtain the pixel gain. The pixel value of the corresponding grid position of the original rapeseed canopy image is multiplied by the pixel gain item by item and written into the output channel to generate the enhanced image for mechanization suitability assessment.
[0090] Specifically, based on the stalk significance rating map, we first iterate through all pixels in the map, statistically analyze the distribution of all rating values, and determine an effective rating range. Specifically, we calculate the 1st and 99th percentiles of all rating values and set these two values as the lower cutoff limit S. min and upper limit S max For example, after statistical analysis, the lower limit is found to be 0.05 and the upper limit to be 0.95. Then, the score value S is read pixel by pixel again. For each score value, a truncation rule is applied, that is, if S min Then set its value to S. min If S>S max Then set its value to S. max For values between these two values, the values remain unchanged. Then, the truncated scores are linearly scaled to map them to the interval between 0 and 1, using the scaling formula q = (S... ′ -S min ) / (S max -S min ), where S ′ The truncated score is q, and the normalized score is q. The calculated new score q is filled into a new two-dimensional array of the same size as the original image based on its original row and column indices. During the filling process, invalid pixels caused by image processing boundary effects or previous calculation errors are processed. Invalid pixels are defined as points with a score of 0 or null. For each pixel identified as invalid (except for pixels on the image boundary), the score values of its four adjacent pixels above, below, left, and right are checked. The score values of all valid neighbors are collected, the median of these values is calculated, and the median is assigned to the current invalid pixel. If all four neighbors of an invalid pixel are also invalid, the search range is expanded to eight neighbors until a valid neighbor is found or the preset maximum search radius (e.g., 3 pixels) is reached. After replacing all invalid pixels, the stalk saliency score matrix is obtained.
[0091] formula: The above formula constructs an adaptive brightness gain model, the core of which is a modified sigmoid function used to smoothly map the stem saliency score to the brightness gain coefficient. By introducing local variability as a regulating factor, traditional image enhancement methods typically use fixed transformation functions, which may lead to artifacts or over-enhancement in areas with complex textures (such as leaf edges). This formula addresses this by introducing a term... To dynamically adjust the slope of the sigmoid function, when the neighborhood score value of a pixel changes drastically (i.e., σ... q When (i,j) is large (indicating noise or complex textures), a smaller value for this term flattens the Sigmoid curve, thus weakening the enhancement effect. Conversely, in regions where the score changes gradually (i.e., σ), a larger value results in a smoother Sigmoid curve.q (i,j) is relatively small, such as the stem body), and the value of this term is close to 1, maintaining a relatively steep curve, which effectively enhances the stem region. This design allows the brightness gain to be adaptively adjusted according to the complexity of the local image content, effectively suppressing the amplification of background noise while highlighting the stem.
[0092] Formula parameter description:
[0093] q i,j This is the score value of the stalk saliency scoring matrix at row index i and column index j. This value is calculated in the previous step and ranges from 0 to 1. It directly reflects the probability that pixel (i,j) belongs to the rapeseed stalk structure and is the basic input for calculating the brightness gain.
[0094] σ q (i,j) represents the standard deviation of the rating values within a fixed neighborhood centered at row index i and column index j. This parameter quantifies the variation in rating values within a local region. The neighborhood size is fixed at 7×7 pixels. For each pixel (i,j), 49 rating values are extracted from its 7×7 neighborhood, and the standard deviation of these 49 values is calculated to obtain σ. q (i,j), this value serves as a measure of local complexity and is used to adaptively adjust the enhancement strength.
[0095] β is the slope parameter, which controls the maximum steepness of the Sigmoid function near the center point, i.e. the basic contrast enhancement intensity. Its value was determined by testing a sample set of 30 rapeseed canopy images with different lighting and growth stages. The search was conducted in the range of [10,30] with a step size of 1. Three agricultural image analysis experts performed double-blind scoring on the enhancement results for each parameter value (1-5 points, with 5 points being the best). The β value with the highest average score was selected, and the final value of β was determined to be 20.
[0096] θ is the central parameter, which defines the central transition point of the sigmoid function. When the score value equals θ, the brightness gain is approximately halved. It acts as a threshold, determining which score values begin to be enhanced. Its setting is based on the overall statistical characteristics of the stem saliency score matrix. Specifically, the calculation process involves calculating the histogram of all score values in the entire stem saliency score matrix and setting the value of θ to the 70th percentile of this distribution. This ensures that most background pixels (with lower scores) receive minimal gain, while stem pixels with higher scores receive greater gain. For example, if the calculated 70th percentile is 0.65, then θ is set to 0.65.
[0097] γ is a local variation sensitivity parameter, which controls the local standard deviation σ. qThe suppression strength of slope (i,j) is determined similarly to β. After fixing β = 20 and θ = 0.65, the optimal value of γ is searched in the range of [1,10] with a step size of 0.5. The evaluation criterion is to effectively enhance the stem while suppressing the enhancement of fine textures such as leaf veins in the background to the greatest extent. By calculating the ratio of the average contrast of the stem area and the background area in the enhanced image, the value of γ that maximizes this ratio is selected. Finally, the value of γ is determined to be 5.
[0098] Calculations based on parameters:
[0099] Calculate the score q for the pixel at position (i,j) in the stalk saliency scoring matrix and read the score q for that point from the matrix. i,j =0.8, and calculate the standard deviation of the score values within its 7×7 neighborhood to obtain σ. q (i,j)=0.1.
[0100] Substitute the determined parameter values: β = 20, θ = 0.65, γ = 5.
[0101] Calculate the product within the exponential term:
[0102]
[0103] Calculate the complete exponential function part:
[0104] exp(-1.8195)≈0.1621;
[0105] Calculate the final luminance gain coefficient g′ i,j :
[0106]
[0107] The results indicate that for a pixel with a stem significance score of 0.8 and small local variation, its brightness gain coefficient is 0.8605, which is a relatively high gain value (ranging from 0 to 1). This means that the brightness of this pixel will be significantly increased in subsequent steps. If another pixel has the same score but a larger local standard deviation, such as σ... q If (i,j)=0.4, then its gain coefficient will decrease to about 0.68.
[0108] Based on the luminance gain coefficient matrix calculated in the previous step, a global enhancement intensity control parameter E is first set. This parameter allows for fine-tuning of the overall enhancement effect. Its value is set empirically, usually between 1.0 and 2.5. Higher values produce a stronger visual enhancement effect. Here, E = 1.8 is chosen. Then, each element g′ in the luminance gain coefficient matrix is traversed. i,jMultiply this by the enhancement intensity control parameter E, and then add the result to 1 to obtain the final pixel gain P at that location. i,j The calculation formula is P i,j =1+g′ i,j ×E, this pixel gain value represents the factor by which the original pixel brightness needs to be amplified. Next, the original rapeseed canopy image is read, and a new blank image is created as the output channel. The pixels in the original image corresponding to the position (i,j) of the brightness gain coefficient matrix are accessed one by one, and their brightness values are read (for color images, their brightness channels are processed, such as the Y or L channels in the YUV or HSL color space). original (i,j), this brightness value is compared with the calculated pixel gain P i,j Multiply to obtain a new brightness value.
[0109] I new (i,j)=I original (i,j)×P i,j To prevent the calculated result from exceeding the valid range of image brightness values (e.g., 0-255 for an 8-bit image), the calculated new brightness value is truncated. That is, any value less than 0 is set to 0, and any value greater than 255 is set to 255. Finally, this adjusted and truncated brightness value is written to the corresponding position (i,j) in the newly created output image. If the original image is color, the adjusted brightness channel is recombined with the original chroma channels (such as U and V channels) to form a color image. After performing this series of operations on all pixels, a mechanization suitability evaluation enhanced image is generated.
[0110] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for image enhancement analysis to assess the lodging resistance of rapeseed varieties, characterized in that, Includes the following steps: Based on the input original rapeseed canopy image, the intrinsic variation of each pixel is calculated within a window of a preset size, and the total variation between adjacent windows is calculated to separate the stem contour associated with the rapeseed variety and establish a rapeseed stem structure layer image. Based on the rapeseed stem structure layer image, a pixel-level structure tensor set is calculated. The main feature vector is extracted from the pixel-level structure tensor set to form a direction guiding field. The broken edges are connected and the residual texture is smoothed to generate a stem linear feature sharpening map. Based on the stalk linear feature sharpening map, the image is convolved using Gaussian kernels with different standard deviations to obtain multi-scale Hessian matrix eigenvalue pairs. The multi-scale Hessian matrix eigenvalue pairs are substituted into a preset tubular structure response function to extract the maximum response value in all scales and construct a stalk saliency score map. Based on the stalk saliency rating map, the rating value of each pixel in the map is converted into a brightness gain coefficient to obtain an enhanced image for mechanization suitability assessment.
2. The method for image enhancement analysis of mechanization suitability for assessing lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the rapeseed stem structure layer image are as follows: Based on the original rapeseed canopy image, the grayscale difference in the horizontal and vertical directions is performed point by point within a pixel window of a preset size. The sum of squared differences is calculated and accumulated within the window. At the same time, the total variation value corresponding to the k adjacent windows of the pixel is recorded simultaneously to obtain the total variation set of the window. Calculate the pixel ratio index based on the total variation set of the window; Based on the pixel ratio index, a threshold determination is performed to distinguish between low-ratio pixels and high-ratio pixels. Low-ratio pixels are classified as structures and high-ratio pixels are classified as textures. Continuous regions are formed by connecting the structural pixels point by point along the boundary of the connected pixels and separating the stem outline associated with the rapeseed variety, thereby generating a rapeseed stem structure layer image.
3. The image enhancement analysis method for assessing the lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the pixel-level structure tensor set are as follows: Based on the rapeseed stem structure layer image, gradient difference is performed on each pixel in the horizontal and vertical directions. The gradient difference results are combined to form a two-dimensional matrix representing the local gray-level changes. The two-dimensional matrices of all pixel positions are arranged sequentially to obtain a pixel-level structure tensor set.
4. The image enhancement analysis method for assessing the lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the stalk linear feature sharpening map are as follows: Based on the pixel-level structure tensor set, feature decomposition is performed on each two-dimensional matrix, and the corresponding principal feature vector is extracted as a direction reference. The principal feature vectors of all pixel positions are spatially concatenated to obtain the direction guidance field. Based on the directional guiding field, diffusion is performed in the direction indicated by the principal feature vector to extend discontinuous edges, and diffusion is performed in the direction perpendicular to the principal feature vector to eliminate irregular textures. The broken areas are reconnected and the residual fragmented structures are smoothed to generate a stem linear feature sharpening map.
5. The method for image enhancement analysis of mechanization suitability for assessing lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the eigenvalue pairs of the multi-scale Hessian matrix are as follows: Based on the stalk linear feature sharpening map, multiple sets of Gaussian kernel parameters are set for each pixel position. The stalk linear feature sharpening map is convolved under each set of Gaussian kernel parameters. The convolution results are recorded pixel by pixel and stored in scale order to obtain a multi-scale convolution result map. Based on the multi-scale convolution result image, the second-order partial derivative is calculated pixel by pixel in the convolution result of each scale to construct the Hessian matrix at each pixel position, and the corresponding two feature values are extracted. The feature values of each pixel are combined in scale order to obtain the multi-scale Hessian matrix feature value pairs.
6. The method for image enhancement analysis of mechanization suitability for assessing lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the stalk saliency score map are as follows: Based on the eigenvalue pairs of the multi-scale Hessian matrix, the eigenvalue pairs of each pixel at all scales are sequentially substituted into the preset tubular structure response function to extract the maximum response value of each pixel. The maximum response value is then mapped to the original pixel position to generate a stalk saliency score map.
7. The method for image enhancement analysis of mechanization suitability for assessing lodging resistance of rapeseed varieties according to claim 1, characterized in that, The steps for obtaining the enhanced image for the mechanization suitability assessment are as follows: According to the stalk saliency scoring map, the scoring value is read pixel by pixel, truncated according to the preset upper and lower limits and linearly scaled to 0 to 1, and backfilled to the original grid position according to the row index and column index. Invalid pixels are replaced with the median of the four neighborhoods and the boundary pixels are kept unrewritten to obtain the stalk saliency scoring matrix. The brightness gain coefficient is calculated based on the stalk saliency score matrix.
8. The method for image enhancement analysis of mechanization suitability for assessing lodging resistance of rapeseed varieties according to claim 7, characterized in that, The step of acquiring the enhanced image for the mechanization suitability assessment further includes: Based on the brightness gain coefficient, each brightness gain coefficient is multiplied by the enhancement intensity control parameter and then added to 1 to obtain the pixel gain. The pixel value of the corresponding grid position of the original rapeseed canopy image is multiplied by the pixel gain item by item and written into the output channel to generate the mechanization suitability assessment enhancement image.
Citation Information
Patent Citations
Field rice and wheat lodging global evaluation method based on vehicle-mounted dynamic view field inter-frame relevance
CN115272187A
Unmanned aerial vehicle multi-source quantitative remote sensing rape growth state evaluation method
CN120107822A