A method for detecting the straight line of the granary walkway edge under strong light conditions

By using the ‘super green feature method’ and OTSU Otsu method in the flat grain robot for image processing and designing the ‘slope inheritance’ linear detection algorithm, the problem of poor linear detection of the edge of the walkway plate under strong light conditions is solved, and a more accurate and efficient navigation task completion is achieved.

CN113936023BActive Publication Date: 2025-05-13SICHUAN ARTIGENT ROBOTICS EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111226076.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-21
Publication Date
2025-05-13
Estimated Expiration
2041-10-21

AI Technical Summary

Technical Problem

Under strong light conditions, the linear detection effect of the walkway plate edge of the flat grain robot is poor, resulting in the inability to accurately complete the navigation task.

Method used

The image grayscale was used to combine the OTSU Otsu method for binary segmentation, and the 'slope inheritance' linear detection algorithm was designed to accurately detect the straight lines along the edge of the walkway plate under local exposure conditions.

Benefits of technology

It improves the accuracy of linear detection of the edge of the walkway plate under strong light conditions, ensures that the navigation tasks of the flat grain robot can be completed correctly, and improves the detection efficiency and effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113936023B_ABST
    Figure CN113936023B_ABST
Patent Text Reader

Abstract

The invention discloses a method for detecting straight lines along the edge of aisle plates in a granary under strong light conditions, which is applied to the field of visual detection and aims to solve the problem that the recognition effect of the edge lines of aisle plates of a grain-leveling robot under local light conditions is poor. The invention adopts a "super green feature method" to grayscale the image of a green aisle plate specific to the robot, and then uses the OTSU method to perform binary segmentation on the grayscale image, and then proposes a "slope inheritance" straight line detection algorithm to replace the Hough straight line detection to recognize the edge lines of the aisle plates, and verifies the effectiveness of the method proposed by the invention through experiments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of visual detection, and in particular relates to a straight line detection technology under strong light conditions. Background Art

[0002] my country's annual grain output is huge, and the grain storage volume is also huge. Since the grain storage time is relatively fixed every year, if the grain leveling work cannot be completed in a short period of time, it will affect the safety and quality of the reserve grain. Developing a fully automatic grain leveling robot can improve the efficiency of grain leveling and protect the health of granary workers.

[0003] The grain-leveling robot needs to rely on the pre-laid walkway boards on the grain surface and use visual navigation to make it walk along the set path to complete the grain-leveling work. Similar to the lane line detection in unmanned driving technology, the visual navigation of the grain-leveling robot relies on the accurate recognition of the edge lines of the walkway boards. The general process of line detection is: grayscale change of the current frame image read into the video stream, filtering and denoising of the grayscale image, image binary segmentation, morphological operation of the binary image, edge detection, and line detection based on the results of edge detection.

[0004] The current color image grayscale method mainly converts the pixel value of each point on the image into a single-channel pixel value of [0,255] by performing component operations on color spaces such as RGB or HSV. The grayscale method based on RGB color space is not very adaptable to changes in light intensity, while the grayscale method based on HSV is not only more adaptable to light intensity, but its results are also easier to be processed and calculated by computers than RGB.

[0005] The methods for binarizing grayscale images can be divided into local binarization and global binarization. The local binarization method, i.e. the adaptive threshold method, uses different thresholds for segmentation in different regions of the image. The global threshold generally uses the average grayscale method based on the histogram or the Otsu method. The adaptive threshold has the disadvantages of low processing speed and unstable binary segmentation effect, while the simple and efficient global threshold segmentation is widely used.

[0006] Line detection methods include Hough line detection and LSD line detection. Hough line detection is based on Hough line transformation. For each pixel point, all lines passing through this point are transformed in the polar coordinate to polar radius and angle plane. Then each pixel point will get a sine curve, and the intersection of the two curves indicates that the polar radius and polar angle are the same, that is, both points pass through the straight line of the polar radius and polar angle at the intersection. LSD line detection can obtain sub-pixel accuracy detection results in a linear time. The algorithm is through image scaling, gradient calculation, gradient sorting, gradient threshold selection, region growing and rectangle estimation, so as to quickly extract local lines.

