Orchard Visual Navigation Path Extraction Method Based on YOLO-DP Detector and DSDI Fitting

By using a lightweight YOLO-DP detector and DSDI fitting method, the problems of trunk recognition accuracy and path fitting in orchard visual navigation are solved, achieving efficient and accurate navigation path extraction and supporting the intelligent and autonomous operation of orchard robots.

CN123065463APending Publication Date: 2026-11-10NANJING AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611190721.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies for visual navigation in orchards suffer from problems such as insufficient trunk recognition accuracy, large number of model parameters, high computational complexity, and path fitting being easily affected by noise. They are difficult to run in real time on agricultural machinery edge terminals and have low navigation accuracy.

Method used

We employ a lightweight YOLO-DP detector and DSDI fitting method, which identifies tree trunk bounding boxes through multi-scale fusion and attention mechanisms, fits tree lines using the shortest distance criterion, and generates navigation paths using the angle bisector principle, thus achieving efficient and accurate navigation path extraction.

Benefits of technology

Stable navigation path extraction was achieved in complex orchard environments, balancing detection accuracy and operational efficiency, providing reliable navigation support, and promoting the intelligent and autonomous development of agricultural robots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123065463A_ABST
    Figure CN123065463A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of intelligent agricultural machinery technology, specifically relating to a method for extracting orchard visual navigation paths based on a YOLO-DP detector and DSDI fitting. This invention constructs a lightweight, high-precision YOLO-DP detector to achieve robust recognition of small targets on tree trunks, and innovatively proposes a DSDI path fitting algorithm to accurately extract inter-row navigation lines under geometric constraints. The overall solution balances detection accuracy, operational efficiency, and anti-interference capability, effectively solving the failure problems of traditional methods in scenarios such as changes in lighting, weed interference, and small tree trunks. It provides reliable and real-time navigation support for orchard robots, promoting the development of agricultural robots towards intelligence and autonomy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent agricultural machinery technology, specifically relating to a method for extracting orchard visual navigation paths based on YOLO-DP detector and DSDI fitting. Background Technology

[0002] The core of orchard visual navigation lies in the accurate and real-time extraction of driving paths between rows. However, the complex orchard environment presents multiple challenges to this task: factors such as changing lighting, weed cover, thin and varied tree trunks, undulating terrain, and camera shake make the effective information available for localization in the image sparse and easily obscured. Traditional image processing methods based on thresholding, color index, or edge detection lack robustness in orchard scenes with low structure and strong background interference, often requiring manual parameter adjustment and exhibiting limited generalization ability.

[0003] Recently, deep learning-based methods have been proposed in the field of visual navigation. Researchers use deep networks to detect tree trunks and fit navigation lines using the geometric center of the detected tree trunks. The target detection model has significantly improved the accuracy of tree trunk recognition. However, existing solutions generally neglect the targeted design for small targets, resulting in high model parameter counts and floating-point operations, making it difficult to run in real time on agricultural machinery edge terminals with limited computing power. At the same time, the path fitting stage after detection still mostly uses the least squares method or Hough transform. These algorithms are sensitive to noise and abnormal positioning points. Once weeds obscure the path or the detection box is offset, the fitted navigation line is very likely to deviate from the actual row center, resulting in excessive deviation of the heading angle, which cannot meet the requirements of precise operation. Based on this, this solution provides a method for orchard visual navigation path extraction based on YOLO-DP detector and DSDI fitting to solve the above problems. Summary of the Invention

[0004] The purpose of this invention is to provide a method for extracting orchard visual navigation paths based on YOLO-DP detector and DSDI fitting, which can stably extract accurate navigation paths in complex orchard environments, balancing detection accuracy and operating efficiency.

[0005] The specific technical solution adopted by this invention is as follows: A method for extracting orchard visual navigation paths based on YOLO-DP detector and DSDI fitting includes: By preprocessing the images of the rows of fruit trees in the orchard, a reference image for characterizing the structure between the rows of fruit trees is output. Feature enhancement of the baseline image is performed through multi-scale fusion and attention mechanism, and the bounding box of the tree trunk is identified. The feature point set of adjacent side fruit tree rows is selected based on the geometric properties of the bounding box. Based on the feature point set, the tree row lines on both sides are fitted by the shortest distance criterion to obtain the tree row line equations on adjacent sides, which are recorded as the left tree row line equation and the right tree row line equation respectively. Solve the equations of the left and right tree lines simultaneously, solve for the coordinates of the geometric intersection point, and record the coordinates of the geometric intersection point as the reference point for the navigation path; Based on the reference point, the slope and intercept of the navigation path are calculated using the angle bisector principle, generating a navigation path equation to guide the orchard robot's direction of travel.

