Obstacle detection method based on pixel interval, chip and robot

By extracting pixel intervals in the laser image and judging the grayscale difference, the problem of difficulty in distinguishing whether there are obstacles on the ground in the prior art is solved, and faster obstacle detection is achieved, which is suitable for robots in complex environments.

CN119904832APending Publication Date: 2025-04-29AMICRO SEMICONDUCTOR CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311407250.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

When using laser lines to detect obstacles, it is difficult to effectively distinguish whether there are obstacles on the ground, and a complete pixel search is required, resulting in large calculation volume and slow speed.

Method used

An obstacle detection method based on pixel intervals is adopted. By taking the ground line reference position point as the search center in the laser image, three pixel intervals to be judged, and whether there are obstacles are judged based on the grayscale difference between these pixel intervals.

Benefits of technology

It greatly reduces the number of pixel searches required to detect obstacles in single-column pixel points, improves detection speed, and is suitable for robots that quickly avoid obstacles in various environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904832A_ABST
    Figure CN119904832A_ABST
Patent Text Reader

Abstract

The invention discloses an obstacle detection method based on a pixel interval, a chip and a robot, and the method comprises the steps: A, a robot controls a line laser module to emit laser lines, and collects a laser image through the line laser module; wherein the line laser module pre-stores a ground line reference position point; then executing the step B; step B, in a laser image acquired by the online laser module, taking a ground line reference position point as a search center, and extracting three to-be-judged pixel intervals along the same column; then executing the step C; c, judging whether an obstacle exists in the environment reflected by the laser image or not based on the gray difference among the three to-be-judged pixel intervals; therefore, the obstacle detection is realized under the condition that the single-row pixel points are not completely searched, and the detection speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of pixel point data, and in particular to an obstacle detection method, chip and robot based on pixel intervals. Background Art

[0002] Line laser module refers to any laser module that includes a line laser transmitter and a camera module. In a line laser module, the line laser transmitter is used to emit laser lines outward; the camera module can collect environmental images and also receive laser lines reflected by objects. The laser lines can help detect the outline size of raised obstacles on the robot's travel plane and the ground and other information, collectively referred to as the position information of the laser lines.

[0003] The line laser transmitter emits laser lines according to the preset modulation cycle and transmission power level, and the camera module periodically collects images to obtain data of multiple frames of images; each frame of the image contains a laser line segment formed when the laser line hits the surface of the obstacle or the ground; in each frame of the image, a laser line segment is distributed with multiple coordinate data in columns; Chinese patent CN115619860A uses laser lines for positioning. It is necessary to judge the grayscale information of the pixel points at the upper and lower boundaries of a single column of the image and the inter-frame matching relationship between the two frames of the image respectively. On this basis, combined with the predicted grayscale change rules, all pixel points in the same column are searched and the search center is continuously updated, but it does not distinguish whether there are obstacles on the ground. Summary of the invention

[0004] This application discloses an obstacle detection method based on pixel intervals, and the specific technical solution is as follows: An obstacle detection method based on pixel intervals, the obstacle detection method comprising: step A, a robot controls a line laser module to emit a laser line, and then collects a laser image through the line laser module; wherein the line laser module pre-stores a ground line reference position point; then executing step B; step B, in the laser image collected by the line laser module, taking the ground line reference position point as the search center, extracting three pixel intervals to be judged along the same column; then executing step C; step C, judging whether there are obstacles in the environment reflected by the laser image based on the grayscale difference between the three pixel intervals to be judged.

[0005] In summary, the present application reduces the amount of pixel point search required to detect obstacles in a single column of pixels by executing steps B and C. Therefore, it is not necessary to conduct a complete search of a single column of pixels and use the entire column of pixels to participate in the calculation of the center point of the laser line. Moreover, it is suitable for using the pixels in the corresponding pixel intervals of each column of the laser image in various environments to speed up the detection speed. Compared with Chinese patent CN115619860A, the present application does not need to consider the inter-frame matching relationship between the same column of pixels in two frames of laser images, does not need to predict the grayscale change law of all pixels in the same column in advance, and does not need to continuously update the search center in a single frame of laser images. Instead, it can detect whether there is an obstacle from the local pixel interval in the single frame image, greatly reducing the amount of calculation consumed by the robot to process laser images column by column. The greater the search speed of the laser line center point increases, the faster the robot collects and processes single-frame laser images, that is, the higher the working frame rate; it is suitable for robots with low main control computing power and few running memory resources to perform fast obstacle avoidance operations in complex environments (including ground environments and non-ground environments), and to ensure that the line laser module forms a stable working frame rate during the pixel point search process.

[0006] Further, in step B, in the laser image collected by the online laser module, the method of taking the ground line reference position point as the search center and extracting three pixel intervals to be judged along the same column includes: in the current search column, taking the ground line reference position point as the search center, starting from the search center, respectively extracting two pixel intervals occupying a preset pixel distance along two opposite directions of the current search column, and then forming the two pixel intervals occupying the preset pixel distance into an effective search pixel interval; in the effective search pixel interval, successively extracting three pixel intervals with an equal number of pixel points along the first column direction or the second column direction, and then forming the three pixel intervals with an equal number of pixel points into an effective search pixel interval; The pixel intervals with equal quantity are marked as the first pixel interval to be determined, the second pixel interval to be determined and the third pixel interval to be determined in the order of being extracted, so that the coordinates of each pixel point distributed in the first pixel interval to be determined, the coordinates of each pixel point distributed in the second pixel interval to be determined and the coordinates of each pixel point distributed in the third pixel interval to be determined are arranged along the first column direction or the second column direction according to a fixed coordinate interval; wherein the three pixel intervals to be determined are the first pixel interval to be determined, the second pixel interval to be determined and the third pixel interval to be determined; wherein the two opposite directions of the current search column are the first column direction and the second column direction. Thus, in one column of the laser image, the effective search pixel interval is divided into three sections of the pixel intervals to be determined, so as to facilitate the subsequent judgment of the grayscale conditions of the three sections of the pixel intervals to be determined, without the need to conduct a complete search and judgment of the grayscale values ​​of the pixels in a single column, thereby improving the judgment speed.

