Planting machine navigation path correction and obstacle detection method based on machine vision

Through the machine vision-based planting machinery navigation path correction and obstacle detection method, the path deviation and obstacle misdetection problems of agricultural machinery when operating on slopes are solved, high-precision navigation and real-time control are achieved, and the operating efficiency and safety of agricultural machinery in complex environments are improved.

CN120628084APending Publication Date: 2025-09-12YANCHENG INST OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510512986.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing agricultural machinery navigation technology has large path deviation when operating on slopes, low boundary recognition rate under strong light, and high obstacle detection false detection rate, which cannot meet real-time control requirements and leads to low operating efficiency.

Method used

A machine vision-based planting machinery navigation path correction and obstacle detection method is adopted. Dynamic lighting enhancement and real-time image acquisition are achieved through the K230 single-chip camera and K230 image processing unit. The HSV-V grayscale enhancement model, dynamic threshold binarization and composite morphological filtering are combined to perform field ridge boundary detection and obstacle detection. Linear regression boundary fitting and rectangle overlap analysis are used to calculate navigation parameters and verify obstacles.

Benefits of technology

In farmland scenes with alternating strong light and shadow, the accuracy of ridge boundary recognition is improved by more than 40%, the angle deviation detection accuracy reaches ±0.5°, the obstacle detection false alarm rate is less than 8%, and 30fps real-time processing is supported, significantly improving the robustness and operating efficiency of autonomous navigation of agricultural machinery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120628084A_ABST
    Figure CN120628084A_ABST
Patent Text Reader

Abstract

The invention belongs to the crossing field of agricultural machinery automation and computer vision technology, and particularly relates to a planting machinery navigation path correction and obstacle detection method based on machine vision. Comprising the following steps: an image acquisition stage, an image preprocessing stage, a field ridge boundary detection stage, a navigation parameter calculation stage, an obstacle detection and space verification stage, and a multi-modal output and decision feedback stage. Based on embedded equipment, the problems of fuzzy boundary recognition and high obstacle false detection rate of a traditional navigation method in a complex farmland ridge environment and the problems of high requirements of a deep learning scheme on resources and computing power, high memory consumption and the like are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the intersection field of agricultural machinery automation and computer vision technology, and in particular to a method for correcting the navigation path and detecting obstacles of planting machinery based on machine vision. Background Art

[0002] An analysis of the limitations of traditional agricultural machinery navigation and the shortcomings of existing technologies revealed that when operating on slopes (slopes > 8°), the human eye's perception of ridge curvature can reach ±15%, causing path deviation rates to rise to 12%-18%. After two hours of continuous operation, the standard deviation of the driver's centering error increased from ±5cm to ±15cm, requiring frequent stops for corrections.

[0003] Existing visual navigation solutions have technical bottlenecks. In strong lighting conditions (>80klux), traditional grayscale algorithms (such as weighted averaging) overexpose road areas, reducing boundary recognition rates to 61.3%. Interlaced shadow areas (such as tree shading) cause binarization faults, resulting in a path fitting interruption rate exceeding 40%. Fixed-threshold area filtering (e.g., a 500-pixel threshold) is unable to distinguish between crop residue (300-800 pixels in area) and real obstacles, resulting in a false detection rate as high as 34.7%. Traditional IoU fusion algorithms fail to merge irregular obstacles (such as scattered straw piles), resulting in repeated counting of the same obstacle. Hough transform-based line detection methods have fitting angle errors exceeding ±3° on curved paths (radius of curvature <15m). When edge tracking algorithms are affected by noise, the number of boundary breakpoints increases by 2-3 times, causing path jumps.

[0004] The inference delay of deep learning solutions (such as U-Net segmentation) on embedded devices is greater than 200ms, which cannot meet the real-time control requirements of agricultural machinery operating speeds of 3-5m / s; the CPU usage of complex algorithms (such as particle filtering) is greater than 70%, causing multi-tasking systems to freeze.

[0005] These flaws create a vicious cycle: light sensitivity leads to unstable feature extraction, which in turn causes accumulated path modeling errors to cause heading deviation, which in turn triggers false obstacle avoidance errors, which in turn leads to frequent braking and reduced operational efficiency. Field data shows that traditional solutions achieve less than 65% of effective operating time in typical farmland ridge environments, severely hindering the implementation of precision agriculture.

