An adaptive centering method for a hedge trimming robot

By performing color space adaptive selection and image enhancement in hedge trimming, the minimum circumscribed circle of the hedge is extracted, which solves the problems of low automation and poor detection accuracy in the existing technology, realizes efficient automatic centering of the hedge trimming robot, and improves Improved work efficiency and detection speed.

CN113902816BActive Publication Date: 2024-10-18GUANGXI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111245861.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2024-10-18
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

The existing technology has a low degree of automation in hedge pruning, and is difficult to meet accuracy and real-time performance. The traditional circle detection algorithm does not work well in complex environments, and it is difficult to quickly and accurately achieve automatic centering of the pruning manipulator.

Method used

By obtaining the hedge image from a bird's-eye view, adaptive color space selection, binarization processing and image enhancement are performed, the minimum circumscribed circle of the hedge is extracted to determine the center position, the hedge center coordinates are obtained using the OpenCV function, and the threshold interval and image processing parameters are optimized to Improve detection accuracy.

Benefits of technology

It significantly improves the automation and intelligence level of the hedge pruning robot, quickly and accurately realizes the automatic centering of the pruning manipulator, reduces the tedious manual operation, and improves operating efficiency and detection speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113902816B_ABST
    Figure CN113902816B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive centering method for a hedge trimming robot. First, the color space of an input image is determined, and then the input image is binarized. The binarized image is enhanced, and finally the minimum circumscribed circle of the hedge horizontal plane is obtained, so that the center parameters of the hedge horizontal plane can be determined. Compared with the existing centering technology, the method proposed by the present invention shows a significant improvement in both accuracy and recognition rate. In particular, the algorithm far exceeds other existing circle detection algorithms in terms of detection speed, and can fully meet the real-time requirements. Compared with some other hedge sanitation machines, the present invention, as the key core of the trimmer centering, can greatly improve the automation and intelligence level of the trimmer, quickly and accurately realize the automatic centering function of the trimming manipulator, reduce the tediousness of manual centering, and greatly improve the work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of hedge centering of a hedge trimmer, and in particular to an adaptive centering method of a hedge trimmer robot. Background Art

[0002] With the improvement of people's economic level and the enhancement of environmental awareness, urban greening has entered a stage of rapid development. Vehicle-mounted trimmers with forming cutters are increasingly widely used in the trimming of green landscapes such as highway isolation belts, urban road green belts, and garden ornamental hedges.

[0003] Common hedges are generally rotating bodies, such as cylinders, cones, and spheres. Currently, mechanized equipment for pruning cylindrical hedges is equipped with an L-shaped tool holder that can rotate 360° on the manipulator hand, and mechanized equipment for pruning hedges is equipped with an arc-shaped tool holder. The actuator of the hedge pruning equipment generally works by manually driving a vehicle to the vicinity of the hedge to be pruned, and then manually moving the hand of the manipulator to the center of the hedge, and then the tool installed on the hand rotates and prunes with the center axis of the hedge as the rotation center. This operation method has a very low degree of automation, and the centering process of the manipulator position and the hedge is completely dependent on manual work, mainly by human eyes through video. As a result, this method is not only time-consuming and labor-intensive, but also requires a high level of proficiency for the operator. Therefore, it is difficult to improve the efficiency of hedge pruning and to ensure the quality of pruning.

[0004] Since the center of the horizontal cross section of a cylindrical or spherical hedge is approximately circular, the centering of a hedge trimmer can be regarded as a circle detection problem in a complex environment. Currently, the existing technologies for solving this problem are difficult to meet the requirements of accuracy and real-time performance in the centering process in actual performance:

[0005] Hough transform (HT) circle detection is the most widely used circle detection algorithm. It is generally used to detect when the radius is known and the circle to be detected is a regular circle. However, the outer contour of the hedge extracted is generally incomplete and has a large difference from the regular circle, and the radius is also uncertain. Therefore, the circle detection algorithm based on the Hough principle has poor detection effect, and the unknown radius leads to a long time consumption.

[0006] Random Sample Consensus (RANSAC) can effectively solve the problem of least squares method being affected by individual outliers, but the extracted hedge contour often has many depressions, resulting in serious mean shift. The fitted circle is often very different from the hedge contour, and its randomness easily leads to the failure to find a solution for the circle fitting, resulting in the algorithm crashing.