[0007] Further, in step C, the method for judging whether there are obstacles in the environment reflected by the laser image based on the grayscale differences between the three pixel intervals to be judged includes: calculating the average grayscale value of each pixel distributed in the first pixel interval to be judged to obtain a first average grayscale value; calculating the average grayscale value of each pixel distributed in the second pixel interval to be judged to obtain a second average grayscale value; calculating the average grayscale value of each pixel distributed in the third pixel interval to be judged to obtain a third average grayscale value; judging whether the first average grayscale value is less than the second average grayscale value, and judging whether the third average grayscale value is less than the second average grayscale value; when judging that the first average grayscale value and the third average grayscale value are both less than the second average grayscale value, determining that there are no obstacles in the environment reflected by the laser image; when judging that the first average grayscale value is not less than the second average grayscale value, and / or the third average grayscale value is not less than the second average grayscale value, determining that there are obstacles in the environment reflected by the laser image. In summary, the present application only needs to extract the average grayscale value of three pixel intervals, perform up and down diffusion judgment with the ground line reference position point as the center, and determine that there is no obstacle when the average grayscale value of the pixel interval in the middle is greater than the average grayscale value of the pixel interval on both sides of it; in addition, when the average grayscale value of the pixel interval in the middle is not greater than the average grayscale value of the pixel interval on either side of it, it is determined that there is an obstacle state and the obstacle is detected; therefore, based on the size comparison information between the average grayscale values ​​of the three pixel intervals, a priority search is implemented to determine whether there is an obstacle near the pre-calibrated ground line reference position point, without the need to search a complete column of pixel points in a single-frame image.

[0008] Further, when searching for a pixel point within the preset pixel distance along the first column direction starting from the search center, a first detection pixel interval is extracted, so that the pixel points distributed in the first detection pixel interval include the pixel points distributed at the search center and the first pixel points to be processed that are distributed in sequence along the first column direction, and the pixel distance of each first pixel point to be processed relative to the search center does not exceed the preset pixel distance; the first detection pixel interval is a pixel interval occupying the preset pixel distance starting from the search center along the first column direction; when searching for a pixel point within the preset pixel distance starting from the search center along the second column direction, the first detection pixel interval is extracted. The second detection pixel interval is taken out, so that the pixel points distributed in the second detection pixel interval include the pixel points distributed at the search center and the second pixel points to be processed distributed in sequence along the second column direction, and the pixel distance of each second pixel point to be processed relative to the search center does not exceed the preset pixel distance; the second detection pixel interval is the pixel interval that occupies the preset pixel distance along the second column direction starting from the search center; wherein the first column direction is the upward direction of the current search column, and the second column direction is the downward direction of the current search column; the two pixel intervals that occupy the preset pixel distance are the first detection pixel interval and the second detection pixel interval. Thus, the coverage area in two opposite column directions of the same column is divided in the effective search pixel interval.

[0009] Furthermore, the current search column is parallel to the width direction of the laser line in the laser image; the width of the laser line in the laser image is less than the preset pixel distance; the preset pixel distance is less than half of the maximum pixel distance covered by a column of the laser image; the width of the laser line in the laser image is the pixel distance formed along the ordinate axis of the pixel coordinate system where the laser image is located after the laser line is reflected back to the line laser module. The effective search pixel interval does not cover all the pixels in a single column, but covers the pixels occupied by the laser line in a single column of the laser image, saving search time and improving the effectiveness of pixel search.

[0010] Furthermore, the overlapping pixels between the first detection pixel interval and the second detection pixel interval are the pixels distributed at the search center, the number of first pixels to be processed distributed in the first detection pixel interval is equal to the number of second pixels to be processed distributed in the second detection pixel interval, so that the number of pixels distributed in the effective search pixel interval is equal to the sum of twice the number of the first pixels to be processed and the value 1; wherein the pixel distance between two adjacent pixels in the first detection pixel interval is equal to the pixel distance between two adjacent pixels in the second detection pixel interval. Therefore, the first pixel to be processed and the second pixel to be processed are symmetrically distributed in the effective search pixel interval with the search center as the symmetry center.

[0011] Furthermore, whenever the robot determines that there is an obstacle in the current search column, the current search column is marked as a searched column and the next column is searched, and then the next column is updated as the current search column and step B is executed; wherein the next column is a column that has not been searched in the laser image; after the robot searches all valid search pixel intervals in the laser image, all columns in the laser image that are judged to have obstacles are obtained to form the obstacle distribution range formed by the projection of the laser line. Since each column does not need to perform a complete search operation, the pixel points near the pre-stored ground line reference position point are searched faster to speed up the distinction of the state of whether there is an obstacle or not.

[0012] A chip stores a computer program, and when the computer program is executed by the chip, the obstacle detection method is implemented, that is, step A, step B and step C are executed to obtain the judgment information of whether there are obstacles in different columns. Therefore, in step C, the center point of the laser line is not searched by completely processing the entire frame of laser image, but the ground line reference position point is pre-stored. Compared with the search method of the entire column of pixel points of the entire frame of laser image, the area where the obstacle exists is judged faster under the premise of ensuring the recognition and positioning accuracy of the center point of the laser line.