[0006] In a preferred embodiment, the step of preprocessing images of the rows of fruit trees in the orchard to output a reference image characterizing the row structure of the fruit trees includes: The original images of fruit trees were processed by grayscale conversion, filtering, and edge enhancement to suppress interference from lighting and foliage shading. Adaptive histogram equalization is used to improve the image contrast between fruit trees, and morphological closing operations are combined to fill the broken areas at the edges of the tree trunks. The processed image is binarized and segmented to extract the connected regions of the tree trunk, and the initial tree trunk outline is generated by fitting the minimum bounding rectangle. The initial tree trunk outline is screened to remove noise regions with an area smaller than a preset screening threshold, and vertical outlines with an area larger than the preset threshold and an aspect ratio that meets the vertical characteristics are retained as valid tree trunk candidate regions. The valid candidate tree trunk regions are mapped back to the original image coordinate system to generate a reference image with spatial consistency.

[0007] In a preferred embodiment, the step of enhancing the feature of the reference image through multi-scale fusion and attention mechanisms, identifying the bounding box of the tree trunk, and filtering the feature point set of adjacent lateral fruit tree rows based on the geometric properties of the bounding box includes: A YOLO-DP depth detection network is pre-constructed, and end-to-end target detection is performed on the benchmark image based on the YOLO-DP depth detection network to output the detection box of the fruit tree trunk; Non-maximum suppression is applied to the detection boxes to remove redundant boxes with an overlap exceeding the allowable overlap threshold. Then, based on the coordinates of the center point of the detection box and the direction of the main axis of the image, the relative azimuth angle of each fruit tree trunk in the inter-row space is calculated. Based on the relative azimuth angle, the detection boxes are clustered into left and right tree clusters. Detection boxes with azimuth angles located in the left half of the image are classified into the left tree cluster candidate set, and detection boxes with azimuth angles located in the right half of the image are classified into the right tree cluster candidate set. The coordinates of the bottom center point of each detection box are extracted from the candidate sets of the left and right tree rows respectively as feature points representing the direction of the tree rows, and then summarized into a feature point set of adjacent side fruit tree rows.

[0008] In a preferred embodiment, the pre-construction of the YOLO-DP depth detection network includes the following steps: The YOLO11s network structure is used as the basic network framework, and a DAC feature fusion architecture is integrated on the basic network framework. The DAC feature fusion architecture includes a dynamic sampling scale feature fusion module, an adaptive multi-scale feature fusion module, and a channel and position attention mechanism. The channel dimension of feature maps at different levels is unified by a dynamic sampling scale feature fusion module, and spatial resolution is aligned by dynamic upsampling to preserve low-level detail information. The adaptive multi-scale feature fusion module divides the feature map into feature map patches of multiple sizes, and achieves adaptive weighted fusion of multi-scale features through hybrid pooling downsampling and dynamic upsampling operations. By employing channel and position attention mechanisms, the fused feature map is subjected to dual attention weighting to output an enhanced multi-scale feature representation, thereby strengthening the ability to distinguish tree trunk edges and occluded areas. The baseline images are classified into training sample set, validation sample set and test sample set. The improved YOLO-DAC network is trained using the training sample set, which contains baseline images under various seasons, lighting conditions and degree of foliage occlusion. The adaptive amplitude pruning strategy applied to the trained YOLO-DAC network is compressed to reduce the number of parameters and computational complexity of the YOLO-DAC network, thus generating a lightweight YOLO-DP detector.

[0009] In a preferred embodiment, the step of fitting the tree row lines on both sides based on the feature point set and using the shortest distance criterion to obtain the equations of the adjacent fruit tree row lines includes: The feature point set is classified into the left tree row feature point set and the right tree row feature point set, and the left center coordinates and right center coordinates of the left tree row feature point set and the right tree row feature point set are calculated respectively; Translate the feature point set of the left tree row and the feature point set of the right tree row respectively, so that the left center coordinate and the right center coordinate become the origin, and obtain a new point set; The shortest distance criterion is used to fit the equation of a straight line to the new point set. The slope parameter and intercept parameter are obtained by minimizing the sum of squares of the distances from the points to the line. The slope parameter includes the left slope parameter corresponding to the left tree row and the right slope parameter corresponding to the right tree row. Substituting the slope and intercept parameters back into the original coordinate system, we obtain the equations for the left and right tree rows.

[0010] In a preferred embodiment, the step of simultaneously solving the equations of the left and right tree lines, obtaining the coordinates of the geometric intersection point, and recording the coordinates of the geometric intersection point as the reference point of the navigation path includes: Combine the equations of the left and right tree rows to form a system of equations. The simultaneous equations are rearranged and solved by algebraic transformations to obtain the expression for the x-coordinate of the intersection point. Then, the x-coordinate of the intersection point is substituted into the equation of the left or right tree row to solve for the y-coordinate of the intersection point. Combine the x-coordinate and y-coordinate of the intersection point into a two-dimensional coordinate pair and record it as the navigation reference point in the current image frame.