[0006] This invention is proposed to address this technological gap. Through a machine vision-based planting machinery navigation path correction and obstacle detection method and lightweight algorithm design, a highly reliable and low-latency agricultural machinery autonomous navigation system is constructed, directly addressing the core pain points of the industry.

[0007] The embedded planting machinery navigation path correction and obstacle detection system based on machine vision consists of the following core modules, achieving high-precision navigation through deep collaboration of algorithms, hardware, and control:

[0008] The visual perception module hardware consists of a K230 single-chip camera (GC2093 / 1080P) and a K230 image processing unit (with integrated 2TOPS NPU acceleration), which can achieve dynamic lighting enhancement and real-time image acquisition.

[0009] The path modeling module uses the K230 dual RISC-V core (Core0: feature extraction, Core1: regression calculation) to extract boundary points and calculate heading deviations.

[0010] The obstacle detection module is hardware accelerated by K230 NPU parallel computing (10×10 grid sampling).

[0011] The communication and diagnosis module integrates 2.4G WiFi wireless network for real-time transmission. Summary of the Invention

[0012] The purpose of the present invention is to solve the problems existing in the prior art and to propose a method for correcting the navigation path and detecting obstacles of a planting machine based on machine vision.

[0013] In order to achieve the above object, the present invention adopts the following technical solutions:

[0014] A method for correcting the path of a planting machine navigation and detecting obstacles based on machine vision includes the following steps:

[0015] Step 1: Image acquisition: The PLC-integrated camera on the planting machine captures the farmland ridge scene in real time to obtain the ridge image;

[0016] Step 2: Image preprocessing: The ridge image is imported into the HSV-V grayscale enhancement model for grayscale conversion to form an original grayscale image. Then, the original grayscale image is converted into a black and white binary image through dynamic threshold binarization. Finally, a composite morphological filter chain operation is performed to obtain a preliminary processed image of the ridge.

[0017] Step 3: Field ridge boundary detection: Based on the preliminary ridge image processing, a linear regression boundary fitting model is constructed through bidirectional boundary feature point extraction and left and right boundary scanning, and finally the boundary contour line of the field ridge is obtained;

[0018] Step 4: Navigation parameter calculation phase: Based on the boundary contour lines of the ridge, the left and right boundary equations are used to obtain the image theoretical center auxiliary line and the image center line. At the same time, the heading deviation of the planting machinery is calculated to obtain the deviation angle of the agricultural machinery path;

[0019] Step 5: Obstacle detection and spatial verification: Obstacles are marked using the ridge image obtained in step 1. After marking, spatial projection verification is performed to determine the obstacles.

[0020] Step 6: Information feedback stage: The agricultural machinery path deviation angle information in step 4 and the obstacle marking information in step 5 are transmitted to the PLC motor control module, which adjusts the heading of the planting machinery and issues obstacle warning information.

[0021] As a further preferred solution, the image preprocessing stage includes HSV-V grayscale enhancement model, dynamic threshold binarization, and composite morphological filter chain composite operations;

[0022] By performing nonlinear enhancement on the V channel, the pixel values ​​are expanded to [0,510] and then truncated to [0,255] to improve the contrast of the low-light area. If the proportion of highlight pixels (value 255) exceeds 50%, inverse enhancement is performed:

[0023] gray_image=2×(255-V)

[0024] Variable Description:

[0025] gray_image: receives grayscale image data and only retains black and white light and dark information;

[0026] V: brightness channel in HSV color space, with a value range of [0,255]), reflecting the brightness of the pixel;

[0027] Function: Suppress overexposed areas and restore dark details covered by strong light;

[0028] Then, dynamic threshold binarization and morphological optimization are used, adaptive threshold selection is performed based on grayscale histogram distribution, and adaptive illumination changes are adopted to avoid over-segmentation or under-segmentation caused by fixed thresholds, ensuring stable segmentation under different illumination conditions.

[0029] Automatically select the segmentation threshold T:

[0030]

[0031] Variable Description:

[0032] Hist(t): frequency statistics of pixel value t in the grayscale image;

[0033] T: Automatically select the gray value with the largest histogram change rate as the segmentation threshold;

[0034] Through the composite morphological filter chain operation, opening operation-closing operation-area filtering, the road connectivity is optimized and the interference of other factors on the image is reduced.

[0035] As a further preferred solution, in the ridge boundary detection stage, the boundary points that meet the differential filtering conditions are retained through bidirectional boundary feature point extraction and left and right boundary scanning paths. The boundary point information is substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line.