[0013] A robot, the robot body assembly line laser module, the line laser module includes a line laser emitter and a camera, the line laser emitter is used to emit laser lines toward the ground or the surface of an obstacle; the camera is used to collect the image formed by the reflection of the laser line from the ground or the surface of the obstacle to obtain the laser image; a controller is arranged inside the robot, the controller is electrically connected to the line laser module; the controller is configured to execute the obstacle detection method. Compared with Chinese patent CN115619860A, the robot disclosed in this application does not need to consider the inter-frame matching relationship between the same column of pixels between two frames of laser images, does not need to predict the grayscale change law of all pixels in the same column in advance, and does not need to continuously update the search center in a single frame of laser image, but can detect whether there is an obstacle from the local pixel interval in the single frame image, greatly reducing the amount of calculation consumed by the robot to process the laser image column by column. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a flowchart of an obstacle detection method based on pixel intervals according to an embodiment of the present application.

[0015] Figure 2 Another embodiment of the present application discloses a schematic diagram of sequentially dividing a column of a laser image into a first pixel interval to be determined AB, a second pixel interval to be determined CD, and a first pixel interval to be determined EF. Implementation

[0016] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the drawings in the embodiments of the present invention. To further illustrate the embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementations and advantages of the present invention.

[0017] See also Figure 1 The present application discloses an obstacle detection method based on pixel intervals, the obstacle detection method is applied to a robot of an assembly line laser module, and the obstacle detection method comprises: Step A, the robot controls the line laser module to emit laser line, and then collects laser image through the line laser module; wherein the line laser module stores the ground line reference position point in advance; then execute step B. The ground line reference position point is the coordinate position point of the ground line obtained by the laser line reflected from the ground after the line laser module is calibrated; preferably, the robot's travel plane can be represented by the ground. The laser image is the image of the laser stripe formed by the laser line reflected back to the line laser module; each column of the laser image is parallel to the width direction of the laser stripe.

[0018] It should be noted that the ground line is a combination of multiple pixel points formed by the laser line reflected from the ground to the line laser module when there are no obstacles on the robot's traveling plane, that is, when there are no obstacles on the ground in front of the robot, and the calibrated line laser module emits a laser line to the ground in front of it; wherein the multiple pixel points can be regarded as forming laser stripes to form a laser image, and one of the multiple pixel points is a ground line reference position point; if the pixel point coordinate system of the laser image is used to represent the pixel point, then the pixel coordinate point corresponding to a ground line reference position point in the pixel point coordinate system is a coordinate position point of the ground line, and the multiple ground line coordinate position points formed by the laser line reflected from the ground are sequentially connected to form the ground line; the ground line can also be understood as the laser stripes formed by the laser line reflected from the ground when there are no obstacles arranged on the ground in advance. In the obstacle detection method, a ground line reference position point represents the search starting point / search center for searching the corresponding pixel interval in a column of the same frame of laser image. The ground line corresponds to multiple ground line reference position points, which are distributed in multiple columns in the laser image.

[0019] Before step A, the internal and external parameters of the line laser module are calibrated and calculated. In some calibration scenarios, a calibration plate is set outside the line laser module, and a target is set on the surface of the calibration plate. The target image can be captured by the line laser module, and the image is generally a black and white rectangular pattern; then, by translating the calibration plate and capturing the target image in real time, the rotation matrix is ​​calculated or a general camera calibration model (for example, a distortion correction model) is used or a corresponding laser line equation is fitted (a straight line fitting equation or a surface fitting equation set based on the least squares method) to obtain the internal and external parameters of the line laser module, and the calibration of the line laser module is completed. At this time, the line laser transmitter or camera included in the line laser module has been calibrated / calibrated. On this basis, when there is no obstacle in front of the robot (or an obstacle within the field of view of the camera), the laser line emitted by the line laser transmitter is reflected back to the field of view of the camera on the ground, and the ground line reference position point in the image captured by the camera is formed, that is, the coordinate position point of the ground line obtained by the line laser module after calibration, which can be saved in the storage medium inside the line laser module. This can predict the approximate range of the laser line's reflection position on the ground and enhance the ability to resist interference from ambient light.

[0020] In step A, for the working scene of the sweeping robot, when there are no obstacles on the ground or obstacles on the ground, the line laser emitter in the line laser module can be controlled to emit laser lines. After the laser lines are emitted to the obstacles on the path of the sweeping robot, they will be reflected back and collected as laser images by the camera in the line laser module. The environmental information reflected by the laser image covers at least the ground medium and the obstacles on the ground, wherein the laser lines will pass through the surface of the obstacle or the ground to form laser line segments in the laser image, that is, the image collected by the camera will contain the laser stripes formed by the laser lines emitted by the line laser emitter after encountering the object or the ground, and each of the laser stripes has multiple pixels distributed in each column, which can be searched by subsequent steps. Thus, a search area is constructed in the laser image for detecting obstacles.

[0021] It should be added that the set of ground line reference position points can be a set of points in the pixel coordinate system (or camera coordinate system) converted from the world coordinate system to the laser point set; the laser point set is a description form of the laser point cloud; each pixel point in the laser image corresponds to a point on the obstacle surface or the ground, and the points on the obstacle surface or the ground corresponding to the pixel points in the laser image constitute the laser point set. Moreover, each column of the laser image is parallel to the width direction of the laser line in the laser image, wherein the width direction of the laser line in the laser image is the width direction of the laser stripes formed by the reflection of the laser line, and the width direction of the laser line in the laser image is pre-calibrated by the intrinsic parameter matrix of the line laser module to be parallel to each column of the laser image.

[0022] Step B: In the laser image collected by the online laser module, three pixel intervals to be judged are extracted along the same column with the ground line reference position point as the search center; then step C is executed. In this embodiment, the area covered by the three pixel intervals to be judged is smaller than the area completely covered by a single column of pixels (a complete column of pixels). Each time step B is executed, a single column of pixels of a frame of laser image is searched, and the search range is limited to each pixel interval to be judged extracted from the same column, and each pixel interval to be judged is extracted sequentially from the same column along a single direction.