[0011] In a preferred embodiment, the step of calculating the slope and intercept of the navigation path based on a reference point using the angle bisector principle to generate a navigation path equation for guiding the orchard robot's direction of travel includes: Based on the slope parameters of the left and right tree lines, the slope parameters of the navigation path are calculated using the angle bisector principle and recorded as the navigation path slope. Based on the navigation reference point and the slope of the navigation path, calculate the intercept parameter of the navigation path and record it as the navigation path intercept; The slope and intercept of the navigation path are combined into a linear equation to generate a navigation path equation that guides the orchard robot's real-time movement.

[0012] In a preferred embodiment, after the navigation path equation is generated, the path validity is verified simultaneously. The specific verification steps are as follows: Calculate the angle between the left and right tree rows and determine whether the angle is within a reasonable range. If the included angle is within a reasonable range, the heading angle between the navigation path and the horizontal baseline of the image is calculated based on the navigation path equation. Determine whether the heading angle is less than or equal to the safe heading angle threshold; If the heading angle is less than or equal to the safe heading angle threshold, the navigation path is deemed valid, and the navigation path equation is output to the control terminal of the orchard robot. If the included angle exceeds the reasonable included angle range, or the heading angle is greater than the safe heading angle threshold, the navigation path is determined to be invalid, triggering the re-acquisition of images and path replanning.

[0013] The present invention also provides a navigation path extraction system, using the above-mentioned orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting, comprising: The preprocessing module is used to preprocess the images of the rows of fruit trees in the orchard and output a reference image to characterize the structure of the rows of fruit trees. The feature extraction module is used to enhance the features of the baseline image through multi-scale fusion and attention mechanism, identify the bounding box of the tree trunk, and filter the feature point set of adjacent side fruit tree rows based on the geometric properties of the bounding box. The equation construction module is used to fit the tree row lines on both sides based on the feature point set and the shortest distance criterion to obtain the tree row line equations on the adjacent sides, and record them as the left tree row line equation and the right tree row line equation respectively. The equation-solving module is used to solve the equations of the left and right tree rows, solve for the coordinates of the geometric intersection point, and record the coordinates of the geometric intersection point as the reference point of the navigation path. The equation output module is used to calculate the slope and intercept of the navigation path based on the reference point and the angle bisector principle, and generate navigation path equations to guide the orchard robot's direction of travel.

[0014] And, an electronic device, the electronic device comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the above-described orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting.

[0015] The technical effects achieved by this invention are as follows: This invention constructs a lightweight, high-precision YOLO-DP detector to achieve robust recognition of small targets on tree trunks. It also innovatively proposes a DSDI path fitting algorithm to accurately extract inter-row navigation lines under geometric constraints. The overall solution balances detection accuracy, operational efficiency, and anti-interference capability, effectively solving the failure problems of traditional methods in scenarios such as changes in lighting, weed interference, and small tree trunks. It provides reliable and real-time navigation support for orchard robots and promotes the development of agricultural robots towards intelligence and autonomy. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the system modules of the present invention; Figure 3 This is a schematic diagram of the electronic device structure of the present invention. Detailed Implementation

[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0018] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0019] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in a preferred embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that mutually excludes other embodiments.

[0020] Please see Figure 1 As shown, this invention provides a method for extracting orchard visual navigation paths based on YOLO-DP detector and DSDI fitting, including: S1. By preprocessing the images of the rows of fruit trees in the orchard, a reference image for characterizing the structure between the rows of fruit trees is output. In step S1, firstly, original images of the fruit tree rows in the orchard are acquired. Then, the original images are processed by grayscale conversion, filtering and denoising, and edge enhancement to suppress environmental noise interference and highlight the tree trunk edge features, thereby providing a high-quality reference image for subsequent feature point extraction. The step of preprocessing the fruit tree rows in the orchard to output a reference image characterizing the fruit tree row structure includes: The original images of fruit trees were processed by grayscale conversion, filtering, and edge enhancement to suppress interference from lighting and foliage shading. Adaptive histogram equalization is used to improve the image contrast between fruit trees, and morphological closing operations are combined to fill the broken areas at the edges of the tree trunks. The processed image is binarized and segmented to extract the connected regions of the tree trunk, and the initial tree trunk outline is generated by fitting the minimum bounding rectangle. The initial tree trunk outline is screened to remove noise regions with an area smaller than a preset screening threshold, and vertical outlines with an area larger than the preset threshold and an aspect ratio that meets the vertical characteristics are retained as valid tree trunk candidate regions. The valid candidate tree trunk regions are mapped back to the original image coordinate system to generate a reference image with spatial consistency. Specifically, when outputting the baseline image, the original acquired images of the fruit tree rows are first converted to grayscale, transforming the multi-channel color image into a single-channel grayscale image to reduce the computational load of subsequent processing. Then, Gaussian filtering is used to smooth and denoise the grayscale image, filtering out high-frequency noise caused by uneven lighting. Next, Laplacian operator is used for edge enhancement, strengthening the contour features of the tree trunk edges. Then, adaptive histogram equalization is used to adjust the contrast of local areas, avoiding overexposure or underexposure problems caused by global equalization, improving the distinction between the tree trunk and the background. Finally, morphological closing operations are used to connect the gaps in the tree trunk edges caused by foliage occlusion, resulting in a complete and coherent tree image. The image is divided into background and foreground target regions by adaptive binarization using the Otsu method to extract the tree trunk connected regions in the foreground. The minimum bounding rectangle is used to fit each connected region to generate the initial tree trunk outline. Then, a screening threshold is set according to the statistically obtained noise region area distribution to remove small noise outlines with an area smaller than the threshold. At the same time, the aspect ratio of the remaining outlines is calculated, and only outlines with an aspect ratio greater than the preset value and conforming to the vertical growth characteristics of the tree trunk are retained as valid tree trunk candidate regions. Finally, the obtained valid tree trunk candidate regions are mapped back to the original image coordinate system according to the original coordinates to ensure that the spatial position correspondence is consistent, and the benchmark image representing the inter-row structure of the fruit tree is output.