[0036] By extracting bidirectional boundary feature points and scanning row by row along the image height, the center line of the image is first defined: the vertical center line of the image is determined as the starting point of the scan. Starting from the center line of the image, the image is scanned to the left to find the first non-zero pixel point; this point is used as the left candidate boundary point. Similarly, the image is scanned to the right to find the first non-zero pixel point, and this point is used as the right candidate boundary point; the above bidirectional search process is repeated for each row to generate an initial boundary point set containing all candidate boundary points; the coordinates of each boundary point are recorded; for the boundary point set on each side, the column coordinate difference of the boundary points between adjacent rows is calculated respectively; a threshold is set. If the column coordinate difference between adjacent rows exceeds the threshold, the boundary point is considered an outlier; these outliers are eliminated, and the boundary points that meet the differential filtering conditions are retained to generate the left and right boundary point sets;

[0037] The left and right boundary point sets are further fitted, and the vertical coordinates of the boundary points are used as independent variables and the horizontal coordinates as dependent variables are substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line.

[0038] x=β1·y+β0+∈;

[0039] Variable Description:

[0040] β1: Slope (boundary line direction coefficient)

[0041] β0: intercept (starting position of the boundary line)

[0042] ∈: error term.

[0043] As a further preferred solution, the navigation parameter calculation stage includes the calculation of the image theoretical center auxiliary line and the image center line, as well as the calculation of the angle deviation;

[0044] Using the ridge boundary contour line, output the left and right boundary equations:

[0045] x L =a L y+b L (left border)

[0046] x R =a R y+b R (right border)

[0047] When the slope of the left boundary line is 0.5 and the intercept of the left boundary line is 100; the slope of the right boundary line is -0.5 and the intercept of the right boundary line is 500, the left and right boundary equations are constructed:

[0048] Left boundary equation: X L =0.5y+100

[0049] Right boundary equation: X R =-0.5y+500

[0050] Variable Description:

[0051] xL: the horizontal coordinate of the left border in the image coordinate system (pixel position, with the left border of the image as the origin);

[0052] y: the vertical coordinate in the image (pixel row number, increasing downward from the top of the image);

[0053] aL: The slope of the left boundary line, reflecting the degree to which the road bends left / right

[0054] aL>0: the road tilts to the right, aL<0: the road tilts to the left

[0055] bL: The intercept of the left boundary line, which represents the horizontal offset when y = 0 (top of the image)

[0056] xR: the horizontal coordinate of the right border in the image coordinate system

[0057] aR, bR: slope and intercept of the right boundary line, whose physical meanings are similar to those of the left boundary parameters;

[0058] The image-theoretic center auxiliary line equations for the ridges are generated based on the left and right boundary equations:

[0059]

[0060] Variable Description:

[0061] x C : The horizontal coordinate of the auxiliary center line of the field ridge theory in the image;

[0062] The average slope of the auxiliary center line of the ridge theory represents the overall path direction;

[0063] The average intercept of the auxiliary center line of the ridge theory reflects the lateral deviation of the path;

[0064] The center line of the image is the actual center line of the agricultural machinery x = W / 2;

[0065] Variable Description:

[0066] x: actual centerline position in the image.

[0067] W: total width of the image;

[0068] The slope of the center line equation is assisted by the ridge theory The value and the actual center line equation of the agricultural machinery x = W / 2 are reflected on the image to calculate the angle deviation:

[0069]

[0070] Variable Description:

[0071] θ: Heading angle deviation (unit: degree), which represents the angle between the theoretical center line of the ridge and the actual center line of the agricultural machinery

[0072] The average slope of the theoretical center line of the ridge;

[0073] Physical meaning:

[0074] θ>0: The agricultural machine deviates to the right of the expected path; θ<0: The agricultural machine deviates to the left of the expected path

[0075] If |θ|>5°, generate a steering control signal and mark the deviation angle.

[0076] As a further preferred solution, the obstacle detection and space verification stage includes obstacle detection and space verification:

[0077] Obstacle detection: Connected domain analysis and candidate screening, connected domain marking of binary images, screening candidate areas with an area ≥ 900 pixels and a white pixel density > 70%;

[0078] Connected domain screening conditions:

[0079] Area > 900 pixels: filter small area noise (such as crop residue)

[0080] White pixel density > 70%: Make sure the area is a solid obstacle;

[0081] Spatial Verification: Dynamic road mask projection verification constructs a road area mask based on the left and right boundary equations. Spatial projection verification is performed on each candidate obstacle. 10×10 grid points within the obstacle are sampled and the proportion within the road mask is counted. If the proportion is ≥70%, it is determined to be a valid obstacle.