[0023] Step C, based on the grayscale difference between the three pixel intervals to be judged, it is judged whether there are obstacles in the environment reflected in the laser image. If yes, it is judged that there are obstacles in the environment reflected in the laser image. Otherwise, it is judged that there are no obstacles in the environment reflected in the laser image, but the aforementioned ground line can be identified. Thus, by extracting the average grayscale value of the three pixel intervals, it is determined whether there are obstacles in a single column by diffusing up and down with the ground line reference position point as the center. Among them, the grayscale difference between the three pixel intervals to be judged includes the relationship between the average grayscale value of the pixel interval in the middle and the average grayscale value of the pixel intervals on both sides of the same column to determine whether there are obstacles. Preferably, the scene without obstacles includes the low obstacles on the ground that are not enough to constitute the robot's crossing obstacles. The low obstacles here are obstacles that can be crossed by the robot; and the scene with obstacles includes the obstacles on the ground that are enough to hinder the robot from moving forward.

[0024] In summary, the present application reduces the amount of pixel point search required to detect obstacles in a single column of pixels by executing steps B and C. Therefore, it is not necessary to perform a complete search of a single column of pixels and use the entire column of pixels to calculate the center point of the laser line. Moreover, it is suitable for using the pixels in the corresponding pixel intervals of each column of the laser image in various environments to speed up the detection speed. Compared with Chinese patent CN115619860A, the present application does not need to consider the inter-frame matching relationship between the same column of pixels in two frames of laser images, does not need to predict the grayscale change law of all pixels in the same column in advance, and does not need to continuously update the search center in a single frame of laser images. Instead, it can detect whether there is an obstacle from the local pixel interval in the single frame image, greatly reducing the amount of calculation consumed by the robot to process laser images column by column.

[0025] The greater the search speed of the laser line center point increases, the faster the robot collects and processes single-frame laser images, that is, the higher the working frame rate; it is suitable for robots with low main control computing power and few running memory resources to perform fast obstacle avoidance operations in complex environments (including ground environments and non-ground environments), and to ensure that the line laser module forms a stable working frame rate during the pixel point search process.

[0026] In some embodiments, if it is determined through step C that there is an obstacle in the environment reflected by the laser image, it is determined that there is an obstacle point in the laser image, and the entire column of pixels needs to be searched to locate the position of the obstacle point. If it is determined through step C that there is no obstacle in the environment reflected by the laser image, it is determined that there is no obstacle on the ground in the environment reflected by the laser image, and the center point of the laser line can be located without searching the entire column of pixels to increase the search speed. Therefore, steps B and C are equivalent to a judgment of the existence of an obstacle that must be performed before the robot uses the laser line for positioning, so as to determine the search range of the subsequent single column of pixels.

[0027] As an embodiment, in step B, in the laser image collected by the online laser module, the method of taking the ground line reference position point as the search center and extracting three pixel intervals to be determined along the same column includes: In the current search column, the ground line reference position point is taken as the search center, and starting from the search center, two pixel intervals occupying a preset pixel distance are extracted along two opposite directions of the current search column, and then the two pixel intervals occupying the preset pixel distance are combined into an effective search pixel interval, so that each pixel point distributed in the effective search pixel interval includes the pixel point distributed at the search center and all pixel points distributed in the two pixel intervals occupying the preset pixel distance except the pixel point distributed at the search center. Among them, the current search column is a column that the robot is currently searching in the process of searching the laser image by column; the robot's current search status of the pixel points in each column of the laser image is determined by defining the current search column. Whenever searching in a column, the pixel points can be searched row by row. The method of searching the laser image by column is preferably: the robot can search the laser image column by column, or search at a certain column interval (for example, searching every other column) in order to save time, and the specific number of searches can be related to the resolution of the laser image. For example, when the resolution of the laser image is 680X380, the number of pixels occupied by the laser image along the ordinate axis of the pixel coordinate system is 380, that is, the number of complete pixels in a single column is 380; the number of pixels occupied by the laser image along the abscissa axis of the pixel coordinate system is 680, that is, there are 680 columns in the laser image. If the laser image is searched column by column, 680 columns need to be searched, causing the robot to search by column 680 times; if the laser image is searched every other column, 340 columns need to be searched, causing the robot to search by column 340 times.

[0028] The current search column is parallel to the width direction of the laser line in the laser image, wherein the width direction of the laser line in the laser image is the width direction of the laser stripe formed by the laser line after reflection, and the width direction of the laser line in the laser image is pre-calibrated to be parallel to the current search column through the intrinsic parameter matrix of the line laser module; preferably, the current search column is parallel to the ordinate axis of the pixel coordinate system where the laser image is located or parallel to the abscissa axis of the pixel coordinate system where the laser image is located; wherein the coordinates of the pixel point include the abscissa of the pixel point and the ordinate of the pixel point; when the row coordinate of the pixel point in the pixel coordinate system is the ordinate of the pixel point, the two opposite directions of the current search column are respectively the first column direction and the second column direction, the first column direction is the upward direction of the current search column, and the second column direction is the downward direction of the current search column; in this embodiment, the two pixel intervals occupying the preset pixel distance are respectively the first detection pixel interval and the second detection pixel interval. Therefore, the two opposite directions of the current search column are respectively set to the upward direction of the current search column and the downward direction of the current search column, which belong to two column directions with opposite directions.

