Weed root positioning detection method

By combining image processing and topological analysis with density clustering verification, precise positioning of weed roots was achieved, solving the problem of inaccurate weed root positioning in existing technologies and improving the accuracy and environmental protection effect of intelligent weeding operations.

CN122049035APending Publication Date: 2026-05-15HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN UNIV OF SCI & TECH
Filing Date
2025-12-10
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately locate the roots of weeds, resulting in insufficient precision and reliability in intelligent weeding operations. Furthermore, traditional methods pose a potential environmental pollution risk.

Method used

A method for detecting weed root localization is adopted, including image acquisition, preprocessing, color space conversion, binarization segmentation, morphological optimization and skeletonization operations, combined with topological analysis and density clustering verification, to output the two-dimensional coordinates of the weed root.

Benefits of technology

It achieves millimeter-level precise positioning of weed roots, improving the accuracy and reliability of intelligent weeding operations and reducing the environmental impact of pesticide use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049035A_ABST
    Figure CN122049035A_ABST
Patent Text Reader

Abstract

A weed root positioning detection method relates to the field of agricultural image recognition, and comprises the following steps: S1, under a field illumination condition, acquiring a high-resolution RGB image of an upright weed leaf crown at a vertical high-angle view angle; s2, carrying out preprocessing on the RGB image, wherein the preprocessing comprises median filtering denoising and image enhancement by adopting CLAHE; s3, performing color space conversion, binary segmentation, morphological optimization and skeletonization operation on the preprocessed image to extract a vein skeleton structure; and S4, carrying out topological analysis on the vein skeleton, detecting and identifying branch points, verifying vein convergence points through density clustering, and finally outputting vein convergence point two-dimensional coordinates representing weed roots. According to the invention, the interference of a complex field environment can be effectively overcome, the lossless and accurate visual positioning of the root necks of weeds is realized, and a key technical support is provided for automatic weeding operation in precision agriculture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural image recognition, specifically to a method for detecting the location of weed roots. Background Technology

[0002] Precise management of field weeds is a core challenge in promoting the development of green agriculture. Statistics show that the annual weed infestation area in my country reaches 9.333 million hectares. 7 hm 2 The above results in a loss of over 3 million tons of grain. Traditional manual weeding methods are costly and inefficient. While large-scale herbicide spraying can control weeds, pesticide residues can lead to decreased soil fertility, severe environmental pollution, disruption of ecological balance, and reduced crop quality. Solving the problem of accurately locating weed roots and achieving intelligent weeding plays a crucial role in increasing crop yields and reducing the environmental impact of pesticides.

[0003] In recent years, with the continuous development of smart agriculture technology, scholars at home and abroad have conducted extensive research in the field of weed identification. Mainstream methods focus on "whole plant identification," which is based on convolutional neural networks (CNNs) and their derivative models (such as ResNet, YOLOv5, MaskR-CNN, Faster R-CNN, and lightweight structures like MobileNet, ShuffleNet, and GhostNet) to extract the morphological, textural, and spectral features of the aboveground parts of weeds, such as leaves, stems, and canopies, from visible light, multispectral, or hyperspectral images to achieve rapid detection and segmentation of weeds in the field. However, most existing technologies use the "whole weed" as the smallest identification unit, and the output masks or bounding boxes usually treat leaves, stems, and roots as the same connected region, failing to achieve more refined structural differentiation. In actual plant protection operations, whether variable spraying or laser killing, the effective area is usually only a tiny range of 0-2 cm below the center of the leaf canopy.

[0004] Therefore, narrowing the focus of identification from the "whole plant" to the "key area in the center of the leaf canopy" to overcome the shortcomings of existing methods such as high redundancy and poor targeting, and to provide millimeter-level precise coordinates for intelligent actuators, has become a technical direction that urgently needs to be broken through in the field of precision weed control. Summary of the Invention

[0005] The technical problem to be solved by this invention is to provide a detection method for locating the roots of weeds, which can effectively overcome the interference of complex field environments, achieve non-destructive and accurate visual positioning of weed root collars, and provide key technical support for automated weeding operations in precision agriculture.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] A method for detecting weed root location includes the following steps:

[0008] S1, under field lighting conditions, captures high-resolution RGB images of upright weed canopies from a vertical overhead perspective;

[0009] S2, preprocess the RGB image, including median filtering for noise reduction and CLAHE image enhancement;

[0010] S3 performs color space conversion, binarization segmentation, morphological optimization, and skeletonization operations on the preprocessed image to extract the leaf vein skeleton structure.