[0082] The spatial projection verification is as follows

[0083] 70% of the pixels are within the road mask: Avoid partial occlusion misjudgment;

[0084] In obstacle detection tasks, a single object may be segmented into multiple adjacent rectangular boxes due to partial occlusion or detection algorithm errors. The core goal of rectangle overlap analysis is to generate more accurate obstacle representations by merging adjacent or highly overlapping rectangular boxes, thereby reducing false detections and duplicate detections. Adjacent obstacles are merged using rectangle overlap analysis (IoU > 0.3 or center-to-center distance < 20 pixels), annotated with yellow rectangular boxes in the original image, and the number of obstacles is updated in real time.

[0085] Rectangular overlap analysis variable description:

[0086] IoU (Intersection over Union) > 0.3:

[0087]

[0088] Center distance < 20 pixels:

[0089]

[0090] Where (x1, y1) and (x2, y2) are the coordinates of the centers of the two rectangles.

[0091] As a further preferred solution, in the information feedback stage:

[0092] Through the output of deflection parameters, the path deviation angle (accuracy 0.01°), boundary fitting degree, obstacle location and number are output in real time;

[0093] Then perform visual enhancement overlay and dynamic rendering on the original image:

[0094] The solid red lines mark the left and right boundaries;

[0095] The green dotted line marks the theoretical center line of the ridge;

[0096] The blue vertical line marks the center line of the image, which is the actual center line of the agricultural machinery;

[0097] Yellow boxes mark obstacles;

[0098] Superimpose angle deviation text (format: θ = ±X.XX°) and obstacle count.

[0099] Beneficial effects: The present invention is based on an embedded device. In a farmland scene with alternating strong light / shadow, the accuracy of ridge boundary recognition is improved by more than 40% compared with the traditional algorithm. This improvement ensures the navigation capability of agricultural machinery under uncertain conditions. The angle deviation detection accuracy reaches ±0.5°, which greatly enhances the precise navigation capability for narrow row operations. This accuracy is particularly important for working roads with compact walking paths, ensuring the effective utilization of crops. The obstacle detection false alarm rate is less than 8%, which reduces the safety hazards caused by misjudgment and improves the continuity and efficiency of agricultural machinery operations. It supports 30fps real-time processing, which solves the problems of fuzzy boundary recognition and high obstacle false detection rate of traditional navigation methods in complex farmland ridge environments, as well as the high resource and computing power requirements and large memory consumption of deep learning solutions. It significantly improves the robustness and environmental adaptability of autonomous navigation of agricultural machinery, can be adapted to a variety of agricultural machinery models, and reduces the hardware dependency cost of the automatic driving system. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] Figure 1 This is a process flow chart of the present invention;

[0101] Figure 2 This is a schematic diagram of ridge angle processing;

[0102] Figure 3 Schematic diagram of obstacle detection. DETAILED DESCRIPTION

[0103] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0104] The present invention discloses a method for correcting the navigation path and detecting obstacles for planting machinery based on machine vision. The method is applicable to agricultural machinery such as rice transplanters and seeders autonomously aligning ridges, correcting paths, and detecting obstacles when sowing crops on ridges. The method is particularly suitable for working environments with regular planting rows, such as rice fields and spinach fields, and especially for sowing on ridges without covering. The method facilitates the implementation of precision agriculture and specifically includes the following steps:

[0105] Step 1: Image acquisition stage: The PLC integrated camera on the planting machinery captures the farmland ridge scene in real time to obtain the ridge image.

[0106] Step 2: Image preprocessing: The ridge image is imported into the HSV-V grayscale enhancement model for grayscale conversion to form an original grayscale image. Then, the original grayscale image is converted into a black and white binary image through dynamic threshold binarization. Finally, a composite morphological filter chain operation is performed to obtain a preliminary processed image of the ridge.

[0107] The image preprocessing stage includes HSV-V grayscale enhancement model, dynamic threshold binarization, and composite morphological filter chain operations;

[0108] By improving the HSV-V channel grayscale, the original BGR image is converted to the HSV color space, and the brightness channel (V channel) is extracted to enhance the boundary road features in the image.

[0109] By performing nonlinear enhancement on the V channel, the pixel values ​​are expanded to [0,510] and then truncated to [0,255] to improve the contrast of the low-light area. If the proportion of highlight pixels (value 255) exceeds 50%, inverse enhancement is performed:

[0110] gray_image=2×(255-V)

[0111] Function: Suppress overexposed areas and restore dark details covered by strong light.

[0112] Then, dynamic threshold binarization and morphological optimization are used, along with adaptive threshold selection based on grayscale histogram distribution and adaptive illumination changes to avoid over-segmentation or under-segmentation caused by fixed thresholds, ensuring stable segmentation under different illumination conditions.

[0113] Traditional binarization methods use a fixed threshold, but this approach doesn't work well in varying lighting conditions. For example, the same threshold might not correctly distinguish the road from the background under bright sunlight or at night. To address this issue, we employ a method that dynamically selects the threshold.

[0114] First, the grayscale histogram shows the frequency of occurrence of different brightness values ​​in an image. By analyzing the histogram, we can understand the image's brightness distribution. We then look for the point in the histogram where the brightness variation is most dramatic; this is the optimal segmentation threshold. This is because at this point, the distinction between "bright" and "dark" parts of the image is most distinct. Because the threshold is dynamically selected based on the image's brightness distribution, it adapts to varying lighting conditions. For example, in low light conditions, the threshold is automatically lowered to better distinguish the road from the background; in brighter light conditions, the threshold is automatically raised to avoid overexposure. If the threshold is set too low, some dark areas in the image will be incorrectly segmented into multiple parts, resulting in the road being overly fragmented. If the threshold is set too high, some bright areas in the image will be incorrectly merged, causing the road and other objects to be incorrectly merged. By dynamically selecting the threshold, we can automatically adjust the threshold based on the specific conditions of the image to avoid both of these situations, thereby achieving more stable segmentation results.

[0115] Automatically select the segmentation threshold T:

[0116]

[0117] Variable Description:

[0118] Hist(t): Frequency statistics of pixel value t in the grayscale image.

[0119] T: Automatically select the grayscale value with the largest histogram change rate as the segmentation threshold.

[0120] After binarization, some noise or holes may appear in the image, affecting the connectivity of the road. To solve this problem, we use a series of morphological operations:

[0121] Opening (erosion followed by dilation): used to remove small noise points in the image while maintaining the shape and size of the road. The opening kernel is a 3×3 cross structure that eliminates isolated noise points (area < 50 pixels).

[0122] Closing operation (dilation followed by erosion): used to fill small holes inside the road, enhance road connectivity, and fill holes inside the road (diameter < 15 pixels).

[0123] Area filtering: removes areas that are too small to further reduce noise interference.

[0124] Through these operations, we can optimize the shape and connectivity of the road, making the road features clearer and more complete.

[0125] Step 3: Field ridge boundary detection: Based on the preliminary ridge image processing, a linear regression boundary fitting model is constructed through bidirectional boundary feature point extraction and left and right boundary scanning, and finally the boundary contour line of the field ridge is obtained;

[0126] In the ridge boundary detection stage, the boundary points that meet the differential filtering conditions are retained through bidirectional boundary feature point extraction and left and right boundary scanning paths. The boundary point information is substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line.

[0127] The implementation process is to extract bidirectional boundary feature points and scan them row by row along the image height. First, the center line of the image is defined: the vertical center line of the image is determined as the starting point of the scan. Starting from the center line of the image, the image is scanned to the left to find the first non-zero pixel point (assuming that the non-zero pixel represents the boundary); this point is used as the candidate boundary point on the left. Similarly, the image is scanned to the right to find the first non-zero pixel point, and this point is used as the candidate boundary point on the right. Repeat the above bidirectional search process for each row to generate an initial boundary point set containing all candidate boundary points; record the coordinates of each boundary point (row number, column number); for the boundary point set on each side, calculate the column coordinate difference of the boundary points between adjacent rows; set a threshold (20 pixels), if the column coordinate difference between adjacent rows exceeds the threshold, the boundary point is considered to be an outlier. Eliminate these outliers and retain the boundary points that meet the differential filtering conditions. Generate left and right boundary point sets;

[0128] The left and right boundary point sets are further fitted to obtain a smoother and more continuous boundary line. The vertical coordinates of the boundary points are used as independent variables and the horizontal coordinates as dependent variables to be substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line.

[0129] We use the ordinate (y-coordinate) of the boundary point as the independent variable (input feature) and the abscissa (x-coordinate) as the dependent variable (target value). We can find a straight line that is as close as possible to all the boundary points.

[0130] x=β1·y+β0+∈;

