Automatic advancing control method for agricultural robot
By performing grayscale processing and node extraction on farmland images collected by agricultural robots, the accuracy and identification problems of agricultural robots when traveling on field ridges are solved, and more efficient field ridge travel control is achieved.
Patent Information
- Application Number
- CN202510307679.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When agricultural robots advance on the ridges, it is difficult for them to adapt to complex terrain and changing environments, resulting in travel deviations or collisions, and it is difficult to accurately identify the ridge areas.
The camera of the agricultural robot collects colored operation images of the farmland area and performs grayscale processing. All forward nodes in the grayscale operation image are extracted as the forward area of the field ridge, and smooths the forward area to determine the forward direction.
It realizes accurate identification and travel of agricultural robots on the ridges, improves the accuracy and efficiency of travel, and overcomes the shortcomings of traditional methods.
Smart Images

Figure CN119828571A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to an automatic forward control method for an agricultural robot. Background Art
[0002] In modern agriculture, agricultural robots are increasingly used, and they play an important role in farmland operations. However, when agricultural robots move forward on the ridges of the fields, they still face some challenges and shortcomings.
[0003] When traditional agricultural robots move forward on the ridges of the fields, they often rely on preset paths or manual operations to control their direction of travel. This method has many shortcomings. First, the preset path may not adapt to the complex terrain and changing environment of the farmland, which may cause deviations or collisions of the robot during the movement; second, although manual operation is flexible, the operator's experience and fatigue will directly affect the robot's movement accuracy and efficiency.
[0004] In addition, existing agricultural robots also have certain difficulties in identifying ridge areas. Due to the complexity of the farmland environment, the shape, width and height of the ridges may vary depending on the plot, crop type and growth stage. This makes the robot vulnerable to interference from factors such as light, shadow, weeds and crop occlusion when identifying ridges, resulting in inaccurate or failed recognition.
[0005] In summary, there are still many challenges and shortcomings when agricultural robots move forward on ridges, and an intelligent and adaptive forward automatic control method provides an effective way to solve these problems. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes an automatic forward control method for an agricultural robot.
[0007] The technical solution of the present invention is: an agricultural robot forward automatic control method comprises the following steps:
[0008] S1. Using the camera of the agricultural robot to collect color operation images of the farmland area, and grayscale processing the color operation images to obtain grayscale operation images;
[0009] S2, extracting all the nodes that can be advanced in the grayscale operation image as the field ridge advancement area of the agricultural robot;
[0010] S3. Smoothing the forward area of the ridge to obtain the forward direction of the agricultural robot.
[0011] Furthermore, S2 includes the following sub-steps:
[0012] S21, extracting a forward-able node from the Kth row of the grayscale job image;
[0013] S22, subtract 1 from K, and extract the forward-able nodes in the K-1th row in the grayscale job image according to the forward-able nodes in the Kth row;
[0014] S23, repeat S22 until all the forward nodes of the rows are extracted;
[0015] S24. All nodes that can move forward are used as the field ridge moving area of the agricultural robot.
[0016] The beneficial effect of the above further scheme is that in the present invention, by starting from a specific row (such as the Kth row, which is actually the last row of the grayscale job image), it can be ensured that the extraction process has a clear and controllable starting point, and the forward-able nodes in the K-1th row of the grayscale job image are extracted according to the forward-able nodes in the Kth row, thereby realizing the upward extraction process row by row. The accuracy and efficiency of the extraction can be improved by using the information of the next row to guide the extraction of the current row. Repeating S22 means: extracting the forward-able nodes in the K-2th row of the grayscale job image according to the forward-able nodes in the K-1th row, extracting the forward-able nodes in the K-3th row of the grayscale job image according to the forward-able nodes in the K-2th row, and so on.
[0017] Furthermore, S21 includes the following sub-steps:
[0018] S211, extracting a set of pixels of interest from the Kth row of the grayscale working image;
[0019] S212, calculating similarity weights of all pixels in the Kth row in the grayscale operation image according to the set of pixels of interest;
[0020] S213, taking the pixel point corresponding to the highest similarity weight as the iteration point;
[0021] S214, taking the iteration point as the symmetry point, generating a plurality of symmetric pixel pairs;
[0022] S215, calculating the iteration rate between each symmetric pixel pair and the iteration point, and taking the symmetric pixel pairs and the iteration points whose iteration rates are greater than a threshold as nodes that can be advanced.
[0023] The beneficial effect of the above further scheme is: in the present invention, similarity weights are used to measure the pixel degree of each pixel point and the set of pixels of interest, and the weight is based on the comparison of the grayscale value of the pixel point and the grayscale value in the set of pixels of interest, and is smoothed by an exponential function. In S211, considering that when users place agricultural robots, they usually place agricultural robots in the middle of the ridge, so that the agricultural robots can quickly find the forward path, therefore, the present invention divides the Kth row into three sections, and the pixels in the middle section are used as the set of pixels of interest. In S214, the iteration point is used as the central symmetric point, and the pixels on the left and right sides of the iteration point with the same length are used as a symmetrical pixel pair. By combining grayscale image analysis, pixel selection of interest, similarity weight calculation, symmetry analysis, and conditional screening, the forward-moving node is effectively extracted from the last row of the grayscale operation image. The threshold can be set based on experience.
[0024] Further, in S212, the similarity weight SIMU of the j-th pixel in the K-th row in the grayscale working image is K,j The calculation formula is:
[0025] ;
[0026] In the formula, U represents the set of pixels of interest, G K,j represents the gray value of the jth pixel in the Kth row of the grayscale image, u K,j represents the jth pixel in the Kth row of the grayscale image, G n represents the gray value of the nth pixel in the interest pixel set, exp(·) represents the exponential function, and N represents the number of pixels in the interest pixel set.
[0027] Furthermore, in S215, the iteration rate R between the hth symmetric pixel pair and the iteration point h The calculation formula is:
[0028] ;
[0029] In the formula, G * Represents the gray value of the iteration point, G L Represents the grayscale value of a pixel in the hth symmetrical pixel pair, G R Represents the grayscale value of the other pixel of the h-th symmetrical pixel pair, R h-1 Represents the iteration rate between the h-1th symmetric pixel pair and the iteration point.
[0030] The symmetrical pixel pair closest to the iteration point is taken as the first symmetrical pixel pair.
[0031] Further, S22 includes the following sub-steps:
[0032] S221, constructing a neighbor matrix for each pixel point in the K-1th row according to the forwardable nodes in the Kth row;
[0033] S222, generating a forward threshold according to all neighbor matrices;
[0034] S223. Pixels in the K-1th row whose grayscale values are greater than the advancing threshold are taken as the advancing nodes in the K-1th row.
[0035] The beneficial effect of the above further solution is that in the present invention, the construction of the neighbor matrix helps to analyze the relationship between each pixel in the current row and the surrounding pixels in the next row, and the feasibility of each pixel can be evaluated more accurately. The generation of the forward threshold is based on the analysis of the neighbor matrix to ensure that the extracted nodes meet the standards.
[0036] Further, in S221, the neighbor matrix X of the j-th pixel in the K-1-th row is K-1,j The expression is:
[0037] ;
[0038] In the formula, G K-1,j represents the gray value of the j-th pixel in the K-1-th row, G K,j+1 represents the gray value of the j+1th pixel in the Kth row, G K,j-1 represents the gray value of the j-1th pixel in the Kth row, G K,j Represents the grayscale value of the j-th pixel in the K-th row.
[0039] Furthermore, in S222, the calculation formula of the forward threshold γ is:
[0040] ;
[0041] In the formula, ||·||2 represents the F2 norm of the matrix, X K-1,j represents the neighbor matrix of the j-th pixel in the K-1-th row, J represents the number of pixels in each row, and c represents a constant.
[0042] The beneficial effects of the present invention are as follows: the present invention collects color working images of the farmland area through a camera and performs grayscale processing to simplify image information and reduce calculations; extracts all forward-movable nodes, i.e., ridge areas, from the grayscale working images as the basis for the robot's advancement; and smoothes the forward areas to obtain a more accurate and stable forward direction; the present invention can overcome the shortcomings of traditional methods, accurately identify the ridge parts of the farmland area, facilitate control of the direction of the agricultural robot's movement on the ridges, and improve the accuracy and efficiency of the agricultural robot's advancement on the ridges. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1Flowchart of the automatic control method for the agricultural robot forward movement. DETAILED DESCRIPTION
[0044] The embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
[0045] like Figure 1 As shown, the present invention provides an agricultural robot forward automatic control method, comprising the following steps:
[0046] S1. Using the camera of the agricultural robot to collect color operation images of the farmland area, and grayscale processing the color operation images to obtain grayscale operation images;
[0047] S2, extracting all the nodes that can be advanced in the grayscale operation image as the field ridge advancement area of the agricultural robot;
[0048] S3. Smoothing the forward area of the ridge to obtain the forward direction of the agricultural robot.
[0049] In this embodiment of the present invention, S2 includes the following sub-steps:
[0050] S21, extracting a forward-able node from the Kth row of the grayscale job image;
[0051] S22, subtract 1 from K, and extract the forward-able nodes in the K-1th row in the grayscale job image according to the forward-able nodes in the Kth row;
[0052] S23, repeat S22 until all the forward nodes of the rows are extracted;
[0053] S24. All nodes that can move forward are used as the field ridge moving area of the agricultural robot.
[0054] In the present invention, by starting from a specific row (such as the Kth row, which is actually the last row of the grayscale job image), it can be ensured that the extraction process has a clear and controllable starting point, and the forward-able nodes in the K-1th row of the grayscale job image are extracted according to the forward-able nodes in the Kth row, thereby realizing the upward extraction process row by row. The accuracy and efficiency of the extraction can be improved by using the information of the next row to guide the extraction of the current row. Repeating S22 means: extracting the forward-able nodes in the K-2th row of the grayscale job image according to the forward-able nodes in the K-1th row, extracting the forward-able nodes in the K-3th row of the grayscale job image according to the forward-able nodes in the K-2th row, and so on.
[0055] In the embodiment of the present invention, S21 includes the following sub-steps:
[0056] S211, extracting a set of pixels of interest from the Kth row of the grayscale working image;
[0057] S212, calculating similarity weights of all pixels in the Kth row in the grayscale operation image according to the set of pixels of interest;
[0058] S213, taking the pixel point corresponding to the highest similarity weight as the iteration point;
[0059] S214, taking the iteration point as the symmetry point, generating a plurality of symmetric pixel pairs;
[0060] S215, calculating the iteration rate between each symmetric pixel pair and the iteration point, and taking the symmetric pixel pairs and the iteration points whose iteration rates are greater than a threshold as nodes that can be advanced.
[0061] In the present invention, similarity weights are used to measure the pixel degree of each pixel point and the set of pixels of interest. The weight is based on the comparison of the grayscale value of the pixel point with the grayscale value in the set of pixels of interest, and is smoothed by an exponential function. In S211, considering that when users place agricultural robots, they usually place them in the middle of the ridge, so that the agricultural robots can quickly find the forward path, therefore, the present invention divides the Kth row into three sections, and takes the pixels in the middle section as the set of pixels of interest. In S214, the iteration point is taken as the central symmetric point, and the pixels on the left and right sides of the iteration point with the same length are taken as a symmetrical pixel pair. By combining grayscale image analysis, pixel selection of interest, similarity weight calculation, symmetry analysis, and conditional screening, the forward-moving nodes are effectively extracted from the last row of the grayscale operation image. The threshold can be set based on experience.
[0062] In the embodiment of the present invention, in S212, the similarity weight SIMU of the j-th pixel in the K-th row in the grayscale working image is K,j The calculation formula is:
[0063] ;
[0064] In the formula, U represents the set of pixels of interest, G K,j represents the gray value of the jth pixel in the Kth row of the grayscale image, u K,j represents the jth pixel in the Kth row of the grayscale image, G n represents the gray value of the nth pixel in the interest pixel set, exp(·) represents the exponential function, and N represents the number of pixels in the interest pixel set.
[0065] In the embodiment of the present invention, in S215, the iteration rate R between the hth symmetric pixel pair and the iteration point h The calculation formula is:
[0066] ;
[0067] In the formula, G *Represents the gray value of the iteration point, G L Represents the grayscale value of a pixel in the hth symmetrical pixel pair, G R Represents the grayscale value of the other pixel of the h-th symmetrical pixel pair, R h-1 Represents the iteration rate between the h-1th symmetric pixel pair and the iteration point.
[0068] The symmetrical pixel pair closest to the iteration point is taken as the first symmetrical pixel pair.
[0069] In this embodiment of the present invention, S22 includes the following sub-steps:
[0070] S221, constructing a neighbor matrix for each pixel point in the K-1th row according to the forwardable nodes in the Kth row;
[0071] S222, generating a forward threshold according to all neighbor matrices;
[0072] S223. Pixels in the K-1th row whose grayscale values are greater than the advancing threshold are taken as the advancing nodes in the K-1th row.
[0073] In the present invention, the construction of the neighbor matrix helps to analyze the relationship between each pixel in the current row and the surrounding pixels in the next row, and can more accurately evaluate the feasibility of each pixel. The generation of the forward threshold is based on the analysis of the neighbor matrix to ensure that the extracted nodes meet the standards.
[0074] In the embodiment of the present invention, in S221, the neighbor matrix X of the j-th pixel in the K-1-th row is K-1,j The expression is:
[0075] ;
[0076] In the formula, G K-1,j represents the gray value of the j-th pixel in the K-1-th row, G K,j+1 represents the gray value of the j+1th pixel in the Kth row, G K,j-1 represents the gray value of the j-1th pixel in the Kth row, G K,j Represents the grayscale value of the j-th pixel in the K-th row.
[0077] In the embodiment of the present invention, in S222, the calculation formula of the advancement threshold γ is:
[0078] ;
[0079] In the formula, ||·||2 represents the F2 norm of the matrix, X K-1,j represents the neighbor matrix of the j-th pixel in the K-1-th row, J represents the number of pixels in each row, and c represents a constant.
[0080] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. An automatic control method for advancing an agricultural robot, characterized in that: The following steps are involved: S1. Using the camera of the agricultural robot to collect color operation images of the farmland area, and grayscale processing the color operation images to obtain grayscale operation images; S2, extracting all the nodes that can be advanced in the grayscale operation image as the field ridge advancement area of the agricultural robot; S3. Smoothing the forward area of the ridge to obtain the forward direction of the agricultural robot.
2. The agricultural robot automatic forward control method according to claim 1, characterized in that: The S2 comprises the following sub-steps: S21, extracting a forward-able node from the Kth row of the grayscale job image; S22, subtract 1 from K, and extract the forward-able nodes in the K-1th row in the grayscale job image according to the forward-able nodes in the Kth row; S23, repeat S22 until all the forward nodes of the rows are extracted; S24. All nodes that can move forward are used as the field ridge moving area of the agricultural robot.
3. The agricultural robot forward automatic control method according to claim 2, characterized in that: The S21 comprises the following sub-steps: S211, extracting a set of pixels of interest from the Kth row of the grayscale working image; S212, calculating similarity weights of all pixels in the Kth row in the grayscale operation image according to the set of pixels of interest; S213, taking the pixel point corresponding to the highest similarity weight as the iteration point; S214, taking the iteration point as the symmetry point, generating a plurality of symmetric pixel pairs; S215, calculating the iteration rate between each symmetric pixel pair and the iteration point, and taking the symmetric pixel pairs and the iteration points whose iteration rates are greater than a threshold as nodes that can be advanced.
4. The agricultural robot automatic forward control method according to claim 3, characterized in that: In S212, the similarity weight SIMU of the j-th pixel in the K-th row in the grayscale working image is K,j The calculation formula is: ; In the formula, U represents the set of pixels of interest, G K,j represents the gray value of the jth pixel in the Kth row of the grayscale image, u K,j represents the jth pixel in the Kth row of the grayscale image, G n represents the gray value of the nth pixel in the interest pixel set, exp(·) represents the exponential function, and N represents the number of pixels in the interest pixel set.
5. The agricultural robot forward automatic control method according to claim 3, characterized in that: In S215, the iteration rate R between the hth symmetric pixel pair and the iteration point h The calculation formula is: ; In the formula, G * Represents the gray value of the iteration point, G L Represents the grayscale value of a pixel in the hth symmetrical pixel pair, G R Represents the grayscale value of the other pixel of the h-th symmetrical pixel pair, R h-1 Represents the iteration rate between the h-1th symmetric pixel pair and the iteration point.
6. The agricultural robot forward automatic control method according to claim 2, characterized in that: The S22 comprises the following sub-steps: S221, constructing a neighbor matrix for each pixel point in the K-1th row according to the forwardable nodes in the Kth row; S222, generating a forward threshold according to all neighbor matrices; S223. Pixels in the K-1th row whose grayscale values are greater than the advancing threshold are taken as the advancing nodes in the K-1th row.
7. The method for automatically controlling the advancement of an agricultural robot according to claim 6, characterized in that: In S221, the neighbor matrix X of the j-th pixel in the K-1-th row K-1,j The expression is: ; In the formula, G K-1,j represents the gray value of the j-th pixel in the K-1-th row, G K,j+1 represents the gray value of the j+1th pixel in the Kth row, G K,j-1 represents the gray value of the j-1th pixel in the Kth row, G K,j Represents the grayscale value of the j-th pixel in the K-th row.
8. The agricultural robot forward automatic control method according to claim 6, characterized in that: In S222, the calculation formula of the forward threshold γ is: ; In the formula, ||·||2 represents the F2 norm of the matrix, X K-1,j represents the neighbor matrix of the j-th pixel in the K-1-th row, J represents the number of pixels in each row, and c represents a constant.
Citation Information
Patent Citations
Unmanned aerial vehicle flight control method and system for plant protection based on farmland image feature identification
CN107633202A