[0021] S2. Feature enhancement of the baseline image is performed through multi-scale fusion and attention mechanism, and the bounding box of the tree trunk is identified. Feature point sets of adjacent side fruit tree rows are selected based on the geometric properties of the bounding box. In step S2, feature enhancement and target detection are first performed on the reference image. After the tree trunk detection box is identified, the corresponding feature points are extracted to provide data support for subsequent tree row fitting. The steps of enhancing the reference image through multi-scale fusion and attention mechanisms, identifying the tree trunk bounding boxes, and selecting feature point sets for adjacent lateral fruit tree rows based on the geometric properties of the bounding boxes include: A YOLO-DP depth detection network is pre-constructed, and end-to-end target detection is performed on the benchmark image based on the YOLO-DP depth detection network to output the detection box of the fruit tree trunk; When pre-building the YOLO-DP deep detection network, the following steps are included: Using the YOLO11s network structure as the basic network framework, and integrating a DAC feature fusion architecture on top of this framework, we address the problem of high proportion of small targets (tree trunks) and easy loss of spatial information in orchard images. The DAC feature fusion architecture includes: The dynamic sampling scale feature fusion module unifies the channel dimensions of feature maps at different levels and aligns spatial resolution through dynamic upsampling to preserve low-level details. First, convolution operations unify the channel dimensions of feature maps at different levels to 64. Then, the dynamic upsampling module (Dysample) adaptively selects the optimal upsampling rate based on the image region complexity to adjust the spatial resolution of higher-level feature maps, aligning them with lower-level feature maps (e.g., P3 and P4 are aligned to the 160×160 size of P2). Finally, the feature maps at each level are stacked and sequentially processed through 3D convolution, 3D normalization, ReLU activation, and 3D max pooling to extract multi-scale features and enhance feature representation capabilities. The adaptive multi-scale feature fusion module divides the feature map into feature map patches of multiple sizes. Through hybrid pooling downsampling and dynamic upsampling operations, adaptive weighted fusion of multi-scale features is achieved. Specifically, the feature map is divided into large, medium, and small sizes for separate processing. Large-sized feature maps are downsampled using hybrid max pooling and average pooling after convolution adjustment, while small-sized feature maps are adaptively upsampled using the Dysample module after convolution adjustment. After processing, the spatial dimensions of the three feature maps remain consistent. Efficient fusion is achieved through channel-dimensional concatenation, significantly improving the detection capability for small targets. The fused feature map is subjected to dual attention weighting through channel and position attention mechanisms, resulting in an enhanced multi-scale feature representation that strengthens the ability to distinguish tree trunk edges and occluded regions. Specifically, it integrates the multi-scale features of DSSFF and the detailed features of ATFF. The channel attention network introduces 1D convolution without dimensionality reduction to capture local interactions between channels, avoiding the accuracy loss caused by traditional dimensionality reduction operations. The position information attention network divides the feature map by width and height, encodes it independently on the horizontal and vertical axes, and then merges them to preserve position and detailed information, thereby strengthening the ability to distinguish tree trunk edges and occluded regions. The baseline images are classified into training sample set, validation sample set and test sample set. The improved YOLO-DAC network is trained using the training sample set, which contains baseline images under various seasons, lighting conditions and degree of foliage occlusion. The trained YOLO-DAC network is compressed using an adaptive magnitude pruning strategy applied to the application layer. This adaptive magnitude pruning adjusts the pruning ratio based on the weight distribution of each convolutional layer. Its core principle is to calculate the relative importance score of the weights, prioritizing the retention of weights with larger magnitudes. ; in, This represents the weight tensor of a given layer. and They represent the indexes respectively. , The weight elements of the mapping; the exponent and It is obtained by sorting all ownership weights in ascending order. Indicates and A set of relevant indicators Quantified The relative importance of pruning decisions within a layer is considered. During the pruning process, the LAMP scores of all layers are aggregated and globally sorted. The weights with the lowest scores are removed until the predetermined sparsity target is reached (actual speedup ≥ preset value, where Speedup is defined as FLOPs(base) / FLOPs(pruned)). Finally, the pruned model is fine-tuned to compensate for accuracy loss, reduce the number of parameters and computational complexity of the YOLO-DAC network, and generate a lightweight YOLO-DP detector.