[0131] Variable Description:

[0132] β1: Slope (boundary line direction coefficient)

[0133] β0: intercept (starting position of the boundary line)

[0134] ∈: error term.

[0135] Step 4: Navigation parameter calculation phase: Based on the boundary contour lines of the ridge, the left and right boundary equations are used to obtain the image theoretical center auxiliary line and the image center line. At the same time, the heading deviation of the planting machinery is calculated to obtain the deviation angle of the agricultural machinery path;

[0136] Using the ridge boundary contour line, output the left and right boundary equations;

[0137] x L =a L y+b L (left border)

[0138] x R =a R y+b R (right border)

[0139] Variable Description:

[0140] xL: the horizontal coordinate of the left border in the image coordinate system (pixel position, with the left border of the image as the origin);

[0141] y: the vertical coordinate in the image (pixel row number, increasing downward from the top of the image);

[0142] aL: The slope of the left boundary line, reflecting the degree to which the road bends left / right

[0143] aL>0: the road tilts to the right, aL<0: the road tilts to the left

[0144] bL: The intercept of the left boundary line, which represents the horizontal offset when y = 0 (top of the image)

[0145] xR: the horizontal coordinate of the right border in the image coordinate system

[0146] aR, bR: The slope and intercept of the right boundary line, the physical meaning is similar to the left boundary parameters

[0147] Generate the image theory center auxiliary line equation of the ridge according to the left and right boundary equations;

[0148] Generate the equation of the center auxiliary line of the ridge theory according to the left and right boundary equations;

[0149]

[0150] Variable Description:

[0151] x C : The horizontal coordinate of the auxiliary center line of the field ridge theory in the image;

[0152] The average slope of the auxiliary center line of the ridge theory represents the overall path direction;

[0153] The average intercept of the auxiliary center line of the ridge theory reflects the lateral deviation of the path;

[0154] The image centerline is the actual centerline of the agricultural machinery (x = W / 2), and the theoretical centerline of the ridge is the geometric centerline of the left and right boundaries, representing the ideal path of the agricultural machinery;

[0155] The slope of the center line equation is assisted by the ridge theory Calculate the angle deviation based on the image reflection of the actual centerline equation of the agricultural machinery x=W / 2:

[0156]

[0157] Variable Description:

[0158] θ: Heading angle deviation (unit: degree), which represents the angle between the theoretical center line of the ridge and the actual center line of the agricultural machinery

[0159] The average slope of the theoretical center line of the ridge;

[0160] Physical meaning:

[0161] θ>0: The agricultural machine deviates to the right of the expected path; θ<0: The agricultural machine deviates to the left of the expected path

[0162] If |θ|>5°, generate a steering control signal and mark the deviation angle.

[0163] Step 5: Obstacle detection and spatial verification: Obstacles are marked using the ridge image obtained in step 1. After marking, spatial projection verification is performed to determine the obstacles.

[0164] Obstacle detection: Connected domain analysis and candidate screening, connected domain marking of binary images, screening candidate areas with an area ≥ 900 pixels and a white pixel density > 70%;

[0165] Connected domain screening conditions:

[0166] Area > 900 pixels: filter small area noise;

[0167] White pixel density > 70%: Make sure the area is a solid obstacle;

[0168] Spatial Verification: Dynamic road mask projection verification. A road area mask is constructed based on the left and right boundary equations. Spatial projection verification is performed on each candidate obstacle. A 10×10 grid of points within the obstacle is sampled and the proportion of points within the road mask is counted. If the proportion is ≥70%, the obstacle is determined to be a valid obstacle.

[0169] Spatial projection verification:

[0170] 70% of the pixels are within the road mask: Avoid partial occlusion misjudgment

[0171] In obstacle detection tasks, a single object may be segmented into multiple adjacent rectangular boxes due to partial occlusion or detection algorithm errors. The core goal of rectangle overlap analysis is to generate more accurate obstacle representations by merging adjacent or highly overlapping rectangular boxes, thereby reducing false detections and duplicate detections. Adjacent obstacles are merged using rectangle overlap analysis (IoU > 0.3 or center-to-center distance < 20 pixels), annotated with yellow rectangular boxes in the original image, and the number of obstacles is updated in real time.

[0172] Rectangular overlap analysis variable description:

[0173] IoU (Intersection over Union) > 0.3:

[0174]

[0175] Center distance < 20 pixels:

[0176]

[0177] Where (x1, y1) and (x2, y2) are the coordinates of the centers of the two rectangles.