[0007] Contour matching circle detection generally uses a standard circle contour as a template, and does not require a specified circle radius. Circle contours of different sizes can be detected by adjusting the matching degree. However, the outer contour of a hedge is not a regular circle and has diversity, so it can only meet a very low matching degree, which is easy to cause mismatching;

[0008] Color shape circle detection first separates images of different color channels, then directly performs binarization processing based on the pixel value range, and then detects the circle of each color channel based on the overlap between each pixel block and the minimum circumscribed circle. Finally, all color channel image detection results are summarized. This can effectively detect circles of different colors and prevent missed detections. However, hedges have diverse colors and it is difficult to select a binarization threshold. The algorithm takes a long time to run in complex environments and has poor robustness to lighting. Summary of the invention

[0009] The object of the present invention is to provide an adaptive centering method for a hedge trimming robot, which can greatly improve the automation and intelligence level of the hedge trimming robot and quickly and accurately realize the automatic centering function of the trimming manipulator.

[0010] To achieve the above object, the adaptive centering method of the hedge trimmer robot of the present invention comprises the following steps:

[0011] Step S1, obtaining a hedge image from a bird's-eye view, and extracting a rectangular image containing only hedge information from the image as a template;

[0012] Step S2, converting the hedge image and the template to the same color space, performing histogram comparison on each channel, finding the hedge significant color space, completing the adaptive selection of the color space, taking the channel that can obtain the hedge significant color space as the default analysis channel, and determining the default threshold interval;

[0013] Step S3, binarizing the hedge image to obtain a binary image containing complete hedge information;

[0014] Step S4, enhancing the binary image, aggregating discrete hedge information, and removing noise points;

[0015] Step S5, obtaining the minimum circumscribed circle of the hedge from the image, and calculating the center position information of the hedge according to the minimum circumscribed circle.

[0016] Furthermore, in step S2, the method for determining the default threshold interval is: taking the significant peak of the hedge as the midpoint, expanding 25 to both sides to obtain the corresponding default threshold interval, and if encountering a boundary, performing a translation adjustment while ensuring that the default threshold interval range is 50.

[0017] Furthermore, in step S3, after binarizing the hedge image to obtain a binary image containing complete hedge information, the effect of the binary image is judged according to the total area ratio of all small white blocks in the binary image to the entire image (LW_areaR) and the number of small white blocks (LW_num). The following five situations may occur:

[0018] (1) Insufficient hedge information: LW_areaR < 10%, that is, the distribution of small white blocks does not match the shape of the hedge, and the outer contour of the hedge cannot be seen. It is necessary to perform a positive operation on the binarization parameters and then re-binarize;

[0019] (2) Hedge information is scattered: LW_areaR ≥ 10%, and LW_num> 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen, but there are too many small white blocks, which are easily removed in the image enhancement, resulting in the outer contour of the hedge not being obtained. It is necessary to perform a positive operation on the binarization parameters and then re-binarize;

[0020] (3) Hedge information is complete: LW_areaR ≥ 10%, and LW_num ≤ 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen. Moreover, the area of ​​the small white blocks is large, and the outer contour of the hedge can be obtained after image enhancement, and there is no need to re-binarize;

[0021] (4) Too much background information: 30% ≤ LW_areaR < 50%, and LW_num > 2000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen, but there are too many large-area background information noise points, which easily lead to the fusion of hedge information and background information after image enhancement, resulting in an outer contour of the hedge that is significantly larger than the actual one. It is necessary to perform a negative operation on the binarization parameters and then re-binarize;

[0022] (5) Background information is not separated: LW_areaR ≥ 50%, and LW_num> 1000, that is, the distribution of small white blocks clearly includes the hedge and background information, and it is difficult to see the outer contour of the hedge. This situation often occurs when the hedge information is close to the background information. After image enhancement, the hedge information and the background information will be completely integrated, and the outer contour of the hedge cannot be obtained. It is necessary to perform a negative operation on the binarization parameter and then re-binarize;