[0022] The main steps of the LAMP algorithm to optimize YOLO-DAC are as follows: Weight sorting and cumulative calculation: Initialize the weight file of the YOLO-DAC model, sort the squared values ​​of the weight tensor Wt of each layer in descending order, and calculate the cumulative sum of squares for normalization.

[0023] Calculate the LAMP score: Calculate the relative importance score for each weight according to the relative importance scoring formula.

[0024] Global score ranking and pruning: Summarize the LAMP scores of all layers and sort them globally. Remove the weights with the lowest scores until a predetermined sparsity target is reached. In this aspect, the sparsity target is that the actual speed up is greater than or equal to the theoretical preset speed up, where speed up is defined as follows: ; Based on this, the pruned model is fine-tuned, and the model parameters are optimized and recalibrated to compensate for the accuracy loss caused by channel removal, thereby achieving a balance between efficiency and performance.

[0025] Non-maximum suppression is applied to the detection boxes to remove redundant boxes with an overlap exceeding the allowable overlap threshold. Then, based on the coordinates of the center point of the detection box and the direction of the main axis of the image, the relative azimuth angle of each fruit tree trunk in the inter-row space is calculated. Based on the relative azimuth angle, the detection boxes are clustered into left and right tree clusters. Detection boxes with azimuth angles located in the left half of the image are classified into the left tree cluster candidate set, and detection boxes with azimuth angles located in the right half of the image are classified into the right tree cluster candidate set. The coordinates of the bottom center point of each detection box are extracted from the candidate sets of the left and right tree rows respectively as feature points representing the direction of the tree rows, and then summarized into a feature point set of adjacent side fruit tree rows; Specifically, after the YOLO-DP depth detection network is constructed, the baseline image is input into the pre-constructed YOLO-DP depth detection network, which outputs detection boxes for all tree trunk targets in the image. Then, non-maximum suppression is applied to the detection boxes to remove redundant detection boxes with overlap exceeding a preset tolerance threshold, preventing the same tree trunk from being repeatedly identified. The center point coordinates of each remaining detection box are calculated based on the image coordinate system, and the relative azimuth angle of each tree trunk in the inter-row space is calculated in conjunction with the image's principal axis direction. Based on this, the detection boxes are clustered into left and right tree rows. Detection boxes with azimuth angles located in the left half of the image are assigned to the left tree row candidate set, and those with azimuth angles located in the right half of the image are assigned to the right tree row candidate set. The bottom center point coordinates of each detection box are extracted from the left and right tree row candidate sets. This point is the midpoint calculated from the top left and bottom right corners of the detection box and serves as a localization feature point representing the direction of the corresponding tree row. Finally, the left tree row feature point set is obtained. Sum of right tree row feature points .

[0026] S3. Based on the feature point set, the tree row lines on both sides are fitted by the shortest distance criterion to obtain the tree row line equations on adjacent sides, and recorded as the left tree row line equation and the right tree row line equation respectively. In step S3, based on the feature point sets of the left and right tree rows obtained in step S2, the center lines of the tree rows on both sides are fitted using the shortest distance criterion to obtain the corresponding straight line equations. The step of fitting the tree row lines on both sides using the shortest distance criterion based on the feature point sets to obtain the equations of the adjacent side fruit tree row lines includes: The feature point set is classified into the left tree row feature point set and the right tree row feature point set, and the left center coordinates and right center coordinates of the left tree row feature point set and the right tree row feature point set are calculated respectively; Translate the feature point set of the left tree row and the feature point set of the right tree row respectively, so that the left center coordinate and the right center coordinate become the origin, and obtain a new point set; The shortest distance criterion is used to fit the equation of a straight line to the new point set. The slope parameter and intercept parameter are obtained by minimizing the sum of squares of the distances from the points to the line. The slope parameter includes the left slope parameter corresponding to the left tree row and the right slope parameter corresponding to the right tree row. Substituting the slope and intercept parameters back into the original coordinate system, we obtain the equations of the left and right tree rows. Specifically, first, calculate the center coordinates of the feature point sets of the left and right tree rows respectively. The formula for calculating the center point of the left tree row is: ; The formula for calculating the center point of the right tree row is: ; in, and These represent the number of feature points in the left and right tree rows, respectively. All feature points are translated so that their corresponding center points become the origin of the new coordinate system, resulting in the translated set of points in the left tree row. And right tree row point set The fitted line after translation is parallel to the original line, and its equation is in the form of: ; The shortest distance criterion is used to fit the line, and the optimal slope is solved by minimizing the sum of squared distances from all points to the line: the expression for the sum of squared distances is: ; Taking the partial derivative of this formula and setting it to zero, we obtain the formula for calculating the slope as follows: ; The discriminant is: ; Substitute the translated left and right tree row point sets into the formula to calculate the slope of the left tree row. and Then combine the coordinates of the center point with the equation of the line The corresponding intercept is calculated as follows: ; Finally, the equation of the left tree row line is obtained. Right tree line equation .