[0178] Step 6: Information feedback stage: The agricultural machinery path deviation angle information from step 4 and the obstacle mark information from step 5 are transmitted to the PLC motor control module, which then adjusts the heading of the planting machinery and issues obstacle warning information;

[0179] Through the output of deflection parameters, the path deviation angle (accuracy 0.01°), boundary fitting degree, obstacle location and number are output in real time;

[0180] In the previous steps, the MCU camera outputs the captured image to the MCU processing module. Through the MCU core, the image processing unit can achieve dynamic lighting enhancement, followed by boundary point extraction and heading deviation calculation. Obstacle detection is hardware accelerated through NPU parallel computing (10×10 grid sampling).

[0181] The communication and diagnosis module integrates a 2.4G WiFi wireless network for real-time transmission, which is transmitted to the visualization interface. The visualization interface will output the path deviation angle (accuracy 0.01°), obstacle location and number in real time, and mark them on the original image:

[0182] The solid red lines mark the left and right boundaries;

[0183] The green dotted line marks the theoretical center line of the ridge;

[0184] The blue vertical line marks the center line of the image, which is the actual center line of the agricultural machinery;

[0185] Yellow boxes mark obstacles;

[0186] Superimpose angle deviation text (format: θ = ±X.XX°) and obstacle count.

[0187] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A method for path correction and obstacle detection of planting machinery navigation based on machine vision, characterized in that: The following steps are involved: Step 1: Image acquisition: The PLC-integrated camera on the planting machine captures the farmland ridge scene in real time to obtain the ridge image; Step 2: Image preprocessing: The ridge image is imported into the HSV-V grayscale enhancement model for grayscale conversion to form an original grayscale image. Then, the original grayscale image is converted into a black and white binary image through dynamic threshold binarization. Finally, a composite morphological filter chain operation is performed to obtain a preliminary processed image of the ridge. Step 3: Field ridge boundary detection: Based on the preliminary ridge image processing, a linear regression boundary fitting model is constructed through bidirectional boundary feature point extraction and left and right boundary scanning, and finally the boundary contour line of the field ridge is obtained; Step 4: Navigation parameter calculation phase: Based on the boundary contour lines of the ridge, the left and right boundary equations are used to obtain the image theoretical center auxiliary line and the image center line. At the same time, the heading deviation of the planting machinery is calculated to obtain the deviation angle of the agricultural machinery path; Step 5: Obstacle detection and spatial verification: Obstacles are marked using the ridge image obtained in step 1. After marking, spatial projection verification is performed to determine the obstacles. Step 6: Information feedback stage: The agricultural machinery path deviation angle information in step 4 and the obstacle marking information in step 5 are transmitted to the PLC motor control module, which adjusts the heading of the planting machinery and issues obstacle warning information.

2. The method for path correction and obstacle detection for navigation of planting machinery based on machine vision according to claim 1, characterized in that: The image preprocessing stage includes HSV-V grayscale enhancement model, dynamic threshold binarization, and composite morphological filter chain composite operations; By performing nonlinear enhancement on the V channel, the pixel values ​​are expanded to [0,510] and then truncated to [0,255] to improve the contrast of the low-light area. If the proportion of highlight pixels (value 255) exceeds 50%, inverse enhancement is performed: gray_image=2×(255-V) Variable Description: gray_image: receives grayscale image data and only retains black and white light and dark information; V: brightness channel in HSV color space, with a value range of [0,255]), reflecting the brightness of the pixel; Then, dynamic threshold binarization and morphological optimization are used, adaptive threshold selection is performed based on grayscale histogram distribution, and adaptive illumination changes are adopted to avoid over-segmentation or under-segmentation caused by fixed thresholds, ensuring stable segmentation under different illumination conditions. Automatically select the segmentation threshold T: Variable Description: Hist(t): frequency statistics of pixel value t in the grayscale image; T: Automatically select the gray value with the largest histogram change rate as the segmentation threshold; Through the composite morphological filter chain operation, opening operation-closing operation-area filtering, the road connectivity is optimized and the interference of other factors on the image is reduced.

