Introducing the concept of mathematical morphology [15,16,17,18,19] to the image edge detection operator can overcome the shortcomings of the classical operator [20,21,22] and can greatly reduce the calculation amount. This paper proposes an improved anti-noise morphology algorithm for image navigation line extraction, which selects a pair of smaller-scale structuring elements for further anti-noise processing to extract an image navigation line based on the edge feature.
In the mathematical morphology algorithm, structuring elements should be selected according to actual needs. Small-scale structuring elements can make the extracted image edges more detailed and coherent, and obtain more accurate edge localization, whereas large-scale structuring elements can reflect the large edge contours in the image and have a good noise suppression effect. Therefore, small-scale structuring elements were selected for obtaining complete edges in this paper.
The edge of the image is calculated as follows:
where and are two different structuring elements, shown below.
In Equations (7) and (8), is the image after guided filtering treatment. The anti-noise morphology edge detection operator is given as follows:
Via some ordinary operations, the edge information can be easily obtained from the images of the edges detected by Equations (7) and (8). For detecting more detailed edges, as well as improving the anti-noise ability of under the condition of equal noise, the noise immunity is defined as
where is , is the edge detected by Equation (7), is the edge detected by Equation (8), and is the edge detected by Equation (9).
The tillage soil boundary line extracted by using the algorithm mentioned above is shown in Figure 3b,c shows the boundary line extracted by color space conversion followed by threshold processing. There are remarkable errors at both ends of the navigation line in Figure 3b because of the calculation error caused by the truncation of the image, whereas it is obvious that the truncation error in Figure 3c is significantly improved for navigation line extraction.
The edge processing comparison: (a) original; (b) edge information; (c) processed edge information.
The tractor completed the first returning tillage manually via human driving or tele-operational driving before implementing the autonomous image-aided navigation operation. The navigation line of the tractor was calculated by using a Hough transformation from the processed tillage soil boundary in Figure 3. In the actual operation, the navigation line was attached to one side of the tractor. It was influenced by the angle of view of the camera position, which resulted in an angular deviation between the calculated navigation line and the actual line. For this problem, the transverse line of the tractor was defined as the horizontal line The forward direction line of the tractor deviated in the camera image as shown in Figure 4, where the front lines in the left view and right view are rotated to an acute angle () and an obtuse angle () to the horizontal line .
Direction correction diagram: (a) left view; (b) right view.
For simplifying the adjustment algorithm of the navigation line, the actual direction angle of the tractor was calculated as follows:
where denotes the navigation angle between the tillage soil boundary and the horizontal line of the tractor extracted from the image, is the angle between the front line and the tillage soil boundary, and is the angle between the front line and the horizontal line in the image, equal to and respectively, when the boundary line gets located at the left side and right side of the tractor.
During tractor navigation using the tillage soil boundary line, and are calculated as initialization. Then, the navigation angle is obtained after navigation line extraction from the image.
The tractor needs to turn left if the navigation angle is not more than ; otherwise, it needs to turn right whether the boundary line is located on the left or right side of the tractor. The steering adjustment algorithm flowchart is shown in Figure 5.
Steering adjustment algorithm flowchart.
The detailed algorithm of improved anti-noise morphology is shown in Figure 6.
Improved anti-noise morphological algorithm.
Do you have any questions about this protocol?
Post your question to gather feedback from the community. We will also invite the authors of this article to respond.
Tips for asking effective questions
+ Description
Write a detailed description. Include all information that will help others answer your question including experimental processes, conditions, and relevant images.