[0007] Hough transform is a discrete calculation method, which will make the transformation result not correspond to the edge line of the walkway board one by one, but decomposed, scattered, repeated, and even contain irrelevant line segments. Therefore, the detection result of Hough transform needs to be transformed back to the original space for further screening. The algorithm is complex, the process is long, and the detection result is not accurate. On the other hand, due to interference from lighting, shadows, occlusion, road damage, etc., the difficulty of detection is increased. LSD line detection is a local detection algorithm that runs faster than Hough, but it will split intersecting lines at the intersection and has poor anti-interference ability.

[0008] The grain leveling robot works on the top of a large granary, where a point light source is arranged and the ventilation window on the top allows the entry of external natural light. These factors cause the grain leveling robot to work in an environment with uneven brightness and local high exposure. The use of traditional straight line detection processes and methods will result in poor binary segmentation of the aisle plate image collected by the grain leveling robot, and serious deviation between the fitted straight line and the actual edge of the aisle plate, which seriously affects the robot's judgment of position information and task status, making it impossible to accurately complete the grain leveling work. Summary of the invention

[0009] In order to solve the above technical problems, the present invention proposes a method for detecting the straight line edge of a granary aisle plate under strong light conditions, so that the grain leveling robot can still accurately detect the straight line edge and correctly complete the navigation task under partial exposure conditions.

[0010] The technical solution adopted by the present invention is: a method for detecting the straight line of the edge of a granary aisle plate under strong light conditions, the aisle plate of the grain leveling robot is fixed with a green plastic plate with holes, and the green plastic plate with holes is under local light conditions; the method comprises the following steps:

[0011] S1. The camera set on the Pingliang robot collects images of the green plastic plate with holes;

[0012] S2, using the "super green feature method" to perform grayscale conversion on the image collected in step S1;

[0013] S3, using the OTSU method to perform binary segmentation on the image processed in step S2;

[0014] S4. Use the "slope inheritance" straight line detection algorithm to perform straight line detection on the image processed in step S3.

[0015] The grain-leveling robot described in step S1 includes: two left and right chassis, and an intermediate truss connecting the left and right chassis; when the grain-leveling robot is running, the left and right chassis move forward or backward, and cameras are installed in front, at the back and inside of each chassis.

[0016] Step S3 specifically includes: using the Otsu method to calculate the inter-class variance, taking the grayscale value corresponding to the maximum inter-class variance as the expected threshold, and performing binary segmentation on the image processed in step S2 according to the expected threshold.

[0017] Step S4 specifically includes the following sub-steps:

[0018] S41, obtaining an edge detection image of the image processed in step S3;

[0019] S42, dividing the edge detection image in step S41 into two left and right sub-images, and obtaining the coordinates of each point constituting the edge straight line in the two sub-images respectively; thereby obtaining the edge straight line point set coordinate clusters of the two sub-images respectively;

[0020] S43, respectively calculating the slopes of the two edge line point set coordinate clusters to obtain their respective slope clusters;

[0021] S44, calculating the respective intercept clusters according to the slope clusters;

[0022] S45, obtaining the slope K and intercept B of the non-distorted normal edge by finding the mode, and inheriting them as the slope and intercept of the entire edge;

[0023] S46. Draw a line in the mask image according to the slope and intercept obtained in step S45 and output a picture.

[0024] Step S43 performs discrete slope cluster calculation on the points on the overall edge with a step length h. The step length h is obtained based on experience. That is, when the total number of pixel points on the edge to be processed is count, the value range of h is In the δ neighborhood of , δ≤5.

[0025] The beneficial effects of the present invention are as follows: the present invention improves the image grayscale method in the image processing process, replaces the default grayscale method with the "super green feature method" commonly used in agriculture, and greatly improves the grayscale effect of green objects by adjusting the proportional coefficients of the three channels of R, G, and B; the present invention selects the OTSU Otsu method for binary segmentation of the grayscale image, and the foreground and background distinction of the grayscale image processed by the super green feature is already more obvious. The OTSU Otsu method can produce a better segmentation effect and provide conditions for the "slope inheritance" straight line detection algorithm; the present invention invents a "slope inheritance" straight line detection algorithm for the binary image of the walkway board with locally distorted edge straight lines, and the algorithm can improve the efficiency of straight line detection while excellently completing the task of detecting the edge straight lines of the walkway board. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is the overall flow chart of straight line detection of the present invention;

[0027] Figure 2The overall structure diagram of the grain leveling robot to which the present invention is applied;