[0029] When searching for pixels within the preset pixel distance along the first column direction starting from the search center, a first detection pixel interval is extracted, that is, in the upward direction of the current search column, within the area within the preset pixel distance relative to the search center, each pixel point is searched in sequence to form a first detection pixel interval, so that the pixel points distributed in the first detection pixel interval include the pixel points distributed at the search center and the first pixel points to be processed that are distributed in sequence along the first column direction, that is, the pixel points distributed at the search center and the first pixel points to be processed that are distributed in sequence along the first column direction constitute the first detection pixel interval; the pixel distance of each first pixel point to be processed relative to the search center does not exceed the preset pixel distance; therefore, the first detection pixel interval is a pixel interval that occupies the preset pixel distance along the first column direction starting from the search center, and each pixel point in the first detection pixel interval is discretely distributed along the first column direction. Combined with Figure 2 It can be seen that when the robot searches for the column where the ground line reference position point O is located, the column where the ground line reference position point O is located is marked as the current search column, and then the ground line reference position point O is set as the search center, corresponding to Figure 2 The black cells are represented by; starting from the ground line reference position point O, the first detection pixel interval is extracted in the upward direction of the current search column. Figure 2 The distance occupied by the inner column along the column direction is Figure 2 The straight-line distance OA.

[0030] When searching for pixel points within the preset pixel distance along the second column direction starting from the search center, the second detection pixel interval is extracted. Specifically, in the downward direction of the current search column, within the area within the preset pixel distance relative to the search center, each pixel point is searched in sequence to form a second detection pixel interval, so that the pixel points distributed in the second detection pixel interval include the pixel points distributed at the search center and the second pixel points to be processed that are distributed in sequence along the second column direction, that is, the pixel points distributed at the search center and the second pixel points to be processed that are distributed in sequence along the second column direction constitute the second detection pixel interval; the pixel distance of each second pixel point to be processed relative to the search center does not exceed the preset pixel distance; therefore, the second detection pixel interval is a pixel interval that occupies the preset pixel distance along the second column direction starting from the search center, and each pixel point in the second detection pixel interval is discretely distributed along the second column direction. Combined with Figure 2 It can be seen that the second detection pixel interval is extracted from the ground line reference position point O along the downward direction of the current search column. Figure 2 The distance occupied by the inner column along the column direction is Figure 2 Thus, the coverage areas in two opposite column directions of the same column are delimited to form the pixel interval defined by the box where the dotted line segment AF is located, which is recorded as the effective search pixel interval.

[0031] In the effective search pixel interval, three pixel intervals with equal numbers of pixels are extracted in sequence along the first column direction or the second column direction, and then the three pixel intervals with equal numbers of pixels are respectively marked as the first pixel interval to be determined, the second pixel interval to be determined and the third pixel interval to be determined in the order of extraction, so that the coordinates of each pixel point distributed in the first pixel interval to be determined, the coordinates of each pixel point distributed in the second pixel interval to be determined and the coordinates of each pixel point distributed in the third pixel interval to be determined are arranged along the first column direction or the second column direction according to fixed coordinate intervals; preferably, the three pixel intervals with equal numbers of pixels are configured not to overlap each other in the effective search pixel interval of the same column.

[0032] In this embodiment, the three pixel intervals to be determined are the first pixel interval to be determined, the second pixel interval to be determined and the third pixel interval to be determined, so that the effective search pixel interval is divided into three sections of the pixel intervals to be determined; there is a certain pixel interval between two adjacent sections of the pixel intervals to be determined. In the same column, the second pixel interval to be determined is located between the first pixel interval to be determined and the third pixel interval to be determined, so that the second pixel interval to be determined is located in the middle area of ​​the effective search pixel interval.

[0033] Corresponding to Figure 2In the process of extracting multiple pixel intervals to be determined, starting from the pixel point at the uppermost position point A of the effective search pixel interval, the pixel points are searched along the second column direction until the pixel point at the position point B is searched, and 6 pixel points are selected in sequence (which can be obtained by counting the searched pixel points) to form the first pixel interval to be determined; then starting from the next pixel point, that is, the pixel point at the position point C, the pixel points are continued to be searched along the second column direction until the pixel point at the position point D is searched, and 6 pixel points are selected in sequence (which can be obtained by counting the searched pixel points) to form the second pixel interval to be determined; then starting from the next pixel point, that is, the pixel point at the position point E, the pixel points are continued to be searched along the second column direction until the pixel point at the position point F is searched, and 6 pixel points are selected in sequence (which can be obtained by counting the searched pixel points) to form the third pixel interval to be determined. At this point, the pixel point at the lowermost position point F of the effective search pixel interval has been searched in the current search column. Therefore, in a column of the laser image, the effective search pixel interval is divided into three segments of the pixel intervals to be judged, so as to facilitate the subsequent judgment of the grayscale conditions of the three segments of the pixel intervals to be judged, without the need to perform a complete search and judgment on the grayscale values ​​of a single column of pixels, thereby improving the judgment speed.

[0034] In step C, the method for judging whether there is an obstacle in the environment reflected by the laser image based on the grayscale difference between the three pixel intervals to be judged includes: Calculate the average grayscale value of each pixel point distributed in the first pixel interval to be judged to obtain a first average grayscale value. The specific implementation is to calculate the ratio between the grayscale value sum of all pixel points in the first pixel interval to be judged and the number of all pixel points in the first pixel interval to be judged in the current search column, as the first average grayscale value, to characterize the grayscale distribution characteristics in the first pixel interval to be judged.

[0035] Calculate the average grayscale value of each pixel point distributed in the second pixel interval to be determined to obtain a second average grayscale value; specifically, calculate the ratio between the grayscale value and the number of all pixel points in the second pixel interval to be determined in the current search column as the second average grayscale value to characterize the grayscale distribution characteristics in the second pixel interval to be determined.

[0036] Calculate the average grayscale value of each pixel point distributed in the third pixel interval to be determined to obtain a third average grayscale value; specifically, calculate the ratio between the grayscale value and the number of all pixels in the third pixel interval to be determined in the current search column as the third average grayscale value to characterize the grayscale distribution characteristics in the third pixel interval to be determined.