[0023] Furthermore, in case (1), the method for performing positive operation on the binary parameters is: first, perform a decreasing operation on the analysis channel, and reduce the analysis channels in order of significance from small to large, until the number of analysis channels is 1; when the number of analysis channels is 1, perform a threshold interval increasing operation, and increase by 10 on both sides of the default threshold interval, until the threshold interval range is 100. If a boundary is encountered, the threshold interval is shifted while the threshold interval range remains unchanged;

[0024] Furthermore, in case (2), the method for performing positive operation on the binarization parameters is as follows: first, the threshold interval of each analysis channel is increased by 10 on both sides of the default threshold interval until the threshold interval range is 100. If a boundary is encountered, the threshold interval is shifted while the threshold interval range remains unchanged, so that the threshold intervals of all analysis channels are 100; then the analysis channel is decreased, and the analysis channels are decreased in order of significance from small to large, until the number of analysis channels is 1;

[0025] Furthermore, in case (4), the method of performing negative operation on the binary parameter is as follows: first, perform a threshold interval reduction operation on each analysis channel, and reduce the threshold interval by 10 on both sides of the default threshold interval in turn until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side far away from the boundary relative to the significant peak of the hedge, then the threshold interval is lowered and shifted to the boundary while the threshold interval remains unchanged, so that the threshold interval of all analysis channels is 10; then perform an analysis channel increment operation, and increase the number of analysis channels in the order of significance from large to small, until the number of analysis channels is 3;

[0026] Furthermore, in case (5), the method of performing negative operation on the binary parameters is as follows: first, perform an analysis channel increment operation, and increase the number of analysis channels in order of significance from large to small, until the number of analysis channels is 3; then perform a threshold interval decrement operation, and decrement the threshold interval by 10 on both sides of the default threshold interval, until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side away from the boundary relative to the significant peak of the hedge, then the threshold interval is lowered and translated to the boundary while the threshold interval remains unchanged, so that the threshold interval of all analysis channels is 10.

[0027] Furthermore, in step S4, OpenCV is used to enhance the binary image, aggregate the discrete hedge information, and remove noise points, including the following steps:

[0028] Step S41, performing a first opening operation to remove noise points, ensuring that the total area of ​​the small white blocks after the first opening operation accounts for more than 10% of the entire image area, and the number of small white blocks is less than 20;

[0029] Step S42, performing a first closing operation to aggregate the hedge information, ensuring that the area of ​​the largest small white block after the first closing operation accounts for more than 30% and less than 80% of the entire image;

[0030] Step S43, performing a second opening operation to remove unnecessary small white blocks generated on the image border by the closing operation in step S42;

[0031] Step S44, performing a second closing operation to make the edge of the hedge smoother.

[0032] Furthermore, in step S5, the method of obtaining the minimum circumscribed circle of the hedge from the image and calculating the coordinates of the center position of the hedge according to the minimum circumscribed circle includes the following steps:

[0033] Step S51, using the findContours() function in opencv3.4 to extract the circumscribed circle contour of the hedge;

[0034] Step S52, respectively calculating the contour closed area of ​​each closed contour obtained by extracting the circumscribed circle contour of the hedge, and then performing non-maximum suppression according to the size of the contour closed area, and only retaining the contour with the largest contour closed area;

[0035] Step S53, using the minEnclosingCircle() function in opencv3.4, the coordinates (x, y) of the center of the hedge are calculated according to the minimum circumscribed circle;

[0036] Step S54, performing a circle check to check whether the coordinates (x, y) of the center position of the hedge obtained in step S53 are wrong.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] The adaptive centering method for a hedge trimming robot provided by the present invention first determines the color space of an input image, then binarizes the input image, performs image enhancement on the binarized image, and finally obtains the minimum circumscribed circle of the hedge horizontal plane, thereby determining the center parameters of the hedge horizontal plane. Compared with existing centering technologies, the method proposed by the present invention shows a significant improvement in both accuracy and recognition rate, especially in terms of detection speed. This algorithm also far exceeds other existing circle detection algorithms and can fully meet the real-time requirements. Compared with some other hedge sanitation machines, the present invention, as the key core of the trimmer centering, can greatly improve the automation and intelligence level of the trimmer, quickly and accurately realize the automatic centering function of the trimming manipulator, reduce the tediousness of manual centering, and greatly improve the work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A flowchart of an adaptive centering method for a hedge trimming robot;

[0041] Figure 2 is the correct template and its BGR histogram;