[0028] Figure 3 This is the single chassis structure diagram of the Pingliang robot;

[0029] Figure 4 This is the six-state diagram of the aisle plate during the navigation process of the Pingliang robot;

[0030] Among them, (a) represents the image state captured by the moving direction camera during normal driving, (b) represents the image state captured by the moving direction camera of the left chassis when encountering a transverse board when driving on the far left side, (c) represents the image state captured by the moving direction camera of the right chassis when encountering a transverse board when driving on the far right side, (d) represents the image state captured by the moving direction camera when encountering a transverse board when driving in the middle, (e) represents the image state captured by the side camera when the right chassis first encounters a transverse board or the left chassis just passes the transverse board, and (f) represents the image state captured by the side camera when the left chassis first encounters a transverse board or the right chassis just passes the transverse board;

[0031] Figure 5 Partition diagram for left and right sub-images of the image to be processed;

[0032] Figure 6 It is the flow chart of the slope inheritance straight line detection algorithm;

[0033] Figure 7 The straightness detection result of the walkway board in the double straight line state disturbed by natural strong light based on the traditional method;

[0034] Among them, (a) is the original image of the local high-exposure walkway to be detected, (b) is the binary image of the grayscale image based on the traditional method, (c) is the canny edge detection image, and (d) is the detected edge straight line result image;

[0035] Figure 8 The straight line detection results of the walkway board in a double straight line state disturbed by natural strong light based on the slope inheritance straight line detection method;

[0036] Among them, (a) is the original image of the local high-exposure walkway to be detected, (b) is the binary image of the grayscale image based on the super green factor, (c) is the canny edge detection image, and (d) is the detected edge straight line result image;

[0037] Fig. 9 The straight line detection result of the walkway board in a single straight line state disturbed by local light source based on the slope inheritance straight line detection method;

[0038] Among them, (a) is a binary image with local light source illumination, (b) is a canny edge detection image, (c) is a slope inheritance algorithm straight line detection image, and (d) is a detected edge straight line result image;

[0039] Fig.10 Comparison of the time consumption between Hough line detection and slope inheritance line detection algorithms. DETAILED DESCRIPTION

[0040] To facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further explained below with reference to the accompanying drawings.

[0041] The traditional straight line detection process and method cannot achieve the required effect for the edge straight line detection of the grain walkway plate in a local light source environment. This is mainly because the local high exposure has a great influence on the image binary segmentation effect, and the partial edge distortion of the binary image causes the straight line detected by the Hough line detection algorithm to be very different from the actual straight line after fitting. Therefore, the present invention improves or optimizes the methods in the steps of the detection process to finally obtain an edge straight line with a smaller deviation from the actual one that can meet the needs.

[0042] like Figure 1 As shown, the method of the present invention comprises the following steps:

[0043] 1. Use the "super green feature method" to grayscale the image:

[0044] The walkway board of the Pingliang robot is fixed with a green plastic board with holes. Using the traditional grayscale conversion formula under multiple local lighting conditions will result in a poor final threshold segmentation effect. Since the foreground target is a green walkway board, the grayscale image effect can be improved by correcting the proportion factor of each color in the grayscale formula. In agriculture, a "super green feature method" is designed for grayscale conversion for the identification of green crops. The conversion formula is:

[0045] ExG=2G-RB (1)

[0046] Among them, R, G, and B represent the RGB components of a single pixel in the original RGB image, and ExG represents the grayscale value of a single pixel after conversion. Experiments have shown that the "super green feature method" can greatly improve the grayscale effect of the image, thereby providing a good grayscale image for the next step of threshold segmentation.

[0047] 2. Use OTSU method for binary segmentation:

[0048] The image after the grayscale change contains a lot of noise and needs to be filtered. After filtering, it needs to be binarized and segmented. The background technology part introduces some binarization methods and their advantages and disadvantages. Because the grain leveling operation has certain requirements on the driving speed of the robot car, and the entire robot navigation task is based on the real-time image acquisition and processing of the visual sensor, it is particularly important to process the image efficiently at a higher speed. After testing, the use of OTSU Otsu method in threshold segmentation can take into account both efficiency and effect requirements, so the OTSU algorithm is selected to complete the image binarization.