[0011] S4. Perform topological analysis on the leaf vein skeleton, detect and identify branch points, and verify the leaf vein confluence points through density clustering. Finally, output the two-dimensional coordinates of the leaf vein confluence points representing the roots of weeds.

[0012] As a preferred embodiment, in step S1, the field lighting conditions include natural diffused light or artificial supplemental lighting; the artificial supplemental lighting uses ring-shaped LED lights to symmetrically illuminate at a double 45° angle.

[0013] As a preferred embodiment, in step S3, the color space conversion is dynamically selected based on the weed type:

[0014] For grass weeds, the RGB image is converted to Lab color space and the a* channel is extracted;

[0015] For broadleaf weeds, the RGB image is converted to the HSV color space and the saturation S channel is extracted.

[0016] As a preferred option, in step S3, the binarization segmentation uses Otsu's maximum inter-class variance method for adaptive threshold segmentation.

[0017] As a preferred embodiment, in step S3, the morphological optimization includes opening and closing operations, wherein:

[0018] The opening operation is used to eliminate noise, and circular structural elements are used for erosion and expansion.

[0019] The closing operation is used to connect broken leaf veins, and expansion and erosion are performed using a direction-adaptive linear structuring element.

[0020] As a preferred option, in step S3, the skeletonization operation employs different algorithms depending on the weed type:

[0021] For grass weeds, the Zhang-Suen refinement algorithm was used, and vertical breakpoints were connected.

[0022] For broadleaf weeds, the MedialAxis Transform algorithm was used, and angle-length dual-threshold pruning was performed.

[0023] As a preferred embodiment, in step S4, the topology analysis includes: calculating the 8-neighborhood connectivity CN of each pixel in the leaf vein skeleton, and determining the skeleton pixel p that satisfies CN≥3 as a branch point, thus forming a set of branch points.

[0024] As a preferred embodiment, in step S4, the density clustering is density peak clustering, which includes: calculating the local density of branch points and retaining high-density core clusters; combining the geometric symmetry constraints of the blade, screening candidate points located in the central region of the blade; if there are multiple candidate centers, selecting the point closest to the centroid of the blade as the final merging point.

[0025] According to the above technical solution, the beneficial effects of the present invention are:

[0026] This invention innovatively designs a dynamic parameter image processing system, combining topological structure analysis and density clustering verification mechanisms to effectively overcome the interference of complex field environments on image recognition. It achieves millimeter-level precise positioning of weed vein confluence points, thereby obtaining accurate two-dimensional coordinates representing the weed roots. This method applies image recognition technology to weed biofeature localization, significantly improving the accuracy and reliability of intelligent weeding operations. It plays a crucial role in increasing crop yields, reducing pesticide use and its environmental impact, and successfully promotes a key leap in precision agriculture technology from "whole plant identification" to "biofeature localization." Attached Figure Description

[0027] Figure 1 This is a schematic diagram of the overall process of the weed root location detection method described in this invention;

[0028] Figure 2 A flowchart illustrating the key steps in detecting confluence points from a leaf vein skeleton;

[0029] Figure 3 A flowchart illustrating the specific implementation of leaf vein skeleton topology analysis to identify branch points;

[0030] Figure 4 A detailed flowchart illustrating the steps involved in locating the final convergence point using the DBSCAN density clustering algorithm. Detailed Implementation

[0031] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0032] A method for detecting weed roots, the overall process is as follows: Figure 1 As shown, it includes the following steps:

[0033] S1, Image Acquisition: In a field environment, a global shutter industrial camera is fixed on a tripod and calibrated using a level to ensure that the camera's optical axis is tilted at an angle of less than 1° to achieve an absolutely vertical overhead shot of the target weed canopy. For situations with insufficient natural light on cloudy days, artificial lighting is used. A ring LED supplemental light source is turned on and its position adjusted so that the light shines symmetrically onto the canopy at double 45° angles. Specifically, the camera's shooting parameters can be flexibly adjusted according to the model, and a polarizing filter can be added to the lens to prevent reflections. A high-resolution RGB image of the weed canopy is acquired.

[0034] S2, Image Preprocessing: In open field environments, the raw RGB images acquired suffer from salt-and-pepper noise and low contrast due to sensor noise, dust, or uneven lighting. To balance noise reduction and detail enhancement, this step employs the following cascaded processing.

[0035] S2.1, Median filtering to suppress isolated noise: This method is based on sorting statistics theory. By taking the median value of the neighboring pixels within the sliding window to replace the value of the center pixel, it can effectively remove salt and pepper noise while avoiding blurring of the leaf vein edge structure.