[0037] Then, it is determined whether the first average grayscale value is less than the second average grayscale value, and it is determined whether the third average grayscale value is less than the second average grayscale value. When it is determined that both the first average grayscale value and the third average grayscale value are less than the second average grayscale value, that is, when it is determined that the average grayscale value of the second pixel interval to be determined is respectively greater than the average grayscale values ​​of the pixel intervals on both sides thereof, it is determined that there are no obstacles in the environment reflected by the laser image, and it is determined that there is a ground line in the laser image, and preferably it can be determined that there are no obstacles in front of the robot; wherein, the environment reflected by the laser image includes the ground environment.

[0038] When it is determined that the first average grayscale value is not less than the second average grayscale value, and / or the third average grayscale value is not less than the second average grayscale value, it is determined that there is an obstacle in the environment reflected by the laser image, then it is determined that there is an obstacle image in the laser image, and preferably it can be determined that there is an obstacle in front of the robot; but the ground line cannot be effectively extracted from the laser image.

[0039] In summary, the present embodiment only needs to extract the average grayscale value of the three pixel intervals, perform the upward and downward diffusion judgment with the ground line reference position point as the center, and determine that there is no obstacle when the average grayscale value of the pixel interval in the middle is respectively greater than the average grayscale value of the pixel interval on both sides thereof; in addition, when the average grayscale value of the pixel interval in the middle is not greater than the average grayscale value of the pixel interval on either side thereof, it is determined that there is an obstacle state, and the obstacle is detected; therefore, based on the size comparison information between the average grayscale values ​​of the three pixel intervals, a priority search is implemented to determine whether there is an obstacle near the pre-calibrated ground line reference position point, without the need to search a complete column of pixel points in a single-frame image.

