Side wall recognition method and device, robot and readable storage medium
By setting up a linear lidar on the side panel of the robot and combining image processing technology to detect vertical obstacles in the side area of the robot, the problem that existing lidar cannot detect walls is solved, and the safety of robot navigation along the wall is improved Sex and accuracy.
Patent Information
- Application Number
- CN202411235110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-10
Smart Images

Figure CN119107622A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics technology, and in particular to a side wall recognition method, device, robot and readable storage medium. Background Art
[0002] Linear LiDAR is a distance measurement sensor. Due to its simple structure and low price, it is widely used in equipment such as robots. Linear LiDAR mainly determines whether there is an obstacle by measuring the distance. It compares the actual distance when there is an obstacle with the preset distance when there is no obstacle. If the actual distance is less than the preset distance, it is considered that there is an obstacle. This method is simple in theory and usually works well on flat ground, but it is easy to misdetect it as an obstacle in scenes such as climbing a slope or crossing a small bump. In addition, for 2D LiDAR, it can only detect horizontal obstacles on one side within the installation height range, and cannot detect whether there are obstacles in the vertical direction, such as walls. In robot navigation, it is necessary to move along the wall, or to navigate along one side of the corridor. Therefore, the existing LiDAR solution cannot meet the needs of moving along the wall well. Summary of the invention
[0003] In view of this, the present application provides a side wall recognition method, device, robot and readable storage medium, which can solve the problem in the prior art that the robot cannot meet the need to walk along the wall because it cannot detect whether there is a wall in the vertical direction during movement.
[0004] In a first aspect, an embodiment of the present application provides a side wall recognition method, comprising:
[0005] Obtain initial sensor data of the line laser radar in the area to the side of the detection robot;
[0006] Preprocessing the initial sensor data to obtain valid sensor data;
[0007] Converting the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology;
[0008] Obtaining information of a circumscribed rectangle surrounding a non-zero pixel in the image data; wherein the pixel value of the non-zero pixel is not zero;
[0009] When the circumscribed rectangle information is greater than a preset value, the coordinates of the non-zero pixel points are projected in a vertical direction, so as to divide the image data into a ground detection image and a non-ground detection image according to the projected coordinates;
[0010] When it is detected that there is a minimum target point in the non-ground detection image, it is determined that there is a wall on the side, wherein the minimum target point is the value with the smallest horizontal coordinate among the non-zero pixel points.
[0011] In a second aspect, an embodiment of the present application further provides a side wall recognition device, comprising:
[0012] A data acquisition module, used to acquire initial sensor data of the line laser radar in the detection area on the side of the robot;
[0013] A preprocessing module, used for preprocessing the initial sensor data to obtain valid sensor data;
[0014] An image conversion module, used to convert the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology;
[0015] A rectangle extraction module, used to obtain information of a circumscribed rectangle surrounding a non-zero pixel point in the image data; wherein the pixel value of the non-zero pixel point is not zero;
[0016] An image segmentation module, used for projecting the coordinates of the non-zero pixel points in a vertical direction when the circumscribed rectangle information is greater than a preset value, so as to divide the image data into a ground detection image and a non-ground detection image according to the projected coordinates;
[0017] The wall detection module is used to determine the presence of a wall on the side when a minimum target point is detected in the non-ground detection image, wherein the minimum target point is the value with the smallest horizontal coordinate among the non-zero pixel points.
[0018] In a third aspect, an embodiment of the present application further provides a robot, the robot comprising a line laser radar, a processor and a memory;
[0019] The line laser radar is arranged on the side panel of the robot to collect the side area environment information of the robot;
[0020] The memory stores a computer program;
[0021] The processor is used to execute the computer program to implement the side wall recognition method, and when a wall is recognized to exist on the side, perform corresponding wall-following actions.
[0022] In a fourth aspect, an embodiment of the present application further provides a readable storage medium storing a computer program, wherein the computer program implements the side wall recognition method when executed.
[0023] The embodiments of the present application have the following advantages:
[0024] The side wall recognition method proposed in the embodiment of the present application obtains the initial sensor data of the line laser radar when detecting the side area of the robot; pre-processes the initial sensor data to obtain effective sensor data; converts the effective sensor data into image data for reflecting the laser morphology according to the preset resolution; obtains the circumscribed rectangle information surrounding all non-zero pixels in the image data; when the circumscribed rectangle information is greater than the preset value, the coordinates of the non-zero pixels are projected in the vertical direction to divide the image data into ground detection images and non-ground detection images according to the projected coordinates; when the minimum target point is detected in the non-ground detection image, it is determined that there is a wall on the side. This method can improve the robot's wall recognition ability and environmental perception ability by installing a line laser radar that can sense the robot's side environment such as the ground and vertical direction, and combines image processing to perform morphological recognition of the line laser beam for wall detection, thereby avoiding collisions of the robot during movement along walls or corridors. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of the structure of a robot according to an embodiment of the present application is shown;
[0027] Figure 2 A schematic diagram of installing a line laser radar according to an embodiment of the present application is shown;
[0028] Figure 3 A first flow chart of the side wall recognition method according to an embodiment of the present application is shown;
[0029] Figure 4 A flow chart for converting sensor data into two-dimensional image data is shown;
[0030] Figure 5 A schematic diagram showing the conversion of sensor data from a polar coordinate system to a Cartesian coordinate system is shown;
[0031] Figure 6 A flowchart of obtaining bounding rectangle information according to an embodiment of the present application is shown;
[0032] Figure 7 A comparison diagram showing the image with disconnected points and the image after being connected is shown;
[0033] Figure 8A schematic diagram showing a method of dividing a type of image data into a ground detection image and a non-ground detection image;
[0034] Fig. 9 A schematic diagram showing another type of image data being divided into ground detection images and non-ground detection images;
[0035] Fig.10 A second flow chart of the side wall recognition method according to an embodiment of the present application is shown;
[0036] Fig.11 A structural schematic diagram of a side wall recognition device according to an embodiment of the present application is shown.
[0037] Description of main component symbols:
[0038] 10-robot; 11-processor; 12-memory; 13-sensing unit; 14-execution unit;
[0039] 100 - side wall recognition device; 110 - data acquisition module; 120 - preprocessing module; 130 - image conversion module; 140 - rectangle extraction module; 150 - image segmentation module; 160 - wall detection module; 170 - position determination module; 180 - distance detection module. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0041] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0042] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0043] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0044] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0045] In robot navigation tasks, it is often necessary to move along a wall, but the two-dimensional laser radar installed on the front or upper side cannot detect whether there is a wall in the vertical direction. For this reason, the present application proposes a side wall recognition method, which expands the robot's field of view and prevents the robot from colliding with a wall or corridor when moving along the wall by setting a line laser radar on the side panel of the robot that can be used to perceive the environment of the side area of the robot; at the same time, an image-based morphological method is used to process the ranging data collected by the line laser radar, that is, the ranging information is visualized in the form of an image, and the vertical wall is detected according to the line laser beam morphology in the converted image, which can improve the accuracy of wall detection and enable the robot to walk safely along the wall without collision.
[0046] Figure 1 A schematic diagram of the structure of a robot according to an embodiment of the present application is shown. Exemplarily, the robot 10 includes a processor 11, a memory 12, a sensing unit 13, and an execution unit 14, wherein the memory 12 stores a computer program, and the processor 11 runs the computer program to enable the robot to execute the side wall recognition method according to the embodiment of the present application, and when a wall is recognized to exist on the side, the robot executes a corresponding wall-following action, thereby preventing the robot from colliding when moving along a wall or a corridor.
[0047] Among them, the processor 11 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0048] The memory 12 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0049] The sensing unit 13 is mainly used to transmit external environmental information to the robot's control system, so as to provide necessary conditions for the robot 10 in cleaning, navigation, map building or recharging scenarios. For example, the sensing unit 13 includes, but is not limited to, one or more of a line laser radar, an ultrasonic sensor, a camera device, etc. The line laser radar is set at the corresponding position of the robot 10, and is used for the robot 10 to obtain environmental information of the corresponding position area during the movement, such as measuring the distance information of obstacles based on methods such as time of flight (TOF) or triangulation.
[0050] Furthermore, line laser radar includes single-line laser radar and multi-line laser radar. Single-line laser radar uses a laser to emit a linear laser beam, and then uses a rotating lens or other mechanical device to irradiate the linear laser beam in different directions. It can be used in scenarios such as household cleaning robots and simple indoor navigation robots. Multi-line laser radar uses multiple laser sources or emits multiple linear laser beams at the same time, with higher resolution and high data rate. Therefore, it is more suitable for fields such as autonomous driving vehicles, drones, precision agricultural robots, etc.
[0051] In the present application, for example, in one embodiment, Figure 2 As shown, the line laser radar used to perceive the environment of the side area of the robot can be set on the side panel of the robot and the viewing angle can detect the ground area on the side of the robot.
[0052] Among them, the execution unit 14 is mainly related to the use scenario of the robot 10. For example, if the robot 10 is a navigation robot, the execution unit 14 may include a walking mechanism, etc. Further, the walking mechanism may include but is not limited to side wheels, track wheels, tracks, etc. Alternatively, if the robot 10 is a cleaning robot, the execution unit 14 may include a cleaning mechanism, etc. in addition to the walking mechanism. Specifically, the cleaning mechanism may include but is not limited to a spray washing component, a decontamination component, etc. It can be understood that the specific structure of the execution unit 14 can be determined according to actual needs and is not limited here.
[0053] Based on the robot with the above structure, the side wall recognition method is described below in conjunction with some specific embodiments.
[0054] Figure 3 A flow chart of a side wall recognition method according to an embodiment of the present application is shown. Exemplarily, the side wall recognition method includes the following steps:
[0055] S11, obtaining initial sensor data of the line laser radar in the side area of the detection robot.
[0056] The side area of the robot refers to the area in another direction perpendicular to the robot's moving direction. Figure 2 As shown in the figure, the line laser radar is set on the side panel of the robot. When the robot is in motion, it controls the line laser radar to emit a linear laser beam to the bottom area of the side ground and receives its reflected signal to detect whether there is a wall on the side. It is worth noting that during the installation of the line laser radar, the line laser radar can be controlled to continuously emit a laser beam to the ground and its installation position can be adjusted according to the ranging results to ensure that the ranging field of view of the line laser radar can cover its existing blind area.
[0057] The sensor data collected based on the line laser radar includes, but is not limited to, the distance value to the target, the rotation angle and vertical angle of the line laser beam, and may also include the reflection intensity of the line laser beam, a timestamp, etc., which can be used according to the actual usage scenario. In this embodiment, each frame of sensor data is processed as a unit to obtain corresponding image data.
[0058] S12, preprocessing the initial sensor data to obtain valid sensor data.
[0059] Exemplarily, the retained sensor data is obtained by filtering out a preset amount of header data and tail data in the initial sensor data respectively; then, the retained sensor data is smoothed, and the smoothed sensor data is used as the valid sensor data. For example, in one embodiment, smoothing can be achieved by using a method such as a median filter, and of course, in some other embodiments, a method such as an average value filter can also be used, which is not limited here.
[0060] It can be understood that since the data at both ends of the line laser radar is unstable and prone to jumps, in this embodiment, a certain amount of data at both ends will be filtered and processed separately, and the data in the middle will be retained, which can improve the accuracy of recognition. Secondly, since the line laser radar product itself will be affected by factors such as its own system, the surface of the object to be measured, and the scanning environment, the collected data will inevitably be mixed with some noise points (outliers). Smoothing can effectively reduce the impact of noise points, thereby improving the reliability and accuracy of the data.
[0061] As an optional solution, after obtaining valid sensor data, the method further includes:
[0062] When the number of distance values in the valid sensor data that are zero is detected to be greater than a preset number, it is determined that there is an obstacle on the side. It can be understood that by judging in advance whether the distance value in the valid sensor data is near 0 and the number is greater than the preset value, it indicates that the sensor is blocked or the line laser ranging is not working properly, so it can be regarded as an obstacle. It can be understood that the obstacles here include objects that block the detection field of the laser radar, for example, tables and chairs, sofas, walls, etc.
[0063] S13, converting the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology.
[0064] Generally, for the sensor data collected by the line laser radar, polar coordinates can be used to describe the distance value and the angle information at the corresponding moment, where the distance value is the polar diameter; and in order to facilitate subsequent processing, this embodiment converts the distance value and angle information from the polar coordinate system to the Cartesian coordinate system (also a rectangular coordinate system) through coordinate system conversion to obtain the corresponding rectangular coordinates; and then, it is mapped to the corresponding image pixels to obtain the image data corresponding to each frame of sensor data. Among them, the image data is used to reflect the shape of the line laser beam, which mainly includes a number of pixels, and the position of each pixel, pixel value and other information.
[0065] In one embodiment, the effective sensor data is converted into a two-dimensional plane image, such as Figure 4 As shown, specifically including:
[0066] S210, converting each group of distance values and angle information from the polar coordinate system to the Cartesian coordinate system to obtain two-dimensional coordinates in the Cartesian coordinate system.
[0067] like Figure 5 As shown, from the polar coordinate system to the Cartesian coordinate system, the two-dimensional plane coordinates (X, Y) corresponding to each group of distance values and angle information can be calculated according to the following formula:
[0068]
[0069] In the formula, R is the distance value, α and ω are the rotation angle and vertical angle of the line laser beam at the current moment, respectively, where the vertical angle ω of each line laser beam is a fixed value. It can be understood that this is only an example of two-dimensional coordinates. If necessary, it can also be calculated as follows: Figure 5 The projection principle shown is used to calculate the three-dimensional coordinates, which means that the effective sensor data is converted into a three-dimensional image.
[0070] S220, mapping all two-dimensional coordinates of the frame sensor data to corresponding image pixel positions according to a preset resolution, and determining pixel values of the pixels according to the distance values to obtain two-dimensional image data.
[0071] The unit of the preset resolution is meter per pixel. Exemplarily, after determining each coordinate information, the point described by each two-dimensional coordinate can be used as each pixel point according to the pixel resolution of the image to be displayed, and the pixel value of each pixel point can be determined according to the original distance value. Usually, if the distance value is not zero, the pixel value is not zero, that is, it is a non-zero pixel point. In order to facilitate the subsequent extraction of the morphological information of the line laser beam in the image, optionally, the non-zero pixel point and other pixel points are described by a binary image, for example, the non-zero pixel point is white, and the other pixel points are black or gray, or vice versa.
[0072] S14, obtaining information of a bounding rectangle surrounding all non-zero pixels in the image data.
[0073] In this embodiment, the morphology information of the line laser beam in the image data is used to determine whether a wall is sensed in the vertical direction. It can be understood that since the laser morphology information is directly related to the distance value, the morphology of the line laser beam without obstacles is different from that of the line laser beam with obstacles, based on which it can be determined whether there is an obstacle.
[0074] Exemplarily, in one embodiment, if Figure 6 As shown, step S14 includes:
[0075] S310, extracting the maximum contour of the line laser beam emitted by the line laser radar when it is projected onto the surface of the object according to the non-zero pixel points in the image data.
[0076] It can be understood that non-zero pixels refer to pixels whose pixel values are not 0. Exemplarily, all pixels whose pixel values are not 0 are extracted, and the pattern formed by these pixels is the pattern of the line laser beam emitted by the line laser radar projected onto the surface of the object and reflected back.
[0077] However, since the distance measured by the line laser radar exceeds the range (data represented by zero), the disconnected non-zero pixels in the image need to be connected to form a connected pattern. For example, if there are disconnected points in the generated two-dimensional image, such as Figure 7 As shown in (a), it is necessary to first connect the disconnected (i.e., not directly adjacent) non-zero pixel regions, as shown in Figure 7 Next, the maximum contour of the connected pattern is extracted.
[0078] S320, obtaining the width and height of the minimum circumscribed rectangle of the enclosing contour.
[0079] The minimum bounding rectangle refers to a rectangle with the smallest area surrounding the maximum contour, and the minimum bounding rectangle information includes the width and height of the minimum bounding rectangle. In one embodiment, the width of the minimum bounding rectangle can be selected as the above-mentioned bounding rectangle information. This is because, combined with the above Figure 2 It can be seen that the laser beam of the line laser radar is perpendicular to the side. If there is no wall on the side, the width of the laser beam will not change. If it changes, it is most likely because there is a wall on the side. Therefore, this embodiment selects width as the judgment basis.
[0080] Therefore, after the circumscribed rectangle information reflecting the shape of the linear laser beam is obtained through the above step S14, it is determined whether there is a wall based on the image shape.
[0081] S15, detecting whether the bounding rectangle information is greater than a preset value.
[0082] The preset value can be determined by testing the width of the minimum circumscribed rectangle corresponding to the line laser beam when there is no obstacle. Exemplarily, if the width exceeds the preset value, it indicates that there may be no obstacle in the rectangular frame. For further accurate confirmation, step S16 will be executed. Optionally, if the width does not exceed the preset value, the original distance value data is used to further confirm whether there is an obstacle.
[0083] S16, projecting the coordinates of all non-zero pixel points along the vertical direction to divide the image data into a ground detection image and a non-ground detection image.
[0084] Exemplarily, the image is projected along the Y axis (vertical) direction, that is, the number of non-zero pixels in each row of the image is counted, and then the coordinate value with the most non-zero pixels in the projected coordinates is obtained, and the image is divided into upper and lower images with the coordinate value as the boundary, wherein one image belongs to the ground detection image and the other image belongs to the non-ground detection image. For example, for Figure 8 After the image (a) is divided, the upper image (b) is the ground detection image, and the lower image (c) is the non-ground detection image; Fig. 9 The image shown in (a) is divided into the lower part of the image shown in (b) as the ground detection image, and the lower part of the image shown in (c) as the non-ground detection image.
[0085] It can be understood that the distance value detected on the ground is usually a horizontal line segment in the image, that is, there is no obvious change in the vertical direction. Therefore, by projecting these image pixels in the vertical direction, the distance value of the ground (generally a plane) area will be projected to the same point when projected in the vertical direction, that is, the coordinate value with the most non-zero pixels in the image. In this way, the distance values detected in the ground area and the non-ground area can be distinguished from the many sensor data collected. For the actual sensor data collected, since the distance values collected by the line laser radar are in order, each distance value will have a corresponding index when it is stored. The index of the distance value corresponding to the coordinate value is used as the boundary, and the distance values less than the index are classified as distance values of the ground area, and the rest are classified as distance values of the non-ground area.
[0086] S17, detecting whether there is a minimum target point in the ground detection image.
[0087] The minimum target point (i.e., min_point) refers to the value of the minimum horizontal (x-axis) coordinate among all non-zero pixels in the ground detection image. If there is a minimum target point, step S18 is executed. Alternatively, if there is no minimum target point, step S19 is executed.
[0088] S18, determining that there is a wall on the side.
[0089] S19, determining that there is no wall on the side.
[0090] It can be understood that the above steps can detect whether there is a wall from the perspective of the image. In order to facilitate the subsequent navigation and other tasks, the position of the wall can be further determined to perform an avoidance operation.
[0091] In an alternative approach, Fig.10 As shown, after determining that there is a wall on the side through the above step S17, the method further includes:
[0092] S20, detecting whether there is a maximum target point in the non-ground detection image.
[0093] The maximum target point (i.e., max_point) refers to the value of the maximum horizontal (x-axis) coordinate among all non-zero pixel points in the non-ground detection image. If the maximum target point exists, step S21 is executed. If the maximum target point does not exist, step S22 is executed.
[0094] S21, if there is a maximum target point, determine the position of the side wall according to the minimum value of the horizontal direction (x-axis) coordinate of all non-zero pixel points in the non-ground detection image.
[0095] S22: If there is no maximum target point, the coordinates of the minimum target point are used as the position of the side wall.
[0096] Exemplarily, when there is a maximum target point, the point corresponding to the smallest x-axis coordinate among all non-zero pixel points in the non-ground detection image is selected as the obstacle point, that is, the position of the wall, and then the wall position is marked in the robot coordinate system.
[0097] In another alternative, if Fig.10 As shown, after step S15, the method further includes:
[0098] S23, when the bounding rectangle information is less than or equal to a preset value, obtaining a non-zero minimum distance value and a corresponding index in the valid sensor data.
[0099] S24, detecting whether the minimum distance value is less than a preset distance and the index is less than a preset index value.
[0100] If both conditions are satisfied, step S18 is executed, i.e., it is determined that there is a wall on the side. Further, when it is determined that there is a wall on the side, step S25 is executed. On the contrary, if both conditions are not satisfied, step S19 is executed, i.e., it is determined that there is no wall on the side.
[0101] S25, taking the position corresponding to the minimum distance value as the position of the side wall.
[0102] It can be understood that if the width of the rectangle does not exceed the preset value, that is, the width of the rectangle becomes shorter (not within the normal range), it indicates that there is a high probability of a wall. At this time, the original distance value data can be used for further quick confirmation and further acquisition of the position of the wall.
[0103] As an optional solution, after obtaining the position of the wall, the method further includes:
[0104] S26, obtaining the wall coordinates in the line laser radar coordinate system or in the image data, and marking the wall position in the robot coordinate system. It can be understood that by marking the wall in the robot coordinate system, anti-collision planning can be facilitated during the operation path planning.
[0105] The embodiment of the present application uses a line laser radar and combines it with an image-based method to visualize the distance measurement technology for wall perception, which can effectively reduce the sensor noise that causes the distance measurement data to fail, jump, etc., and cause the false detection of obstacles using only distance-based methods, especially when going up and down slopes or on undulating ground, resulting in a large difference in the measured distance from that on flat ground, which can avoid false detection and improve the robot's perception of the environment. Compared with other sensors, line lasers have lower costs, which reduces the cost of robots, etc.
[0106] Fig.11 A schematic diagram of the structure of a side wall recognition device 100 according to an embodiment of the present application is shown. Exemplarily, the side wall recognition device 100 includes:
[0107] The data acquisition module 110 is used to acquire the initial sensor data of the line laser radar when detecting the side area of the robot.
[0108] The preprocessing module 120 is used to preprocess the initial sensor data to obtain valid sensor data; wherein the valid sensor data includes the distance value measured by the line laser radar and the angle information at the corresponding time.
[0109] The image conversion module 130 is used to convert the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology.
[0110] The rectangle extraction module 140 is used to obtain information of a circumscribed rectangle surrounding all non-zero pixel points in the image data, wherein the pixel values of the non-zero pixel points are not zero.
[0111] The image segmentation module 150 is used to project the coordinates of non-zero pixels in the vertical direction when the circumscribed rectangle information is greater than a preset value, so as to divide the image data into a ground detection image and a non-ground detection image according to the projected coordinates.
[0112] The wall detection module 160 is used to determine the presence of a wall on the side when a minimum target point is detected in the non-ground detection image, wherein the minimum target point is the value with the smallest horizontal coordinate among the non-zero pixel points.
[0113] In an optional embodiment, the side wall recognition device 100 further includes:
[0114] The wall detection module 160 is further configured to determine that there is no wall on the side when it is detected that the minimum target point does not exist in the ground detection image.
[0115] In an optional embodiment, the side wall recognition device 100 further includes:
[0116] After obtaining the valid sensor data, the wall detection module 160 is further configured to determine that there is an obstacle on the side when it is detected that the number of zero distance values in the valid sensor data is greater than a preset number.
[0117] In an optional embodiment, the side wall recognition device 100 further includes:
[0118] The position determination module 170 (not shown in the figure) is also used to determine the position of the side wall according to the minimum horizontal coordinate value of all non-zero pixel points in the non-ground detection image when the maximum target point is detected in the non-ground detection image; wherein the maximum target point is the maximum horizontal coordinate value of the non-zero pixel points; or, when it is detected that the maximum target point does not exist in the non-ground detection image, the coordinates of the minimum target point are used as the position of the side wall.
[0119] In an optional embodiment, the side wall recognition device 100 further includes:
[0120] The distance detection module 180 (not shown in the figure) is used to obtain the non-zero minimum distance value and the corresponding index in the valid sensor data when the circumscribed rectangle information is less than or equal to the preset value; when the minimum distance value is less than the preset distance and the index is less than the preset index value, it is determined that there is a wall on the side, otherwise it is determined that there is no wall on the side.
[0121] In the above embodiment, further, the side wall recognition device 100 also includes:
[0122] The position determination module 170 is configured to, when determining that there is a wall on the side, use the position corresponding to the minimum distance value as the position of the side wall.
[0123] In some feasible embodiments, the image conversion module 130 includes a coordinate conversion unit and a coordinate mapping unit; specifically, the coordinate conversion unit is used to convert each group of the distance value and the angle information in each frame of sensor data from a polar coordinate system to a Cartesian coordinate system to obtain a two-dimensional coordinate in the Cartesian coordinate system; the coordinate mapping unit is used to map all the two-dimensional coordinates of the frame sensor data to corresponding image pixel positions according to a preset resolution, and determine the pixel value of the pixel according to the distance value to obtain two-dimensional image data.
[0124] In some feasible implementations, the effective sensor data includes a distance value measured by the line lidar, and a pixel value of each pixel point in the image data is determined based on the distance value, wherein the distance value is not zero and the pixel value is not zero.
[0125] Optionally, the rectangle extraction module 140 includes a contour extraction unit and an information acquisition unit, wherein the contour extraction unit is used to extract the maximum contour when the line laser beam emitted by the line laser radar is projected onto the surface of the object based on all non-zero pixel points in the image data; the information acquisition unit is used to obtain the width and height of the minimum circumscribed rectangle surrounding the contour.
[0126] In one implementation, the bounding rectangle information is the width of the minimum bounding rectangle.
[0127] In some optional embodiments, the rectangle extraction module 140 further includes:
[0128] Before the contour extraction unit extracts the maximum contour when the line laser beam emitted by the line laser radar is projected onto the surface of the object, the connection processing unit connects non-adjacent non-zero pixel areas in the image data.
[0129] It can be understood that the device of this embodiment corresponds to the side wall recognition method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0130] The present application also provides a computer-readable storage medium for storing the computer program used in the robot. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0133] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0134] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A side wall recognition method, characterized in that: include: Obtain initial sensor data of the line laser radar in the area to the side of the detection robot; Preprocessing the initial sensor data to obtain valid sensor data; Converting the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology; Obtaining information of a bounding rectangle surrounding all non-zero pixel points in the image data; wherein the pixel values of the non-zero pixel points are not zero; When the circumscribed rectangle information is greater than a preset value, the coordinates of the non-zero pixel points are projected in a vertical direction, so as to divide the image data into a ground detection image and a non-ground detection image according to the projected coordinates; When it is detected that there is a minimum target point in the ground detection image, it is determined that there is a wall on the side, wherein the minimum target point is the value with the smallest horizontal coordinate among the non-zero pixel points.
2. The side wall recognition method according to claim 1, characterized in that: The step of determining that there is a wall on the side further includes: When the maximum target point is detected in the non-ground detection image, the position of the side wall is determined according to the minimum value of the horizontal coordinate among all non-zero pixel points in the non-ground detection image; wherein the maximum target point is the maximum value of the horizontal coordinate among the non-zero pixel points; When it is detected that the maximum target point does not exist in the non-ground detection image, the coordinates of the minimum target point are used as the position of the side wall.
3. The side wall recognition method according to claim 1, characterized in that: Also includes: When it is detected that the minimum target point does not exist in the ground detection image, it is determined that there is no wall on the side.
4. The side wall recognition method according to claim 1, characterized in that: Also includes: When the bounding rectangle information is less than or equal to the preset value, obtaining a non-zero minimum distance value and a corresponding index in the valid sensor data; When the minimum distance value is less than the preset distance and the index is less than the preset index value, it is determined that there is a wall on the side; otherwise, it is determined that there is no wall on the side.
5. The side wall recognition method according to claim 4, characterized in that: Also includes: When it is determined that there is a wall on the side, the position corresponding to the minimum distance value is used as the position of the side wall.
6. The side wall recognition method according to claim 1, characterized in that: The valid sensor data includes a distance value measured by the line laser radar; After obtaining the valid sensor data, the method further includes: When it is detected that the number of zero distance values in the valid sensor data is greater than a preset number, it is determined that there is an obstacle on the side.
7. The side wall recognition method according to claim 1, characterized in that: The effective sensor data includes the distance value measured by the line laser radar and the angle information at the corresponding moment; The converting the valid sensor data into image data according to a preset resolution includes: Convert each set of the distance value and the angle information in each frame of sensor data from a polar coordinate system to a Cartesian coordinate system to obtain a two-dimensional coordinate in the Cartesian coordinate system; All the two-dimensional coordinates of the frame sensor data are mapped to corresponding image pixel positions according to a preset resolution, and pixel values of the pixels are determined according to the distance values to obtain two-dimensional image data.
8. The side wall recognition method according to claim 1, characterized in that: The valid sensor data includes a distance value measured by the line laser radar, and a pixel value of each pixel point in the image data is determined according to the distance value, wherein the distance value is not zero and the pixel value is not zero; The obtaining of bounding rectangle information surrounding all non-zero pixels in the image data includes: Extracting, based on all non-zero pixel points in the image data, a maximum contour of the line laser beam emitted by the line laser radar when projected onto the surface of the object; Get the width and height of the minimum bounding rectangle surrounding the outline; The bounding rectangle information is the width of the minimum bounding rectangle.
9. The side wall recognition method according to claim 8, characterized in that: The step of extracting the maximum contour of the line laser beam emitted by the line laser radar when projected onto the surface of the object further includes: The non-adjacent non-zero pixel regions in the image data are connected.
10. A side wall recognition device, characterized in that: include: A data acquisition module, used to acquire initial sensor data of the line laser radar in the detection area on the side of the robot; A preprocessing module, used for preprocessing the initial sensor data to obtain valid sensor data; An image conversion module, used to convert the effective sensor data into image data according to a preset resolution, wherein the image data includes pixel point information for reflecting the laser morphology; A rectangle extraction module, used to obtain information of a circumscribed rectangle surrounding all non-zero pixel points in the image data; wherein the pixel values of the non-zero pixel points are not zero; An image segmentation module, used for projecting the coordinates of the non-zero pixel points in a vertical direction when the circumscribed rectangle information is greater than a preset value, so as to divide the image data into a ground detection image and a non-ground detection image according to the projected coordinates; The wall detection module is used to determine the presence of a wall on the side when a minimum target point is detected in the non-ground detection image, wherein the minimum target point is the value with the smallest horizontal coordinate among the non-zero pixel points.
11. A robot, characterized in that: The robot includes a line laser radar, a processor and a memory; The line laser radar is arranged on the side panel of the robot to collect the side area environment information of the robot; The memory stores a computer program; The processor is used to execute the computer program to implement the side wall recognition method according to any one of claims 1 to 9, and when a wall is recognized to exist on the side, perform corresponding actions along the wall.
12. A readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed, the side wall recognition method according to any one of claims 1-9 is implemented.
Citation Information
Cited By
Control method and equipment of wall surface recognition system and storage medium
CN120472433A