[0027] S4. Solve the equations of the left and right tree lines simultaneously, and solve for the coordinates of the geometric intersection point. Record the coordinates of the geometric intersection point as the reference point for the navigation path. In step S4, the equations of the tree lines on both sides obtained in S3 are solved simultaneously, and the intersection of the two lines is used as the reference point for the navigation path. The specific steps are as follows: Combine the equations of the left and right tree rows to form a system of equations. The simultaneous equations are rearranged and solved by algebraic transformations to obtain the expression for the x-coordinate of the intersection point. Then, the x-coordinate of the intersection point is substituted into the equation of the left or right tree row to solve for the y-coordinate of the intersection point. Combine the x-coordinate and y-coordinate of the intersection point into a two-dimensional coordinate pair and record it as the navigation reference point in the current image frame. Specifically, let the intersection of the left and right tree lines be... Solve the two equations simultaneously Rearranging the equations yields The x-coordinate of the intersection point is obtained by solving the problem. Substituting the x-coordinate into the equation of the left tree row, the y-coordinate of the intersection point is calculated as follows: ,Will and The points are combined into two-dimensional coordinate pairs, which are the navigation path reference points in the current image frame. These points serve as the geometric references for subsequent navigation path calculations.

[0028] S5. Based on the reference point, calculate the slope and intercept of the navigation path using the angle bisector principle to generate a navigation path equation to guide the orchard robot's direction of travel. In step S5, based on the navigation reference point obtained in step S4 and the slope of the tree lines on both sides, the parameters of the navigation path are calculated using the angle bisector principle to generate the final navigation path equation. The specific process is as follows: Based on the slope parameters of the left and right tree lines, the slope parameters of the navigation path are calculated using the angle bisector principle and recorded as the navigation path slope. Based on the navigation reference point and the slope of the navigation path, calculate the intercept parameter of the navigation path and record it as the navigation path intercept; The navigation path slope and navigation path intercept are combined into a linear equation to generate a navigation path equation that guides the orchard robot's real-time movement. Specifically, the slope of the navigation path is calculated based on the angle bisector principle. To ensure the navigation path is located in a reasonable midpoint between the two tree rows, the slope of the angle bisector that is consistent with the side with the smaller angle between the two lines is selected. The calculation formula is as follows: ; navigation reference point Substitute into the equation of the navigation path line , to obtain the intercept The final navigation path equation is: ; In addition, after the navigation path equation is generated, the path validity is verified simultaneously. The specific verification steps are as follows: Calculate the angle between the left and right tree rows and determine whether the angle is within a reasonable range. If the included angle is within a reasonable range, the heading angle between the navigation path and the horizontal baseline of the image is calculated based on the navigation path equation. Determine whether the heading angle is less than or equal to the safe heading angle threshold; If the heading angle is less than or equal to the safe heading angle threshold, the navigation path is deemed valid, and the navigation path equation is output to the control terminal of the orchard robot. If the included angle exceeds the reasonable included angle range, or the heading angle is greater than the safe heading angle threshold, the navigation path is determined to be invalid, triggering the re-acquisition of images and path replanning. Specifically, in the navigation path After generation, it is necessary to verify whether it meets the safety constraints of actual orchard operations to avoid guiding the robot off-track and causing collisions. First, calculate the tangent of the angle between the left and right tree rows based on their slopes:

[0029] The calculated Convert to included angle Determine whether it falls within the preset reasonable angle range. If the included angle exceeds the range, it indicates that there is a deviation in the recognition of the left and right tree rows in the current frame, and the path result is unreliable. The process is directly triggered to return to the image acquisition stage, reacquire the visual information between the orchard rows, and repeat the complete path extraction process.

[0030] If the included angle meets the requirements, then further calculate the heading angle between the navigation path and the horizontal baseline of the image. Determine whether its absolute value is less than or equal to the preset safety deflection angle threshold. If the conditions are met, the navigation path is confirmed to be valid. The revised navigation path equation is then output to the motion control module of the orchard robot to guide the robot to move along the path. If the deviation angle exceeds the threshold, the path is also determined to be invalid, and the replanning process is initiated.