3. The method for path correction and obstacle detection for navigation of planting machinery based on machine vision according to claim 1, characterized in that: In the ridge boundary detection stage, the boundary points that meet the differential filtering conditions are retained through bidirectional boundary feature point extraction and left and right boundary scanning paths. The boundary point information is substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line. By extracting bidirectional boundary feature points and scanning row by row along the image height, the image centerline is first defined: the vertical centerline of the image is determined as the starting point of the scan. Starting from the image centerline, the image is scanned to the left to find the first non-zero pixel; this point is used as the candidate boundary point on the left. Similarly, the image is scanned to the right to find the first non-zero pixel, which is used as the candidate boundary point on the right; the above bidirectional search process is repeated for each row to generate an initial boundary point set containing all candidate boundary points; the coordinates of each boundary point are recorded; and for the boundary point set on each side, the column coordinate difference of the boundary points between adjacent rows is calculated respectively; Set a threshold. If the column coordinate difference between adjacent rows exceeds the threshold, the boundary point is considered an outlier. Remove these outliers and retain the boundary points that meet the differential filtering conditions to generate the left and right boundary point sets. The left and right boundary point sets are further fitted, and the vertical coordinates of the boundary points are used as independent variables and the horizontal coordinates as dependent variables are substituted into the linear regression boundary fitting model to obtain the ridge boundary contour line: x=β1·y+β0+∈; Variable Description: β1: Slope (boundary line direction coefficient) β0: intercept (starting position of the boundary line) ∈: error term.

4. The method for path correction and obstacle detection for navigation of planting machinery based on machine vision according to claim 1, characterized in that: The navigation parameter calculation stage includes the calculation of the image theoretical center auxiliary line and the image center line, as well as the calculation of the angle deviation; Using the ridge boundary contour line, output the left and right boundary equations: x L =a L y+b L (left border) x R =a R y+b R (right border) Variable Description: xL: the horizontal coordinate of the left boundary in the image coordinate system; y: vertical coordinate in the image; aL: The slope of the left boundary line, reflecting the degree to which the road bends left / right aL>0: the road tilts to the right, aL<0: the road tilts to the left bL: The intercept of the left boundary line, indicating the horizontal offset when y=0 xR: the horizontal coordinate of the right border in the image coordinate system aR, bR: The slope and intercept of the right boundary line, the physical meaning is similar to the left boundary parameters The image-theoretic center auxiliary line equations for the ridges are generated based on the left and right boundary equations: Variable Description: x C : The horizontal coordinate of the auxiliary center line of the field ridge theory in the image; The average slope of the auxiliary center line of the ridge theory represents the overall path direction; The average intercept of the auxiliary center line of the ridge theory reflects the lateral deviation of the path; The center line of the image is the actual center line of the agricultural machinery x = W / 2; Variable Description: x: Actual centerline position in the image. W: total width of the image; The slope of the center line equation is assisted by the ridge theory The value and the actual center line equation of the agricultural machinery x = W / 2 are reflected on the image to calculate the angle deviation: Variable Description: θ: Heading angle deviation (unit: degree), which represents the angle between the theoretical center line of the ridge and the actual center line of the agricultural machinery The average slope of the theoretical center line of the ridge; Physical meaning: θ>0: The agricultural machine deviates to the right of the expected path; θ<0: The agricultural machine deviates to the left of the expected path If |θ|>5°, generate a steering control signal and mark the deviation angle.

5. The method for path correction and obstacle detection of a planting machine navigation system based on machine vision according to claim 1, characterized in that: The obstacle detection and space verification phase includes obstacle detection and space verification: Obstacle detection: Connected domain analysis and candidate screening, connected domain marking of binary images, screening candidate areas with an area ≥ 900 pixels and a white pixel density > 70%; Connected domain screening conditions: Area > 900 pixels: filter small area noise; White pixel density > 70%: Make sure the area is a solid obstacle; Spatial Verification: Dynamic road mask projection verification, constructing a road area mask based on the left and right boundary equations, performing spatial projection verification on each candidate obstacle, sampling a 10×10 grid point within the obstacle, and counting the proportion of points within the road mask; If the proportion is ≥70%, it is determined to be a valid obstacle.

6. The method for path correction and obstacle detection of a planting machine navigation system based on machine vision according to claim 1, characterized in that: The information feedback stage: Through the output of deflection parameters, the path deviation angle, boundary fitting degree, obstacle position and number are output in real time; Then perform visual enhancement overlay and dynamic rendering on the original image: Mark the left and right boundaries; Mark the theoretical center line of the ridge; The center line of the marked image is the actual center line of the agricultural machinery; Mark obstacles; Overlays angle deviation text and obstacle count.

Citation Information

Cited By

  • Non-crop field ridge navigation line extraction method, control method and system

    CN121963124A