[0042] Figure 3 is the error template and its BGR histogram;

[0043] Figure 4 is the result of image binarization processing;

[0044] Figure 5 is the result of image enhancement processing;

[0045] Figure 6 The result of obtaining the minimum circumscribed circle of the hedge and the information of the center position of the hedge from the image in a simple environment;

[0046] Figure 7 To obtain the minimum circumscribed circle of the hedge and the center position information of the hedge from the image in a complex environment;

[0047] Figure 8 The test results of Example 1 are compared with those of other hedge centering methods. DETAILED DESCRIPTION

[0048] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0049] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0050] Example 1

[0051] Please see attached Figure 1 , an adaptive centering method for a hedge trimming robot, comprising the following steps:

[0052] Step S1, obtaining a hedge image from a bird's-eye view, and extracting a rectangular image containing only hedge information from the image as a template;

[0053] A camera is installed on the manipulator of the hedge trimming robot. The camera obtains the hedge image from a bird's-eye view. First, the resolution of the hedge image is obtained, and the coordinates of the center of the image are calculated. After obtaining the coordinates of the center point of the hedge image, the maximum size of the template is determined according to the actual situation. Then, the value range of the template on the x-axis temMin_x, temMax_x and the value range of the template on the y-axis temMin_y, temMax_y are calculated to obtain a template of a specified size.

[0054] like Figure 2 As shown, the white rectangle is the selected template; Figure 3 As shown, when the selected template size is too large, the template will contain debris such as lawn and ground. In this case, the BGR histogram of the template will contain multiple prominent peaks. At this time, the template size must be reduced and the template must be re-extracted until the BGR histogram of the template contains only one prominent peak.

[0055] Step S2, convert the hedge image and the template to the same color space, perform histogram comparison on each channel, find the hedge significant color space, complete the adaptive selection of the color space, use the channel that can obtain the hedge significant color space as the default analysis channel, and determine the default threshold interval; the method for determining the default threshold interval is: take the hedge significant peak as the midpoint and expand 25 to both sides to obtain the corresponding default threshold interval. If a boundary is encountered, a translation adjustment is performed while ensuring that the default threshold interval range is 50.

[0056] Step S3, binarizing the hedge image to obtain a binary image containing complete hedge information;

[0057] Furthermore, in step S3, after binarizing the hedge image to obtain a binary image containing complete hedge information, the effect of the binary image is judged according to the total area ratio of all small white blocks in the binary image to the entire image (LW_areaR) and the number of small white blocks (LW_num). The following five situations may occur:

[0058] (1) Insufficient hedge information: LW_areaR < 10%, that is, the distribution of small white blocks does not match the shape of the hedge, and the outer contour of the hedge cannot be seen. It is necessary to perform a positive operation on the binarization parameters and then re-binarize;

[0059] The method for performing positive operations on the binarization parameters is: first, perform a decreasing operation on the analysis channel, and reduce the analysis channels in order of significance from small to large, until the number of analysis channels is 1; when the number of analysis channels is 1, perform an increasing operation on the threshold interval, and increase by 10 on both sides of the default threshold interval, until the threshold interval range is 100. If a boundary is encountered, the threshold interval is shifted while the threshold interval range remains unchanged;

[0060] (2) Hedge information is scattered: LW_areaR ≥ 10%, and LW_num> 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen, but there are too many small white blocks, which are easily removed in the image enhancement, resulting in the outer contour of the hedge not being obtained. It is necessary to perform a positive operation on the binarization parameters and then re-binarize;

[0061] The method for performing positive operations on the binarization parameters is as follows: first, perform a threshold interval increment operation on each analysis channel, incrementing by 10 on both sides of the default threshold interval until the threshold interval range is 100. If a boundary is encountered, the threshold interval is translated while the threshold interval range remains unchanged, so that the threshold intervals of all analysis channels are 100; then perform a analysis channel decrement operation, and reduce the analysis channels in order of significance from small to large, until the number of analysis channels is 1;

[0062] (3) Hedge information is complete: LW_areaR ≥ 10%, and LW_num ≤ 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen. Moreover, the area of ​​the small white blocks is large, and the outer contour of the hedge can be obtained after image enhancement, and there is no need to re-binarize;