[0049] OTSU is an image binarization threshold segmentation method. According to the grayscale characteristics, the image can be divided into foreground and background. The variance can represent the uniformity of grayscale distribution. The larger the inter-class variance between the foreground and background, the greater the difference between the foreground and background. When part of the foreground is misclassified as the background or part of the background is misclassified as the foreground, the inter-class variance will become smaller. Therefore, when using the maximum inter-class variance segmentation, the probability of position misclassification will be minimized, so the OTSU algorithm is also called the maximum inter-class variance method.

[0050] The main work of the OTSU algorithm is to find the variance between classes. The solution is:

[0051] The number of pixels in each gray level of a grayscale image of size r×c is n i , the probability of each gray level is p i , where i∈[0,255]. Assume that there is a threshold T(T∈[0,255]) that divides the image into two categories A and B. The number of pixels in A and B are n respectively. a 、n b , the mean grayscale pixels of A and B are m a 、m b , the global grayscale mean is m G , the probability that a pixel is classified as A or B is p a 、p b The relationship between them is:

[0052]

[0053] Then the between-class variance σ 2 It can be calculated as:

[0054] σ 2 =p a (m a -m G ) 2 +p b (m b -m G ) 2 (3)

[0055] Substituting (2) into (3) and simplifying it, we get:

[0056]

[0057] According to formula (4), traverse the grayscale pixel values ​​from 0 to 255, and find the grayscale value T corresponding to the maximum variance, which is the expected threshold. According to this threshold, the probability of misclassification of foreground and background segmentation can be minimized, and the global optimal foreground and background segmentation binary image can be obtained.

[0058] 3. Design a “slope inheritance” straight line detection algorithm:

[0059] The binary image obtained by the above steps is less sensitive to light than the traditional grayscale change, but it still cannot completely eliminate the influence of light. When the local light is strong, it will still cause partial distortion in the edge area. At this time, if Hough or LSD straight line detection is directly used, many noise segments will be detected. These noise segments will participate in the straight line fitting, resulting in unsatisfactory fitting results. Therefore, for the straight line detection of the walkway edge with partial distortion at the junction of the foreground and background, the present invention designs a "slope inheritance" straight line detection algorithm.

[0060] As the name implies, slope inheritance means that part of the distorted area inherits the slope of the straight line of the intact edge to obtain a complete edge straight line. There will always be a complete non-distorted edge on the edge of the partially exposed image that has been preprocessed by super green detection and OTSU algorithm. Any two points on this non-distorted edge line with a step size greater than a certain value always have the same slope; while the distorted edge is often an irregular curve or even a serrated line. The edge points in this area have almost no groups of points with a common slope under any step size conditions. Therefore, the points on the overall edge can be discretely calculated as slope clusters with a step size of h. The step size h is obtained based on experience, that is, when the total number of pixels on the edge line to be processed is count, the value range of h is in the range of In the δ neighborhood of , δ≤5. After calculation according to the above description, the slope value with the most occurrences can always be found in this cluster of slopes, and this slope value is the slope value of the complete non-distorted edge line, that is, the slope value of the complete edge line of the walkway under ideal conditions. Based on this, this rule and idea can be abstracted into a "slope inheritance" line detection algorithm to replace the traditional Hough line detection, which is used to effectively solve the problem of local edge distortion.

[0061] The input of the algorithm is the edge detection map of the segmented image, which only contains edge information, and the output is the slope and intercept of the detected edge line for subsequent flat grain status judgment.

[0062] The overall structure of the grain leveling robot using the present invention is as follows Figure 2 As shown in FIG. 1 , the robot comprises: two chassis on the left and right, and a middle truss connecting the two chassis on the left and right; when the grain leveling robot is running, the two chassis on the left and right move forward or backward. Cameras are installed in front, at the back and inside of each chassis, such as Figure 3 As shown in the figure, the whole Pingliang robot is equipped with six cameras. For the Pingliang robot in motion, the camera always captures the dynamic images. Each frame of the image is not exactly the same, but the image appearance can be summarized into six types, such as Figure 4 As shown, the cameras at the front, rear and inner side of the left chassis are named LF, LB and LS respectively. Similarly, the cameras at the front, rear and inner side of the right chassis are named RF, RB and RS respectively.