[0036] S2.2, CLAHE Enhancement: To address the issue of concentrated grayscale distribution and decreased contrast in images caused by canopy occlusion or shadows, Limiting Contrast Adaptive Histogram Equalization (CLAHE) is introduced for enhancement. CLAHE divides the image into multiple local sub-blocks and performs histogram cropping and equalization operations independently on each sub-block, thereby significantly improving the local contrast of weak texture areas such as leaf veins while suppressing local over-enhancement and noise amplification.

[0037] After cascaded processing with median filtering and CLAHE, the final image has both a high signal-to-noise ratio and maintains clear leaf vein structure features, laying a reliable image foundation for subsequent leaf crown region extraction and vein convergence point detection.

[0038] S3, Leaf vein skeleton extraction: Accurate extraction of the leaf vein skeleton is crucial for subsequent localization, specifically including:

[0039] S3.1, Color Space Conversion and Channel Extraction

[0040] In color space conversion, under open field conditions, the color difference between weed veins and the background is often masked by lighting conditions, leaf surface reflectivity, and soil heterogeneity. To accurately separate the vein structure, this invention abandons the brightness coupling defects of the traditional RGB color space and implements a vein-enhancing color space conversion based on the spectral response characteristics of plant photosynthetic pigments.

[0041] For grass weeds, based on their spectral characteristics of having lignin-rich leaf veins and exhibiting a significant negative shift (Δa*<-15) in the red-green difference axis (a* channel) in Lab color space, the preprocessed RGB images were converted to Lab color space.

[0042] The conversion formula from RGB to Lab color space is as follows:

[0043] X=0.412453R+0.357580G+0.180423B

[0044] Y=0.212671R+0.715160G+0.072169B

[0045] Z=0.019334R+0.119193G+0.950227B

[0046] Where X, Y, and Z are the components of the CIE XYZ color space. The conversion formula from XYZ to Lab is:

[0047] L * =116f(Y / Y) n )-16

[0048] α * =500[f(X / X) n )-f(Y / Y n )]

[0049] b * =200[f(Y / Y) n )-f(Z / Z n )]

[0050] in,

[0051] X n, Y n, Z n It refers to the XYZ values ​​of the white point.

[0052] For broadleaf weeds, due to the specular reflection suppression effect caused by differences in cuticle thickness in their reticulate veins, their saturation channel (S) value in the HSV color space is significantly higher than that of the mesophyll region (typically ΔS>0.4).

[0053] Therefore, this invention uses the HSV color space for conversion, and the conversion formula is as follows:

[0054] C max =max(R,G,B),C min =min(R,G,B),Δ=C max -C min .

[0055] This method aims to select the most discriminative chromaticity channel based on the differences in the spectral absorption characteristics of lignin and chlorophyll, thereby overcoming the limitations of color aliasing in the traditional RGB color space.

[0056] S3.2, Binarization Segmentation

[0057] Based on the enhanced channel (a* / S channel) obtained from the aforementioned color space conversion, leaf veins and background pixels exhibit a typical bimodal distribution in their gray-level histograms. This distribution characteristic makes threshold-based segmentation possible. To overcome threshold drift caused by fluctuations in field illumination and to utilize the inherent gray-level separability of leaf veins and the background, this step employs Otsu's maximum inter-class variance method to achieve adaptive threshold segmentation. This method automatically solves for the optimal segmentation threshold t based on maximizing the inter-class variance, mathematically represented as follows: Let the image gray-level range be [0, L-1], and the probability of a pixel appearing at gray level i be:

[0058]

[0059] Where n i Let N be the number of pixels at gray level i, and N be the total number of pixels.

[0060] When segmented by a threshold t, pixels are divided into two categories:

[0061] (1) Background class C0: grayscale level [0,t]

[0062] (2) Target class C1 (leaf vein region): gray level [t+1, L-1]

[0063] Define the probability and mean of the occurrence of the two classes:

[0064] Define between-class variance:

[0065] Optimal threshold (t) * The threshold that maximizes the inter-class variance:

[0066] The Otsu algorithm analyzes the histogram statistics of an image to dynamically adapt to changes in grayscale distribution under different lighting conditions, effectively eliminating the impact of threshold drift and exhibiting good lighting robustness. This algorithm fully utilizes the naturally occurring bimodal distribution of leaf veins / background in the enhancement channel, achieving optimal segmentation between leaf veins and background by maximizing inter-class variance.

[0067] S3.3, Morphological Optimization

[0068] The goal of morphological optimization is to eliminate noise interference in binary images, connect broken leaf vein regions, and extract high-fidelity skeleton structures, thereby providing a topologically complete leaf vein network for subsequent vein convergence point detection.