[0063] (4) Too much background information: 30% ≤ LW_areaR < 50%, and LW_num > 2000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen, but there are too many large-area background information noise points, which easily lead to the fusion of hedge information and background information after image enhancement, resulting in an outer contour of the hedge that is significantly larger than the actual one. It is necessary to perform a negative operation on the binarization parameters and then re-binarize;

[0064] The method of negative operation on the binary parameter is: first, the threshold interval of each analysis channel is decreased by 10 on both sides of the default threshold interval, until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side far away from the boundary relative to the significant peak of the hedge, the threshold interval is shifted to the boundary without changing the threshold interval, so that the threshold interval of all analysis channels is 10; then the analysis channel is increased, and the number of analysis channels is increased in order from large to small significance, until the number of analysis channels is 3;

[0065] (5) Background information is not separated: LW_areaR ≥ 50%, and LW_num> 1000, that is, the distribution of small white blocks clearly includes the hedge and background information, and it is difficult to see the outer contour of the hedge. This situation often occurs when the hedge information is close to the background information. After image enhancement, the hedge information and the background information will be completely integrated, and the outer contour of the hedge cannot be obtained. It is necessary to perform a negative operation on the binarization parameter and then re-binarize;

[0066] The method of negative operation on the binary parameter is: firstly, the analysis channel increment operation is performed, and the number of analysis channels is increased in the order of significance from large to small, until the number of analysis channels is 3; then the threshold interval is decremented, and the threshold interval is decremented by 10 on both sides of the default threshold interval, until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side far from the boundary relative to the significant peak of the hedge, then the threshold interval is shifted to the boundary without changing the threshold interval, so that the threshold interval of all analysis channels is 10;

[0067] The result after binarization is as follows Figure 4 shown.

[0068] Step S4, using OpenCV to enhance the binary image, aggregate the discrete hedge information, and remove noise points, including the following steps:

[0069] Step S41, performing a first opening operation to remove noise points, ensuring that the total area of ​​the small white blocks after the first opening operation accounts for more than 10% of the entire image area, and the number of small white blocks is less than 20;

[0070] The opening operation is to corrode the image first and then expand it. If the kernel size of the first opening operation is too small (the default size is 5×5, the minimum size is 0×0, the maximum size is 7×7, and the step size is 1×1), the noise will not be removed cleanly. If it is too large, the hedge information will be lost. This parameter can be adjusted through the result after the opening operation. First, it is necessary to ensure that the total area of ​​the small white blocks after the opening operation accounts for more than 10% of the entire image. Otherwise, a kernel decreasing operation is required (i.e., the kernel size is reduced by one step size. If the kernel size is already the maximum value, no adjustment is made). Secondly, if the number of small white blocks is greater than 20, a kernel increasing operation is performed (i.e., the kernel size is increased by one step size. If the kernel size is already the maximum value, no adjustment is made). This ensures that the total area of ​​the small white blocks accounts for more than 10% and less than 20% of the entire image area.

[0071] Step S42, performing a first closing operation to aggregate the hedge information, ensuring that the area of ​​the largest small white block after the first closing operation accounts for more than 30% and less than 80% of the entire image;

[0072] The closing operation is to dilate the image first and then erode it. The kernel size is adjusted by the result of the first closing operation (the default size is 30×30, the minimum size is 10×10, the maximum size is 50×50, and the change step is 10). First, the area of ​​the largest white block after the closing operation should be greater than 30% of the entire image, otherwise the kernel increment operation should be performed; secondly, if the area of ​​the largest white block is greater than 80%, it means that a large part of the background information and the hedge information are merged, and the kernel decrement operation should be performed;

[0073] Step S43, performing a second opening operation to remove unnecessary small white blocks generated at the image border by the closing operation in step S42; the second opening operation is only to remove unnecessary small white blocks that may be generated at the image border, so its kernel size is fixed to 9×9;

[0074] Step S44, performing a second closing operation to make the edge of the hedge smoother; the second closing operation is only for making the edge of the hedge smoother, so a fixed kernel size of 3×3 is also used;

[0075] The result after image enhancement is as follows Figure 5 shown.

[0076] Step S5, obtaining the minimum circumscribed circle of the hedge from the image, and calculating the coordinates of the center position of the hedge according to the minimum circumscribed circle, includes the following steps:

[0077] Step S51, using the findContours() function in opencv3.4 to extract the circumscribed circle contour of the hedge;

[0078] Step S52, respectively calculating the contour closed area of ​​each closed contour obtained by extracting the circumscribed circle contour of the hedge, and then performing non-maximum suppression according to the size of the contour closed area, and only retaining the contour with the largest contour closed area;

[0079] Step S53, using the minEnclosingCircle() function in opencv3.4, the coordinates (x, y) of the center of the hedge are calculated according to the minimum circumscribed circle;

[0080] Step S54, perform circle check to check whether there is any error in the hedge center position coordinates (x, y) obtained in step S53: circle check can be performed based on prior data such as hedge and rough centering error, that is, the horizontal section radius of the hedge is generally 40cm to 60cm, and the manual rough centering error will not exceed 50cm. These prior data are converted into pixel units of 213 pixels to 320 pixels and 266 pixels respectively. In order to increase applicability, the horizontal section radius of the hedge is allowed to range from 200 pixels to 400 pixels, and the rough centering error is allowed to range from 300 pixels. Therefore, the obtained minimum circumscribed circle radius R and the hedge center position coordinates (x, y) are checked. Only if they meet:

[0081]

[0082] Only then is it considered that the detected hedge center position coordinates (x, y) have no obvious errors;

[0083] The processing effect in a simple scene is as follows Figure 6 As shown in Figure 2, the processing effect in complex scenes is as follows: Figure 7 shown.

[0084] Figure 8 A comparison diagram of the final detection effects of the centering method provided in Example 1 of the present invention and other methods is shown in the figure. It can be seen from the figure that the centering method of the present invention can accurately extract the minimum circumscribed circle of the hedge and accurately obtain the center position information of the hedge in various environments.

[0085] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. An adaptive centering method for a hedge trimming robot, characterized in that: The following steps are involved: Step S1, obtaining a hedge image from a bird's-eye view, and extracting a rectangular image containing only hedge information from the image as a template; the BGR histogram of the template contains only one prominent peak; Step S2: Convert the hedge image and template to the same color space, perform histogram comparison on each channel, find the hedge significant color space, complete the adaptive selection of color space, use the channel that can find the hedge significant color space as the default analysis channel, and determine the default threshold range; Step S3, performing binarization processing on the hedge image to obtain a binary image containing complete hedge information; Step S4, performing enhancement processing on the binary image, aggregating discrete hedge information, and removing noise points; Step S5, obtaining the minimum circumscribed circle of the hedge from the image, and calculating the center position information of the hedge based on the minimum circumscribed circle; Among them, in step S2, the method for determining the default threshold interval is: taking the significant peak of the hedge as the midpoint, expand 25 to both sides to obtain the corresponding default threshold interval. If a boundary is encountered, a translation adjustment is performed while ensuring that the default threshold interval range is 50.

2. The adaptive centering method according to claim 1, characterized in that: Step S3 performs binarization on the hedgerow image to obtain a binary image containing complete hedgerow information. The effect of the binarization is determined based on the total area ratio LW_areaR of all small white blocks in the binary image and the number LW_num of small white blocks. The following five situations may occur: (1) Insufficient hedge information: LW_areaR < 10%, that is, the distribution of small white blocks does not match the shape of the hedge, and the outer contour of the hedge cannot be seen. It is necessary to perform a positive operation on the binarization parameters and then re-binarize; (2) Hedge information is scattered: LW_areaR ≥ 10%, and LW_num > 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen. However, there are too many small white blocks, which are easily removed during image enhancement, resulting in the hedge outer contour not being obtained. It is necessary to perform a positive operation on the binarization parameters and then re-binarize; (3) Hedge information is complete: LW_areaR ≥ 10% and LW_num ≤ 3000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the outer contour of the hedge can be seen. Moreover, the area of ​​the small white blocks is large, and the outer contour of the hedge can be obtained after image enhancement, without the need for re-binarization; (4) Too much background information: 30% ≤ LW_areaR < 50%, and LW_num > 2000, that is, the distribution of small white blocks is consistent with the shape of the hedge, and the hedge outline can be seen, but there are too many large-area background information noise points, which easily leads to the fusion of hedge information and background information after image enhancement, resulting in a hedge outline that is significantly larger than the actual one. It is necessary to perform a negative operation on the binarization parameter and then re-binarize; (5) Background information is not separated: LW_areaR ≥ 50%, and LW_num > 1000, that is, the distribution of small white blocks clearly includes hedge and background information, and it is difficult to see the outer contour of the hedge. This situation often occurs when the hedge information and background information are similar. After image enhancement, the hedge information and background information will be completely integrated, and the outer contour of the hedge cannot be obtained. It is necessary to perform a negative operation on the binarization parameter and then re-binarize.