[0063] Figure 4 (a) represents the image captured by the motion direction camera when the robot's motion encounters no crossplate or top plate. For example, when moving forward, at this time Figure 4 (a) represents the images captured by LF and RF. For example, when moving backward, then Figure 4 (a) represents the images captured by LB and RB.

[0064] Figure 4 In (b), (c), and (d), it means that when the robot encounters a crossplate, the front camera not only captures the aisle plate but also part of the edge of the crossplate. If a certain chassis is at the outermost edge of the entire grain surface aisle plate at this time, it will be divided into the left outermost edge and the right outermost edge, that is Figure 4 In (b), it represents the image state captured by the left chassis motion direction camera when encountering a crossplate while driving on the leftmost side. Figure 4 In (c), it represents the image state captured by the right chassis motion direction camera when encountering a crossplate while driving on the rightmost side; if a certain chassis is in the middle, then the crossplate it sees is on both the left and right in its front view (such as the center of the Chinese character "field"), just like Figure 4 In (d), it represents the image state captured by the motion direction camera when encountering a crossplate when not at the leftmost or rightmost aisle plate camera.

[0065] Figure 4 In (e) and (f), it refers to the images captured by the inner cameras when encountering a crossplate. Due to the left - right symmetry and the front - back symmetry when passing through the crossplate, (e) and (f) do not specifically refer to a certain camera. Both RS and LS capture Figure 4 the two images shown in (e) and (f).

[0066] The entire running aisle plate of the robot is not in the shape of a "field" but a grid built by several crossplates and several vertical plates. However, this grid can be divided into several "field" shapes, that is, all foreground states as shown in Figure 4 can be described by one "field" shape.

[0067] For the front image, the symmetry axis of the two side lines is mainly calculated using the edge lines, and then the symmetry axis is compared with the physical mid - line of the image, that is, the dotted line in the figure, to obtain the offset during the driving process. This offset is used as the input of the PID control to ensure that the machine moves straight normally and avoids falling due to moving obliquely. For the side image, the edge lines are used to calculate its tilt angle, and the specific position of reaching the crossplate is judged according to the size of the edge tilt angle, so as to make a decision on whether to lift or lower the machine crossbeam. Therefore, the edge slope of the side image is particularly important.

[0068] From Figure 4It can be found that the front image will have a broken line edge when it encounters the horizontal board. In order to simplify the algorithm process, the horizontal board edge that has no effect on the result, that is, the straight line with a very small slope, is discarded. Figure 4 The six states are divided into two forms of processing. One is that there is an edge in both the left and right sub-areas of the image, such as Figure 4 The other is that there is only one edge on the entire image, such as Figure 4 The slope inheritance process is performed on these two forms respectively.

[0069] 4. Description and analysis of the “slope inheritance” straight line detection algorithm:

[0070] The above two forms differ only in the number of lines in the image. There is not much difference in the overall algorithm idea and processing. Just a slight change in the code implementation can make the entire image traversed completely. Therefore, when discussing the slope inheritance algorithm, only the first case, that is, there are straight lines in the left and right areas of the image, is described.

[0071] The slope and intercept calculated by the algorithm need to be concretized as edge lines, so a mask image needs to be prepared in advance for drawing edge lines on it, copy the real foreground image captured by the camera as the mask image, and draw the line obtained by the slope inheritance line detection algorithm on it. The advantage of using the original real scene image as a mask is that the effect of line detection can be seen more clearly and intuitively.

[0072] 4.1 Slope inheritance line detection algorithm process is as follows Figure 6 As shown:

[0073] ① Load the canny edge detection image with pixel size rows×cols, where rows is the image pixel height and cols is the image pixel width. Divide it into two sub-graphs, left and right, and traverse from point (0,0) and point (cols,0) to the middle of the image, that is, independently obtain the coordinates of each point that constitutes the edge line in the two sub-graphs. The image division and coordinates are as follows Figure 5 As shown; those skilled in the art should note that the slope inheritance straight line detection method of the present invention can ultimately be encapsulated as an API, so that by inputting the image to be detected, straight line detection of the partially distorted image can be achieved.

[0074] ②Store the coordinate clusters of the two edge point sets independently. Taking the left subgraph as an example, the coordinates of the i-th point stored are (x i ,y i ), the total number of points is len;

[0075] ③ Perform the same slope calculation operation on the two coordinate clusters. Taking the left subgraph as an example, to reduce the error, the calculation should be started from the hth element of the coordinate cluster to the len-hth element (h is the step length, obtained according to the calculation rules described above). The calculation method is: take the coordinates of the i-th and i+h-th elements, according to the formula:

[0076]

[0077] Calculate the slope left_k between these two points i , and store the slope cluster left_K in sequence;

[0078] ④According to the formula

[0079] left_b i =y i -left_k i ·x i (6)

[0080] Calculate each left_k i The corresponding intercept left_b i , and store the intercept cluster left_B;

[0081] ⑤ Find the mode of the elements in left_K and left_B respectively. The mode represents the slope K and intercept B of the non-distorted normal edge, which are inherited as the slope and intercept of the entire edge;

[0082] ⑥ Draw a line in the mask image according to the screened slope K and intercept B and output the image;

[0083] ⑦ Return the slope K and intercept B.

[0084] 4.2 Complexity analysis of slope inheritance line detection algorithm:

[0085] The time complexity of traversing the image is O(n 2 ), the time complexity of calculating the slope intercept is O(2n), and the time complexity of calculating the mode is O(n), so the total time complexity of the algorithm is O(n 2 +2n+n)=O(n 2 The Hough line detection method is based on the Hough line transform. The Hough transform method requires discrete sampling in the parameter space first, and then uses the formula r = x cos θ + ysin θ to calculate a cluster of straight lines passing through each sampling point. This cluster of straight lines is represented as a sine curve in the polar coordinate system. Then, the straight line is detected through the intersection of multiple sine curves, that is, the points on the same straight line in the Cartesian coordinate system. When the number of sampling points is equal to the image size, that is, Hough transform is performed on each point on the image, the time complexity of Hough line detection is O(n 3 ).

[0086] Therefore, for the specific straight line detection of the aisle edge of the Pingliang robot, the execution efficiency of the slope inheritance straight line detection algorithm is higher than that of the Hough straight line detection.

[0087] Experimental verification

[0088] In order to solve the influence of natural strong light or local light source on single straight line or double straight line detection, the method of the present invention selects two test environments, namely:

[0089] 1. Environment 1: Natural strong light + double straight lines. We selected a real scene with partial exposure caused by natural light from the outside at noon on a sunny day for algorithm testing and comparison. The test results are shown in the figure below. Figure 7 and Figure 8 As shown:

[0090] The edge detection of the local high-exposure aisle board image using the traditional HSV three-channel grayscale and Hough line detection algorithm is as follows: Figure 7 As shown in the figure, the edge detection of the local high-exposure walkway board image is performed using the super green factor grayscale method and the slope inheritance straight line detection algorithm. Figure 8 shown.

[0091] 2. Environment 2: Local light source + single straight line. We artificially set up a local light source environment and deliberately deteriorate the binary image effect to more strongly verify the effectiveness of the slope inheritance algorithm. The test results are as follows: Fig. 9 shown.

[0092] 3. Operation efficiency test:

[0093] The detection efficiency of the two algorithms is statistically analyzed and compared using an industrial computer with an Intel(R) Core(TM) i3-6100U CPU@2.30GHz and 4GB DDR3 memory. Different test cases are designed, which are the time consumption of applying the straight line detection algorithm to 30, 300, 3000 and 10000 consecutive frames of images. Each test case is tested 5 times, and then the average is calculated and used as the final algorithm time consumption result. The test results are shown in Table 1.

[0094] Table 1 Detection time of Hough line detection and slope inheritance line detection algorithms

[0095]

[0096] Compare the results of the two algorithms under different test cases and draw a comparison line chart as shown below. Figure 7 As shown, the dotted line is the time consumption of Hough line detection, and the solid line is the time consumption of slope inheritance algorithm.

[0097] From the detection effect, Figure 7(b) is the original image that is converted to HSV color space and then binarized and segmented. The segmented image is then filtered and filled. The processed binary image is then subjected to edge detection. Hough line detection is performed based on the edge detection result. Line segments are screened and multiple line segments are fitted to form the final walkway edge detection result. From the binary segmentation effect, it can be seen that the HSV component range segmentation after RGB to HSV conversion is not ideal for partially exposed images. Even subsequent filtering and filling cannot repair the image well. The traditional RGB to GRAY conversion followed by static or dynamic threshold segmentation has even worse results. Even the walkway under normal light cannot be segmented well. Figure 8 (b) The super green feature method is used to grayscale the green walkway board, and then the grayscale image is filtered. The OTSU method is used for binary segmentation, and finally the segmentation result is subjected to morphological operations to obtain a binary image with good effect. Figure 8 The effect of (b) can be directly obtained by using Hough line detection to obtain the edge line that meets the working requirements. However, in order to maintain generality and improve the efficiency of line detection, the slope inheritance algorithm is used to perform edge detection. Figure 8 The detection results in (d) show that the super-green feature combined with the slope inheritance algorithm has a good effect on the edge detection of the partially exposed green walkway board.

[0098] right Fig. 9 As for the above, we can see that under the condition of intentionally deteriorating the binary image, the edge straight line can still be detected well, which proves the effectiveness of the slope inheritance algorithm.

[0099] Fig.10 The line graph shows the time consumption of the two algorithms as the number of image frames increases (corresponding to the robot's working time). It can be seen that the time consumption of the Hough line detection algorithm is basically linearly related to the number of processed images, while the slope inheritance algorithm will consume a flatter amount of time over time. This shows that the slope inheritance algorithm has a greater efficiency advantage in long-term work. The conclusion is consistent with the previous analysis of the algorithm complexity, that is, the algorithm complexity of the slope inheritance line detection algorithm (O(n 2 )) is lower than Hough line detection (O(n 3 ), so the detection efficiency of the former is higher than that of the latter.

[0100] The present invention is based on engineering practice, and develops a walkway board edge straight line detection algorithm that is adapted to local exposure for Pingliang robots that cannot accurately perform visual navigation due to local strong light interference in the working environment. Different from the traditional straight line detection preparation work and Hough straight line detection algorithm, the "super green feature method" and OTSU Otsu method are used to perform binary threshold segmentation on the original image, and then a "slope inheritance" straight line detection algorithm is designed based on the edge detection results of the binary image and special working scenarios. After testing and comparison, the preprocessing process and straight line detection algorithm are significantly better than traditional Hough detection, and can basically meet the visual navigation work of Pingliang robots in local exposure environments.

[0101] 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 scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A method for detecting the straight line of the edge of a granary aisle plate under strong light conditions, characterized in that: The aisle plate of the Pingliang robot is fixed with a green plastic plate with holes, and the green plastic plate with holes is under local lighting conditions; the method includes the following steps: S1. The camera set on the Pingliang robot collects images of the green plastic plate with holes; S2, using the super green feature method to perform grayscale conversion on the image collected in step S1; S3, using the OTSU method to perform binary segmentation on the image processed in step S2; S4, using the slope inheritance straight line detection algorithm to perform straight line detection on the image processed in step S3; step S4 specifically includes the following sub-steps: S41, obtaining an edge detection image of the image processed in step S3; S42, dividing the edge detection image in step S41 into two left and right sub-images, and obtaining the coordinates of each point constituting the edge straight line in the two sub-images respectively; thereby obtaining the edge straight line point set coordinate clusters of the two sub-images respectively; S43, respectively calculate the slopes of the two edge line point set coordinate clusters to obtain their respective slope clusters; Step S43 performs discrete slope cluster calculation on the points on the overall edge with a step length h, and the step length h is obtained based on experience, that is, when the total number of pixel points on the edge line to be processed is count, the value range of h is In the δ neighborhood of , δ≤5; S44, calculating the respective intercept clusters according to the slope clusters; S45, obtaining the slope K and intercept B of the non-distorted normal edge by finding the mode, and inheriting them as the slope and intercept of the entire edge; S46. Draw a line in the mask image according to the slope and intercept obtained in step S45 and output a picture.

2. The method for detecting the straight line of the granary walkway board edge under strong light conditions according to claim 1 is characterized in that: The grain-leveling robot described in step S1 includes: two left and right chassis, and an intermediate truss connecting the left and right chassis; when the grain-leveling robot is running, the left and right chassis move forward or backward, and cameras are installed in front, at the back and inside of each chassis.

3. The method for detecting the straight line of the granary walkway board edge under strong light conditions according to claim 1 is characterized in that: Step S3 specifically includes: using the Otsu method to calculate the inter-class variance, taking the grayscale value corresponding to the maximum inter-class variance as the expected threshold, and performing binary segmentation on the image processed in step S2 according to the expected threshold.