[0069] To address the noise cancellation and fracture repair problem, a multi-scale iterative opening and closing operation strategy is adopted, which includes the following steps:

[0070] (1) Opening operation (erosion followed by dilation): used to remove salt-and-pepper noise (such as soil debris, light reflection points, etc.) from binary images of leaf veins. First, a circular structuring element with a radius of 2 pixels is used to erode the image:

[0071]

[0072] It then expands to restore the width of the main vein:

[0073]

[0074] (2) Closing operation (dilation followed by erosion): Used to connect broken leaf veins caused by image noise or occlusion. A linear structuring element B is used. l=x,θ Processing:

[0075]

[0076] By using this method, the orientation-adaptive structuring element can detect the main direction of leaf veins through local Hough transform, ensuring that the fracture repair result conforms to the natural topological morphology of leaf veins.

[0077] S3.4, Skeletonization

[0078] Skeletonization is the core step in extracting leaf vein topology, and the algorithm selection must fully consider the essential morphological differences between grasses and broadleaf weeds. Grass veins are arranged in parallel bundles with small intervening intervals, making them prone to breakage; broadleaf weed veins, on the other hand, are distributed in a network pattern with large branching angles, making them susceptible to interference from the mesophyll region. Therefore, this study, based on a unified morphological preprocessing, adopts differentiated skeletonization strategies for different leaf types and introduces a consistency verification mechanism in the post-processing stage to ensure the stability and repeatability of vein convergence point coordinates.

[0079] ①Gramineous weeds: Zhang-Suen refinement algorithm

[0080] The parallel vein structure of grass leaves is extremely sensitive to "single-pixel breaks." The Zhang-Suen algorithm, based on 8-neighborhood iterative deletion of boundary pixels, can quickly generate an 8-connected single-pixel-width skeleton within two scans. After refinement, a "vertical breakpoint connection" strategy is further implemented: if the distance between the endpoints of two skeletons does not exceed 1.5 times the average spacing between leaf veins, and the angle between the connecting line and the main direction of the leaf vein is less than 15°, they are connected by a straight line segment, thereby effectively repairing the micro-breaks caused by uneven illumination.

[0081] ② Broadleaf weeds: Central axis transformation

[0082] The reticulate vein structure of broad-leaved weeds requires the skeleton to maintain geometric centrality at the bifurcation. The medial axis transform generates a connected skeleton tree by calculating the trajectory of the largest inscribed circle from each point in the binary region to the boundary, naturally preserving the intersection topological relationship between the main vein and the lateral veins. To suppress the redundant burrs that may be introduced by the medial axis transform at the leaf edge, "angle-length double-threshold pruning" is performed on the obtained skeleton:

[0083] Based on the geometric features of the skeleton, for the angle threshold, it is used to remove abnormal acute-angle branches. At the skeleton branch points (where three or more skeletons intersect), calculate the angle between the direction vectors of any two outgoing branches.

[0084] If the minimum angle is less than the set angle threshold (30°), it is determined as an abnormal acute-angle bifurcation. Subsequently, remove the shorter one of the two branches that form the acute angle to smooth the node.

[0085] For the length threshold, it is used to remove redundant short burrs. A proportional threshold relative to the total length L of the skeleton is adopted, enabling the algorithm to adapt to leaves of different sizes. First, decompose all skeleton branches into independent line segments from the branch point to the end point (or another branch point). Calculate the total length L of all pixel points in the entire skeleton network. For each terminal branch (the end point is the end point), calculate its length L1. If L1 < L * 0.02), then remove this short branch.

[0086] By setting the angle threshold and the length threshold, accordingly remove the secondary branches that do not conform to the morphological characteristics, so as to extract a concise and accurate skeleton structure while maintaining the true vein topology.

[0087] S4, Confluence point detection and root coordinate output

[0088] The overall process of this step is as Figure 2 shown, aiming to accurately locate the vein confluence point representing the weed root from the vein skeleton.

[0089] S4.1, Topological analysis (branch point detection)

[0090] After obtaining the single-pixel-width vein skeleton, it is necessary to further extract its topological nodes as a candidate set for accurately locating the vein convergence point (i.e., the root neck projection position). The specific implementation process is as Figure 3 shown. For this purpose, this embodiment proposes a fast branch point detection algorithm based on the 8-neighborhood connectivity number.

[0091] Mathematical definition: For any skeleton pixel p, define its 8-neighborhood pixels in clockwise order as p1, p2,..., p8, then:

[0092] where p9 = p1,