[0040] The current search column is parallel to the width direction of the laser line in the laser image; preferably, the current search column is parallel to the ordinate axis of the pixel coordinate system where the laser image is located. The width of the laser line in the laser image (corresponding to Figure 2 The longitudinal distance of the white area in the laser image) is less than the preset pixel distance and also less than the length of the laser line in the laser image (corresponding to Figure 2 The width of the laser line in the laser image is preferably represented by 15 pixels continuously distributed along the column direction. Moreover, the preset pixel distance is less than half of the maximum pixel distance covered by a column of the laser image, so that the effective search pixel interval does not cover all the pixels in a single column, but covers all the pixels occupied by the laser line in a single column of the laser image, saving search time and improving the effectiveness of pixel search.

[0041] If the pixel distance is represented by the number of pixels, the number of pixels occupied by the laser image on the ordinate axis of the pixel coordinate system is the maximum pixel distance covered by a column of the laser image.

[0042] It should be noted that the width of the laser line in the laser image is the pixel distance formed along the vertical axis of the pixel coordinate system where the laser image is located after the laser line is reflected back to the line laser module, so that the width direction of the laser line in the laser image is parallel to the current search column.

[0043] On the basis of extracting the first detection pixel interval and the second detection pixel interval in the aforementioned embodiment, the overlapping pixels between the first detection pixel interval and the second detection pixel interval are the pixels distributed at the search center, the number of the first to-be-processed pixels distributed in the first detection pixel interval is equal to the number of the second to-be-processed pixels distributed in the second detection pixel interval, so that the number of pixels distributed in the effective search pixel interval is equal to the sum of twice the number of the first to-be-processed pixels and the value 1 or the sum of twice the number of the second to-be-processed pixels and the value 1; wherein, the pixel distance between two adjacent pixels in the first detection pixel interval is equal to the pixel distance between two adjacent pixels in the second detection pixel interval, and preferably, each pixel is searched in accordance with a preset pixel step in both the first detection pixel interval and the second detection pixel interval. The first to-be-processed pixels and the second to-be-processed pixels obtained thereby are symmetrically distributed in the effective search pixel interval with the search center as the symmetric center.

[0044] Preferably, the number of first pixels to be processed distributed in the first detection pixel interval is equal to 10, which can be regarded as increasing 10 ordinates or 10 subscripts from the search center along the current search column upward direction to obtain 10 first pixels to be processed; the number of second pixels to be processed distributed in the second detection pixel interval is equal to 10, which can be regarded as decreasing 10 ordinates or 10 subscripts from the search center along the current search column downward direction to obtain 10 second pixels to be processed; and then taking into account a pixel distributed at the search center, a total of 21 pixels are obtained in the effective search pixel interval. Therefore, by taking 10 pixels above and below from the ground line reference position point, the row search range of the center point of a single column of laser lines is limited to 21 rows but not the row range covered by the entire column, corresponding to step C, which is to expand the pixel search range of the ground line in a single column from the traditional single row to the coverage range of the first detection pixel interval and the coverage range of the second detection pixel interval, so as to overcome the interference of ambient light intensity to obtain the effective search pixel interval.

[0045] Furthermore, the grayscale values ​​of 21 pixels within the pixel interval whose row search range is limited to 21 rows are substituted into the weighted average calculation formula involved in the grayscale centroid method. Compared with directly calculating 380 pixels in a single column, calculating 21 pixels can obtain the same result, while the amount of calculation data is reduced by nearly 20 times, thereby improving the search speed of the center point of the laser line.

[0046] In some embodiments, when it is determined that the first average grayscale value and the third average grayscale value are both less than the second average grayscale value, that is, when it is determined that the average grayscale value of the second pixel interval to be determined is greater than the average grayscale values ​​of the pixel intervals on both sides thereof, it is determined that there is no obstacle in the laser image but the ground line can be identified; since the first detection pixel interval is searched upward along the current search column starting from the search center, and the second detection pixel interval is searched downward along the current search column, if the grayscale value of each second pixel to be processed tends to decrease in the downward direction of the current search column within the second detection pixel interval, and the grayscale value of each first pixel to be processed tends to decrease in the upward direction of the current search column within the first detection pixel interval, then the grayscale value change in the first detection pixel interval and the grayscale value change in the second detection pixel interval can comprehensively reflect the grayscale value distribution characteristics of the pixel points near the ground line in the local area.

[0047] It should be noted that each pixel point distributed in the effective search pixel interval is represented by a square in each column of the laser image, so that the pixel distance is represented by the number of pixel points; when the size of the square is larger, the resolution of the laser image is lower, the distance between two adjacent pixel points is larger, and the number of pixel points used to represent the same pixel distance becomes smaller; when the size of the square is smaller, the resolution of the laser image is higher, the distance between two adjacent pixel points is smaller, and the number of pixel points used to represent the same pixel distance becomes larger.

[0048] If the grayscale value range of the pixel is also expressed as a value of 0 to 255, each frame of laser image captured by the line laser module can be regarded as converted into a grayscale image, where grayscale is grayscale, and the larger the grayscale value, the larger the grayscale value, where the value 0 can represent the blackest pixel and the value 255 can represent the whitest pixel.

[0049] The pixel mentioned in this application is an indivisible unit in a frame of laser image. Each frame of laser image is composed of a large number of pixel points. It exists as a square of a single color. The grayscale image uses a capacity of one byte to store one pixel point.

[0050] In some embodiments, whenever the robot determines that there is an obstacle in the current search column, it marks the current search column as a searched column and searches the next column to implement a column-changing search, then updates the next column to the current search column and executes step B, and then determines whether there is an obstacle in the next column by executing steps B to C; wherein the next column is a column that has not been searched in the laser image, and preferably the next column is an adjacent column to the current search column. For the same frame of the laser image, the robot repeatedly executes steps B to C to obtain whether there is an obstacle in the effective search pixel interval of each column.

[0051] In the process of repeatedly executing steps B to C, if the robot determines that there is an obstacle in each column that needs to be searched in a frame of laser image, the obstacle distribution range formed by the projection of the laser line is formed, and the center point of the laser line can be further calculated to determine the distribution position of the obstacle contour line. After the robot searches all the valid search pixel intervals in the laser image, all the columns in the laser image that are judged to have obstacles are obtained, which constitute the obstacle distribution range formed by the projection of the laser line.

[0052] Specifically, the robot searches all valid search pixel intervals in the laser image, including searching the laser image column by column, or searching at a certain column interval (it can be an alternate column search); wherein, steps B to C are executed in each column search to obtain the judgment result in the corresponding column, so as to obtain the center points of each column of laser lines within the maximum search range, constituting the obstacle distribution range formed by the projection of the laser line.

[0053] Whenever the current search column is determined, the search center, the first pixel to be processed, and the second pixel to be processed in the same column are distinguished by the ordinate value to determine the obstacles by column. Since each column does not need to be fully searched, the pixel points near the pre-stored ground line reference position point are searched to speed up the distinction of whether there are obstacles or not.

[0054] The present application also discloses a chip storing a computer program, wherein when the computer program is executed by the chip, the obstacle detection method disclosed in the above-mentioned embodiment is implemented, that is, step A, step B and step C are executed to obtain the judgment information of whether there are obstacles in different columns. Therefore, in step C, the center point of the laser line is not searched by completely processing the entire frame of laser image. Compared with the method of searching the entire column of pixel points of the entire frame of laser image, the area where obstacles exist is judged faster under the premise of ensuring the recognition and positioning accuracy of the center point of the laser line.

[0055] Based on the aforementioned embodiments, a robot is also disclosed, the body of which is assembled with a line laser module; the line laser module includes a line laser emitter and a camera, both of which are fixedly mounted on the robot; the line laser emitter is used to emit a laser line toward the ground or an obstacle surface, and the laser line is reflected on the obstacle surface or the ground to form a laser point set, which may be a laser point set obtained after the line laser emitter is calibrated; the laser point set may be regarded as being located in the intersection of the emitted laser plane and the obstacle surface or the ground or in the vicinity of the intersection, and if the laser point set originates from the intersection between the laser plane and the ground, it may be regarded as the ground line disclosed in the aforementioned embodiments; the camera is used to capture an image formed by the laser line reflected from the ground or the obstacle surface to obtain a laser image, and image data containing laser stripe information may be obtained, and the image data is image data obtained after the camera is calibrated.

[0056] A controller is provided inside the robot, and the controller is electrically connected to the line laser module; the controller is configured to execute the obstacle detection method disclosed in the aforementioned embodiment, and can judge whether there is an obstacle in the laser image column by column. Compared with Chinese patent CN115619860A, the robot disclosed in this application does not need to consider the inter-frame matching relationship between the same column of pixels between two frames of laser images, does not need to predict the grayscale change law of all pixels in the same column in advance, and does not need to continuously update the search center in a single frame of laser image, but can detect whether there is an obstacle from the local pixel interval in the single frame image, greatly reducing the amount of calculation consumed by the robot to process the laser image column by column. The greater the search speed of the center point of the laser line is increased, the faster the robot collects and processes the single frame laser image, that is, the higher the working frame rate; it is suitable for robots with low main control computing power and few running memory resources to perform rapid obstacle avoidance operations in complex environments (including ground environments and non-ground environments), and ensure that the line laser module forms a stable working frame rate during the pixel search process.

[0057] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable technicians familiar with the technical field to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. The obstacle detection method based on pixel interval is characterized by: The obstacle detection method comprises: Step A, the robot controls the line laser module to emit a laser line, and then collects a laser image through the line laser module; wherein the line laser module stores the ground line reference position point in advance; and then executes step B; Step B, in the laser image collected by the online laser module, taking the ground line reference position point as the search center, extracting three pixel intervals to be judged along the same column; then executing step C; Step C: judging whether there is an obstacle in the environment reflected by the laser image based on the grayscale difference between the three pixel intervals to be judged.

2. The obstacle detection method according to claim 1, characterized in that: In the step B, in the laser image collected by the online laser module, the method of taking the ground line reference position point as the search center and extracting three pixel intervals to be determined along the same column includes: In the current search column, the ground line reference position point is taken as the search center, and starting from the search center, two pixel intervals occupying a preset pixel distance are extracted along two opposite directions of the current search column, and then the two pixel intervals occupying the preset pixel distance form an effective search pixel interval; In the effective search pixel interval, three pixel intervals with an equal number of pixel points are sequentially extracted along the first column direction or the second column direction, and the three pixel intervals with an equal number of pixel points are respectively marked as a first pixel interval to be determined, a second pixel interval to be determined, and a third pixel interval to be determined in the order in which they are extracted, so that the coordinates of each pixel point distributed in the first pixel interval to be determined, the coordinates of each pixel point distributed in the second pixel interval to be determined, and the coordinates of each pixel point distributed in the third pixel interval to be determined are arranged along the first column direction or the second column direction at fixed coordinate intervals; The three pixel intervals to be determined are respectively a first pixel interval to be determined, a second pixel interval to be determined and a third pixel interval to be determined; The two opposite directions of the current search column are respectively the first column direction and the second column direction.

3. The obstacle detection method according to claim 2, characterized in that: In step C, the method for judging whether there is an obstacle in the environment reflected by the laser image based on the grayscale difference between the three pixel intervals to be judged includes: Calculate the average grayscale value of each pixel point distributed in the first pixel interval to be determined to obtain a first average grayscale value; Calculate the average grayscale value of each pixel point distributed in the second pixel interval to be determined to obtain a second average grayscale value; Calculate the average grayscale value of each pixel point distributed in the third pixel interval to be determined to obtain a third average grayscale value; Determine whether the first average grayscale value is less than the second average grayscale value, and determine whether the third average grayscale value is less than the second average grayscale value; When it is determined that the first average grayscale value and the third average grayscale value are both smaller than the second average grayscale value, it is determined that there are no obstacles in the environment reflected by the laser image; When it is determined that the first average grayscale value is not less than the second average grayscale value, and / or the third average grayscale value is not less than the second average grayscale value, it is determined that there are obstacles in the environment reflected by the laser image.

4. The obstacle detection method according to claim 2, characterized in that: When searching for a pixel point within the preset pixel distance along the first column direction starting from the search center, extracting a first detection pixel interval, so that the pixel points distributed in the first detection pixel interval include the pixel points distributed at the search center and the first pixel points to be processed that are sequentially distributed along the first column direction, and the pixel distance of each first pixel point to be processed relative to the search center does not exceed the preset pixel distance; the first detection pixel interval is a pixel interval that occupies the preset pixel distance along the first column direction starting from the search center; When searching for a pixel point within the preset pixel distance along the second column direction starting from the search center, extracting a second detection pixel interval, so that the pixel points distributed in the second detection pixel interval include the pixel points distributed at the search center and the second pixel points to be processed that are distributed in sequence along the second column direction, and the pixel distance of each second pixel point to be processed relative to the search center does not exceed the preset pixel distance; the second detection pixel interval is a pixel interval that occupies the preset pixel distance along the second column direction starting from the search center; The first column direction is the upward direction of the current search column, and the second column direction is the downward direction of the current search column; the two pixel intervals occupying the preset pixel distance are the first detection pixel interval and the second detection pixel interval respectively.

5. The obstacle detection method according to claim 4, characterized in that: The current search column is parallel to the width direction of the laser line in the laser image; The width of the laser line in the laser image is less than the preset pixel distance; the preset pixel distance is less than half of the maximum pixel distance covered by a column of the laser image; The width of the laser line in the laser image is the pixel distance formed along the ordinate axis of the pixel coordinate system where the laser image is located after the laser line is reflected back to the line laser module.

6. The obstacle detection method according to claim 4, characterized in that: The pixels overlapping between the first detection pixel interval and the second detection pixel interval are the pixels distributed at the search center, the number of first pixels to be processed distributed in the first detection pixel interval is equal to the number of second pixels to be processed distributed in the second detection pixel interval, and the number of pixels distributed in the effective search pixel interval is equal to the sum of twice the number of the first pixels to be processed and 1; The pixel distance between two adjacent pixels in the first detection pixel interval is equal to the pixel distance between two adjacent pixels in the second detection pixel interval.

7. The obstacle detection method according to claim 3, characterized in that: Whenever the robot determines that there is an obstacle in the current search column, the current search column is marked as a searched column and the next column is searched, and then the next column is updated as the current search column and step B is executed; wherein the next column is a column that has not been searched in the laser image; After searching all valid search pixel intervals in the laser image, the robot obtains all columns in the laser image that are judged to have obstacles, which constitute the obstacle distribution range formed by the projection of the laser line.

8. A chip storing a computer program, characterized in that: When the computer program is executed by a chip, the obstacle detection method according to any one of claims 1 to 7 is implemented.

9. A robot, the robot body is equipped with a line laser module, the line laser module includes a line laser transmitter and a camera, the line laser transmitter is used to transmit a laser line toward the ground or the surface of an obstacle; the camera is used to collect an image formed by the laser line reflected by the ground or the surface of an obstacle to obtain a laser image; a controller is arranged inside the robot, and the controller is electrically connected to the line laser module; characterized in that, The controller is configured to execute the obstacle detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Laser positioning method based on image information and robot

    CN115619860A