3. The adaptive centering method according to claim 2, characterized in that: In case (1), the method for performing positive operations on the binarization parameters is as follows: first, perform a decreasing operation on the analysis channel, and reduce the analysis channel in order of significance from small to large, until the number of analysis channels is 1; when the number of analysis channels is 1, perform a threshold interval increasing operation, and increase by 10 on both sides of the default threshold interval, until the threshold interval range is 100. If a boundary is encountered, the threshold interval is shifted while the threshold interval range remains unchanged; Case (2) The method for performing positive operations on the binarization parameters is as follows: first, perform a threshold interval increment operation on each analysis channel, incrementing by 10 on both sides of the default threshold interval until the threshold interval range is 100. If a boundary is encountered, the threshold interval is shifted while the threshold interval range remains unchanged, so that the threshold interval of all analysis channels is 100; then perform a analysis channel decrement operation, reducing the analysis channels in order of significance from small to large, until the number of analysis channels is 1; Case (4) The method of performing negative operation on the binarization parameter is as follows: first, perform a threshold interval reduction operation on each analysis channel, decreasing by 10 on both sides of the default threshold interval, until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side away from the boundary relative to the significant peak of the hedge, then the threshold interval is shifted to the boundary while the threshold interval remains unchanged, so that the threshold interval of all analysis channels is 10; then perform an analysis channel increment operation, and increase the number of analysis channels in the order of significance from large to small, until the number of analysis channels is 3; Case (5) The method of performing negative operation on the binary parameter is: first perform the analysis channel increment operation, and increase the number of analysis channels in the order of significance from large to small, until the number of analysis channels is 3; then perform the threshold interval decrement operation, and decrease by 10 on both sides of the default threshold interval, until the threshold interval range is 10. If there is a boundary, and the middle value of the threshold interval is on the side away from the boundary relative to the hedge significant peak, then the threshold interval is shifted to the boundary while the threshold interval remains unchanged, so that the threshold interval of all analysis channels is 10.

4. The adaptive centering method according to claim 1, characterized in that: In step S4, OpenCV is used to enhance the binary image, aggregate the discrete hedge information, and remove noise points, including the following steps: Step S41 , performing a first opening operation to remove noise points, ensuring that the total area of ​​the small white blocks after the first opening operation accounts for more than 10% of the entire image area, and the number of small white blocks is less than 20; Step S42 , performing a first closing operation to aggregate the hedge information, ensuring that the area of ​​the largest white block after the first closing operation accounts for >30% and <80% of the entire image; Step S43, performing a second opening operation to remove unnecessary small white blocks generated on the image border by the closing operation in step S42; Step S44: performing a second closing operation to make the edge of the hedge smoother.

5. The adaptive centering method according to claim 1, characterized in that: Step S5 obtains the minimum circumscribed circle of the hedge from the image. The method for calculating the coordinates of the center position of the hedge based on the minimum circumscribed circle includes the following steps: Step S51, using the findContours() function in opencv3.4 to extract the circumscribed circle contour of the hedge; Step S52, calculating the closed area of ​​each closed contour obtained by extracting the circumscribed circle contour of the hedge, and then performing non-maximum suppression based on the size of the closed area of ​​the contour, and only retaining the contour with the largest closed area; Step S53, using the minEnclosingCircle() function in OpenCV 3.4, the coordinates (x, y) of the center of the hedge are calculated based on the minimum circumscribed circle; Step S54: perform circle check to check whether the hedge center coordinates (x, y) obtained in step S53 have any errors.

Citation Information

Patent Citations

  • Crop row detection method based minimum tangent circle and morphological principle

    CN105021196A

  • Image processing method for quickly and automatically detecting soldered dot unsatisfied products of electric connectors

    CN105139386A