[0093] When CN(p)≥3, p is determined to be a branch point (i.e., three or more leaf veins converge here). This definition is equivalent to calculating the number of 0-to-1 transitions within the 8-neighborhood, and has rotation invariance and single-pixel precision.

[0094] The algorithm implementation steps are as follows:

[0095] ① Scan: Traverse the entire skeleton matrix in row-major order;

[0096] ② Counting: Calculate the connectivity CN for each skeleton pixel;

[0097] ③ Filtering: Retain the pixel coordinates that satisfy CN≥3 to form the initial branch point set B={b1,b2,…,b_m};

[0098] ④ False node removal: If the Euclidean distance between any two branch points is less than 2 pixels, then merge them into one point (by taking the centroid) to eliminate the false double nodes generated by the skeletonization process.

[0099] By following the steps above, branch point detection can be achieved, providing a data foundation for subsequent density clustering localization.

[0100] S4.2: Density Clustering Validation

[0101] After the above topological analysis, a set B = {b1, b2, ..., b_m} containing all skeleton intersection / bifaction locations is obtained. However, due to local blade wrinkling, shadow interference, or morphological processing residues, B often contains a large number of pseudo-intersection points. To improve positioning accuracy, this step uses density peak clustering to further refine the candidate points. The detailed execution steps are as follows: Figure 4 As shown: First, the local density of each branch point is calculated based on an adjustable cutoff distance, and the core cluster with the highest density is selected. Then, a geometric mask of the longitudinal symmetry axis of the blade is introduced to retain only candidate points with a horizontal offset not exceeding one-quarter of the blade width. Finally, if only a single cluster center remains after selection, it is directly identified as the vein convergence point; if multiple centers exist, the one closest to the centroid of the blade is selected as the final output position.

[0102] Through a dual verification mechanism of topological analysis and density clustering, the precise location of leaf vein confluence points can be achieved in complex field environments, thereby reliably outputting the two-dimensional coordinates of weed roots.

[0103] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations 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 scope of the present invention.

Claims

1. A method for detecting the location of weed roots, characterized in that: Includes the following steps: S1, under field lighting conditions, captures high-resolution RGB images of upright weed canopies from a vertical overhead perspective; S2, preprocess the RGB image, including median filtering for noise reduction and CLAHE image enhancement; S3 performs color space conversion, binarization segmentation, morphological optimization, and skeletonization operations on the preprocessed image to extract the leaf vein skeleton structure. S4. Perform topological analysis on the leaf vein skeleton, detect and identify branch points, and verify the leaf vein confluence points through density clustering. Finally, output the two-dimensional coordinates of the leaf vein confluence points representing the roots of weeds.

2. The detection method for locating weed roots according to claim 1, characterized in that: In step S1, the field lighting conditions include natural diffused light or artificial supplemental lighting; the artificial supplemental lighting uses ring LED lights to symmetrically illuminate at a double 45° angle.

3. The detection method for locating weed roots according to claim 1, characterized in that: In step S3, the color space conversion is dynamically selected based on the weed type: For grass weeds, the RGB image is converted to Lab color space and the a* channel is extracted; For broadleaf weeds, the RGB image is converted to the HSV color space and the saturation S channel is extracted.

4. The detection method for locating weed roots according to claim 1, characterized in that: In step S3, the binarization segmentation uses Otsu's maximum inter-class variance method for adaptive threshold segmentation.

5. The detection method for locating weed roots according to claim 1, characterized in that: In step S3, the morphological optimization includes opening and closing operations, wherein: The opening operation is used to eliminate noise, and circular structural elements are used for erosion and expansion. The closing operation is used to connect broken leaf veins, and expansion and erosion are performed using a direction-adaptive linear structuring element.

6. The detection method for locating weed roots according to claim 5, characterized in that: In step S3, the skeletonization operation employs different algorithms depending on the weed type: For grass weeds, the Zhang-Suen refinement algorithm was used, and vertical breakpoints were connected. For broadleaf weeds, the Medial Axis Transform algorithm was used, and angle-length dual threshold pruning was performed.

7. The detection method for locating weed roots according to claim 1, characterized in that: In step S4, the topology analysis includes: calculating the 8-neighborhood connectivity CN of each pixel in the leaf vein skeleton, and determining the skeleton pixel p that satisfies CN≥3 as a branch point, thus forming a branch point set.

8. The detection method for locating weed roots according to claim 1, characterized in that: In step S4, the density clustering is density peak clustering, which includes: calculating the local density of branch points and retaining high-density core clusters; combining the geometric symmetry constraints of the blade to screen candidate points located in the central region of the blade; if there are multiple candidate centers, the point closest to the centroid of the blade is selected as the final merging point.