[0031] Please see Figure 2 A navigation path extraction system, using the above-mentioned orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting, includes: The preprocessing module is used to preprocess the images of the rows of fruit trees in the orchard and output a reference image to characterize the structure of the rows of fruit trees. The feature extraction module is used to enhance the features of the baseline image through multi-scale fusion and attention mechanism, identify the bounding box of the tree trunk, and filter the feature point set of adjacent side fruit tree rows based on the geometric properties of the bounding box. The equation construction module is used to fit the tree row lines on both sides based on the feature point set and the shortest distance criterion to obtain the tree row line equations on the adjacent sides, and record them as the left tree row line equation and the right tree row line equation respectively. The equation-solving module is used to solve the equations of the left and right tree rows, solve for the coordinates of the geometric intersection point, and record the coordinates of the geometric intersection point as the reference point of the navigation path. The equation output module is used to calculate the slope and intercept of the navigation path based on the reference point and the angle bisector principle, and generate navigation path equations to guide the orchard robot's direction of travel.

[0032] The execution flow of the path extraction system described above corresponds to the process of the aforementioned method, and will not be repeated here.

[0033] Please see Figure 3 An electronic device, the electronic device comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the above-described orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting.

[0034] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention. Structures, devices, and operating methods not specifically described or explained in this invention are implemented according to conventional methods in the art unless otherwise specified or limited.

Claims

1. A method for extracting orchard visual navigation paths based on YOLO-DP detector and DSDI fitting, characterized in that: include: By preprocessing the images of fruit tree rows in the orchard, a baseline image for characterizing the structure of fruit tree rows is output. Feature enhancement of the baseline image is performed through multi-scale fusion and attention mechanism, and the bounding box of the tree trunk is identified. The feature point set of adjacent side fruit tree rows is selected based on the geometric properties of the bounding box. Based on the feature point set, the tree row lines on both sides are fitted by the shortest distance criterion to obtain the tree row line equations on adjacent sides, which are recorded as the left tree row line equation and the right tree row line equation respectively. Solve the equations of the left and right tree lines simultaneously, solve for the coordinates of the geometric intersection point, and record the coordinates of the geometric intersection point as the reference point for the navigation path; Based on the reference point, the slope and intercept of the navigation path are calculated using the angle bisector principle, generating a navigation path equation to guide the orchard robot's direction of travel.

2. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: The step of preprocessing images of the rows of fruit trees in the orchard to output a reference image for characterizing the row structure of the fruit trees includes: The original images of fruit trees were processed by grayscale conversion, filtering, and edge enhancement to suppress interference from lighting and foliage shading. Adaptive histogram equalization is used to improve the image contrast between fruit trees, and morphological closing operations are combined to fill the broken areas at the edges of the tree trunks. The processed image is binarized and segmented to extract the connected regions of the tree trunk, and the initial tree trunk outline is generated by fitting the minimum bounding rectangle. The initial tree trunk outline is screened to remove noise regions with an area smaller than a preset screening threshold, and vertical outlines with an area larger than the preset threshold and an aspect ratio that meets the vertical characteristics are retained as valid tree trunk candidate regions. The valid candidate tree trunk regions are mapped back to the original image coordinate system to generate a reference image with spatial consistency.

3. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: The steps of enhancing the features of the reference image through multi-scale fusion and attention mechanisms, identifying the bounding boxes of the tree trunks, and filtering the feature point sets of adjacent lateral fruit tree rows based on the geometric properties of the bounding boxes include: A YOLO-DP depth detection network is pre-constructed, and end-to-end target detection is performed on the benchmark image based on the YOLO-DP depth detection network to output the detection box of the fruit tree trunk; Non-maximum suppression is applied to the detection boxes to remove redundant boxes with an overlap exceeding the allowable overlap threshold. Then, based on the coordinates of the center point of the detection box and the direction of the main axis of the image, the relative azimuth angle of each fruit tree trunk in the inter-row space is calculated. Based on the relative azimuth angle, the detection boxes are clustered into left and right tree clusters. Detection boxes with azimuth angles located in the left half of the image are classified into the left tree cluster candidate set, and detection boxes with azimuth angles located in the right half of the image are classified into the right tree cluster candidate set. The coordinates of the bottom center point of each detection box are extracted from the candidate sets of the left and right tree rows respectively as feature points representing the direction of the tree rows, and then summarized into a feature point set of adjacent side fruit tree rows.

4. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 3, characterized in that: The pre-built YOLO-DP deep detection network includes the following steps: The YOLO11s network structure is used as the basic network framework, and a DAC feature fusion architecture is integrated on the basic network framework. The DAC feature fusion architecture includes a dynamic sampling scale feature fusion module, an adaptive multi-scale feature fusion module, and a channel and position attention mechanism. The channel dimension of feature maps at different levels is unified by a dynamic sampling scale feature fusion module, and spatial resolution is aligned by dynamic upsampling to preserve low-level detail information. The adaptive multi-scale feature fusion module divides the feature map into feature map patches of multiple sizes, and achieves adaptive weighted fusion of multi-scale features through hybrid pooling downsampling and dynamic upsampling operations. By employing channel and position attention mechanisms, the fused feature map is subjected to dual attention weighting to output an enhanced multi-scale feature representation, thereby strengthening the ability to distinguish tree trunk edges and occluded areas. The baseline images are classified into training sample set, validation sample set and test sample set. The improved YOLO-DAC network is trained using the training sample set, which contains baseline images under various seasons, lighting conditions and degree of foliage occlusion. The adaptive amplitude pruning strategy applied to the trained YOLO-DAC network is compressed to reduce the number of parameters and computational complexity of the YOLO-DAC network, thus generating a lightweight YOLO-DP detector.

5. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: The step of fitting the tree row lines on both sides based on the feature point set and using the shortest distance criterion to obtain the equations of the fruit tree row lines on adjacent sides includes: The feature point set is classified into the left tree row feature point set and the right tree row feature point set, and the left center coordinates and right center coordinates of the left tree row feature point set and the right tree row feature point set are calculated respectively; Translate the feature point set of the left tree row and the feature point set of the right tree row respectively, so that the left center coordinate and the right center coordinate become the origin, and obtain a new point set; The shortest distance criterion is used to fit the equation of a straight line to the new point set. The slope parameter and intercept parameter are obtained by minimizing the sum of squares of the distances from the points to the line. The slope parameter includes the left slope parameter corresponding to the left tree row and the right slope parameter corresponding to the right tree row. Substituting the slope and intercept parameters back into the original coordinate system, we obtain the equations for the left and right tree rows.

6. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: The steps of simultaneously solving the equations of the left and right tree lines, determining the coordinates of the geometric intersection point, and recording the coordinates of the geometric intersection point as the reference point of the navigation path include: Combine the equations of the left and right tree rows to form a system of equations. The simultaneous equations are rearranged and solved by algebraic transformations to obtain the expression for the x-coordinate of the intersection point. Then, the x-coordinate of the intersection point is substituted into the equation of the left or right tree row to solve for the y-coordinate of the intersection point. Combine the x-coordinate and y-coordinate of the intersection point into a two-dimensional coordinate pair and record it as the navigation reference point in the current image frame.

7. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: The step of calculating the slope and intercept of the navigation path based on a reference point using the angle bisector principle to generate a navigation path equation to guide the orchard robot's direction of travel includes: Based on the slope parameters of the left and right tree lines, the slope parameters of the navigation path are calculated using the angle bisector principle and recorded as the navigation path slope. Based on the navigation reference point and the slope of the navigation path, calculate the intercept parameter of the navigation path and record it as the navigation path intercept; The slope and intercept of the navigation path are combined into a linear equation to generate a navigation path equation that guides the orchard robot's real-time movement.

8. The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to claim 1, characterized in that: After the navigation path equation is generated, the path validity is verified simultaneously. The specific verification steps are as follows: Calculate the angle between the left and right tree rows and determine whether the angle is within a reasonable range. If the included angle is within a reasonable range, the heading angle between the navigation path and the horizontal baseline of the image is calculated based on the navigation path equation. Determine whether the heading angle is less than or equal to the safe heading angle threshold; If the heading angle is less than or equal to the safe heading angle threshold, the navigation path is deemed valid, and the navigation path equation is output to the control terminal of the orchard robot. If the included angle exceeds the reasonable included angle range, or the heading angle is greater than the safe heading angle threshold, the navigation path is determined to be invalid, triggering the re-acquisition of images and path replanning.

9. A navigation path extraction system, characterized in that, The orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting according to any one of claims 1 to 8 includes: The preprocessing module is used to preprocess the images of the rows of fruit trees in the orchard and output a reference image to characterize the structure of the rows of fruit trees. The feature extraction module is used to enhance the features of the baseline image through multi-scale fusion and attention mechanism, identify the bounding box of the tree trunk, and filter the feature point set of adjacent side fruit tree rows based on the geometric properties of the bounding box. The equation construction module is used to fit the tree row lines on both sides based on the feature point set and the shortest distance criterion to obtain the tree row line equations on the adjacent sides, and record them as the left tree row line equation and the right tree row line equation respectively. The equation-solving module is used to solve the equations of the left and right tree rows, solve for the coordinates of the geometric intersection point, and record the coordinates of the geometric intersection point as the reference point of the navigation path. The equation output module is used to calculate the slope and intercept of the navigation path based on the reference point and the angle bisector principle, and generate navigation path equations to guide the orchard robot's direction of travel.

10. An electronic device, characterized in that: The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the orchard visual navigation path extraction method based on YOLO-DP detector and DSDI fitting as described in any one of claims 1 to 8.