An intelligent ranging algorithm
Through the intelligent ranging algorithm, the multi-frame image is processed and compared and analyzed, which solves the problem of insufficient information in a single-frame image, and more accurate determination of obstacle position and shape, which improves the accuracy of ranging and the robustness of the system.
Patent Information
- Application Number
- CN202411578474.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Common robot ranging methods are based on a single sensor, which is difficult to adapt to complex and changeable practical application scenarios. Due to the limited single-frame image information obtained, it is difficult to accurately determine the position and shape of obstacles.
An intelligent ranging algorithm is proposed to compare and analyze multiple frame images continuously captured by a robot, divide and process images, extract images of changing areas and distances between computer robots and obstacle areas.
Through the comparison and analysis of multi-frame images, the location and shape of obstacles can be determined more accurately, the accuracy of ranging can be improved, the robustness of the system can be enhanced, ranging calculations can be simplified, and real-time obstacle avoidance decisions and path planning can be realized.
Smart Images

Figure CN119594932B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ranging, and specifically relates to an intelligent ranging algorithm. Background Art
[0002] In robot navigation, by simulating the stereoscopic vision function of the human eye through a camera, the distance estimation of objects in the scene is realized for obstacle avoidance and path planning. For the autonomous navigation and obstacle avoidance scenarios of robots in various environments, for example, in industrial production, robots need to move and operate in a complex workshop environment, accurately measure the distance from obstacles to avoid collisions, and ensure the safe and efficient progress of production; in the field of service robots, such as domestic cleaning robots, logistics distribution robots, etc., accurate ranging is also required to achieve autonomous navigation and obstacle avoidance to better complete tasks. In addition, in the fields of autonomous driving, drones, etc., it also has broad application prospects and can provide important technical support for the safe operation of these devices.
[0003] However, although the ranging method based on stereoscopic vision has broad application prospects in the fields of robot navigation and obstacle avoidance, common robot ranging methods, generally ranging methods based on a single sensor, often have limitations and are difficult to adapt to complex and changeable actual application scenarios. At the same time, due to the limited information of a single-frame image obtained, it is difficult to accurately determine the position and shape of obstacles; based on this, an intelligent ranging algorithm is proposed; Summary of the Invention
[0004] The purpose of the present invention is to provide an information interaction method for on-site power operation, which solves the technical problems that common robot ranging methods, ranging methods based on a single sensor, have limitations and it is difficult to accurately determine the position and shape of obstacles due to the limited information of a single-frame image obtained.
[0005] An intelligent ranging algorithm, and the specific implementation steps include the following steps:
[0006] Step 1: Obtain multiple frames of images continuously captured by the robot;
[0007] Step 2: Perform partitioning processing on the multiple frames of images captured continuously, and then obtain the images to be analyzed corresponding to each frame of image;
[0008] Step 3: Extract and splice the identification blocks corresponding to the transformation labels in the images to be analyzed corresponding to each frame of image to generate the change region images corresponding to each frame of image;
[0009] Step 4: Extract the identification blocks with the same transformation labels that exist in the change region images corresponding to each frame of image to obtain the analysis images;
[0010] Step 5: Calculate the distance between the robot and the obstacle area.
[0011] As a further solution of the present invention: The specific way to obtain the images to be analyzed corresponding to each frame of images is as follows:
[0012] First, divide each frame of images into multiple recognition blocks, and at the same time number each recognition block in each frame of images in the order from left to right and from top to bottom, so as to obtain the block label i corresponding to each recognition block in each frame of images. Subsequently, obtain the pixel values corresponding to each recognition block in each frame of images, and compare and analyze the pixel values corresponding to each recognition block in each frame of images with a preset threshold Y1, so as to obtain the images to be analyzed corresponding to each frame of images, where i represents the block label corresponding to each recognition block, i = 1, 2,..., e; e represents the number of recognition blocks corresponding to each frame of images, e is a positive integer, and e > 1.
[0013] As a further solution of the present invention: The specific way to compare and analyze the pixel values corresponding to each recognition block in each frame of images with a preset threshold Y1 is as follows:
[0014] For the block label i corresponding to the recognition block in each frame of images with a pixel value greater than the threshold Y1, mark the block label corresponding to the recognition block as the transformed label i'. For the block label i corresponding to the recognition block in each frame of images with a pixel value less than or equal to the threshold Y1, no change is made.
[0015] As a further solution of the present invention: The specific way to generate the change region images corresponding to each frame of images is as follows:
[0016] Obtain the images to be analyzed corresponding to each frame of images, extract the recognition blocks with transformed labels corresponding to each of the images to be analyzed from each of the images to be analyzed, and sort the recognition blocks with transformed labels in each of the images to be analyzed in ascending order according to the numerical value of the block label i corresponding to the transformed label i' of the recognition blocks with transformed labels in each of the images to be analyzed, so as to obtain the change region images corresponding to each frame of images.
[0017] As a further solution of the present invention: The specific way to obtain the analysis image is as follows:
[0018] Extract the recognition blocks with the same transformed label existing in the change region images corresponding to each frame of images to obtain the obstacle block labels, establish a reference image frame, and perform gray filling on the corresponding recognition blocks in the reference image frame according to the obstacle block labels, so as to obtain the analysis image.
[0019] As a further solution of the present invention: The specific way to establish a reference image frame is as follows:
[0020] According to the sizes of multiple frames of images continuously captured by the robot, a blank frame is established, and the blank frame is evenly divided into multiple recognition blocks. At the same time, each recognition block in the blank frame is numbered in the order from left to right and from top to bottom, so as to obtain the block numbers corresponding to each recognition block in the blank frame, and then obtain the reference image frame.
[0021] As a further solution of the present invention: The specific method for obtaining the distance between the robot and the obstacle area is:
[0022] Obtain the central position coordinates of the gray area corresponding in the analysis image and the central point coordinates of the analysis image. Calculate the straight-line distance between the robot and the center of the gray area according to the central position coordinates of the gray area and the central point coordinates of the image, and use it as the distance D between the robot and the obstacle area.
[0023] As a further solution of the present invention: The specific method for calculating the straight-line distance between the robot and the center of the gray area is:
[0024] Mark the central position coordinates of the gray area corresponding in the analysis image and the central point coordinates of the analysis image as: (XAc, YAc, ZAc) and (XBc, YBc, ZBc);
[0025] Through the formula: Calculate the straight-line distance between the robot and the center of the gray area, and use it as the distance D between the robot and the obstacle area.
[0026] As a further solution of the present invention: Compare and analyze the distance D between the robot and the obstacle area with the threshold distance Y2. When the distance D between the robot and the obstacle area is greater than the threshold distance Y2, a warning signal is generated; otherwise, no processing is performed.
[0027] Compared with the prior art, the beneficial effects of the present invention are:
[0028] In the present invention, through the comparative analysis of multiple frames of images, the position and shape of the obstacle can be determined more accurately, thereby improving the accuracy of distance measurement. Through background separation and extraction of the changing area, the interference of background noise can be effectively excluded, enhancing the robustness of the system. By directly calculating the straight-line distance between the camera and the center of the gray area, the complexity of distance measurement calculation is simplified, and the robot can real-time perceive the changes in the surrounding environment and the presence of obstacles, so as to make corresponding obstacle avoidance decisions and path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is the flow schematic diagram of the present invention;
[0030] Figure 2 is the schematic diagram of the reference image frame of the present invention;
[0031] Figure 3 This is a schematic diagram of the image to be analyzed in the present invention. Detailed implementation manners
[0032] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0033] Embodiment 1
[0034] Please refer to Figure 1 - Figure 3 , this application provides, and the specific implementation steps include the following steps:
[0035] Step 1: Obtain multiple frames of images continuously captured by the robot; this provides a data basis for subsequent analysis and processing and is the starting step of the entire ranging algorithm. Only by obtaining multiple frames of images can the comparison and analysis between images be carried out to determine information such as the changing area and obstacle area in the images.
[0036] Step 2: Perform partitioning processing on the multiple frames of continuously captured images respectively, and then obtain the images to be analyzed corresponding to each frame of image. The specific optimization processing method is as follows:
[0037] First, divide each frame of image into multiple recognition blocks, and at the same time label each recognition block in each frame of image in the order from left to right and from top to bottom, and then obtain the block label i corresponding to each recognition block in each frame of image. i refers to the block label corresponding to each recognition block, i = 1, 2,..., e; e refers to the number of recognition blocks corresponding in each frame of image, e is a positive integer, and e > 1;
[0038] It should be noted that here, dividing each frame of image into multiple recognition blocks is a uniform division, that is, the size of each recognition block is the same, and it is defaulted here that the image sizes of the multiple frames of images continuously captured by the robot are equal;
[0039] Subsequently, obtain the pixel values corresponding to each recognition block in each frame of image, compare and analyze the pixel values corresponding to each recognition block in each frame of image with a preset threshold Y1, and then obtain the images to be analyzed corresponding to each frame of image. The specific method is as follows:
[0040] For the block label i corresponding to the recognition block in each frame image where the pixel value is greater than the threshold Y1, the block label corresponding to the recognition block is marked as the transformed label i' for representation. For the block label i corresponding to the recognition block in each frame image where the pixel value is less than or equal to the threshold Y1, no change is made. Then, the images to be analyzed corresponding to each frame image are obtained, realizing the background separation operation for each frame image;
[0041] Obtain multiple frame images continuously captured by the robot, providing a data basis for subsequent analysis and processing. Only by obtaining multiple frame images can image comparison and analysis be carried out to determine information such as the changing area and obstacle area in the images. This is the starting step of the entire ranging algorithm, providing the necessary materials for subsequent steps.
[0042] Among them, the specific value of the threshold Y1 is determined by relevant personnel according to actual needs;
[0043] Taking an example for illustration, assume that a frame image is evenly divided into 6 recognition blocks, and the 6 recognition blocks are labeled in the order from left to right and from top to bottom. Then, the block labels of the 6 recognition blocks are 1, 2, 3, 4, 5, and 6 respectively, and the pixel values in the 6 recognition blocks are 50, 100, 70, 80, 90, and 60 respectively. The value of the threshold Y1 is 75. Since the pixel values of the block labels 2, 4, and 5 are greater than the threshold Y1, the block labels of the recognition blocks with block labels 2, 4, and 5 in this frame image are changed to the transformed labels 2', 4', and 5, and the rest remain unchanged. Then, the image to be analyzed corresponding to this frame image is obtained;
[0044] The image is evenly divided into multiple recognition blocks and labeled, enabling more refined regional analysis of the image. By comparing with the preset threshold Y1, the recognition blocks with pixel values greater than the threshold are subjected to label transformation, realizing the background separation operation. This step is one of the key steps, which can highlight the parts in the image that may have obstacles or other areas and distinguish them from the background, preparing for the subsequent extraction of the changing area image.
[0045] Step three: Extract and splice the recognition blocks corresponding to the transformed labels in the images to be analyzed corresponding to each frame image respectively, and then generate the changing area images corresponding to each frame image. The specific method is as follows:
[0046] Obtain the images to be analyzed corresponding to each frame image, extract the recognition blocks with transformed labels in each image to be analyzed respectively from each image to be analyzed, and sort the recognition blocks with transformed labels in each image to be analyzed in ascending order according to the numerical value of the block label i corresponding to the transformed label i' of the recognition blocks with transformed labels in each image to be analyzed. Then, the changing area images corresponding to each frame image are obtained;
[0047] Illustrated by way of example, assume that a frame of image is evenly divided into 6 recognition blocks. Since the pixel values of the blocks numbered 2, 4, and 5 are greater than the threshold Y1, the block numbers of the recognition blocks numbered 2, 4, and 5 in this frame of image are changed to transformed numbers 2′, 4′, and 5, and the others remain unchanged. The recognition blocks with transformed numbers in this frame of image are extracted, and according to the block numbers 2, 4, and 5 in the transformed numbers 2′, 4′, and 5 corresponding to the recognition blocks with transformed numbers, the recognition blocks with transformed numbers are sequentially spliced, and then the changed region image corresponding to this frame of image is obtained;
[0048] Extracting the recognition blocks with transformed numbers from the image to be analyzed and sorting and splicing them in ascending order of the values of the transformed numbers to generate a changed region image can clearly determine the position and shape of the changed regions in the image. These changed regions are often related to obstacles or other dynamic objects, and these regions are the objects that need to be focused on and analyzed. By splicing these region images, the overall situation of the changed regions in the image can be more intuitively understood.
[0049] Step 4: Extract the recognition blocks with the same transformed numbers that exist in the changed region images corresponding to each frame of image, and mark them as fixed blocks. Extract the block numbers corresponding to each fixed block to obtain obstacle block numbers. According to the sizes of multiple frames of images continuously captured by the robot, create a blank frame. Divide the blank frame in the same way as the continuous frames of images are divided and numbered, and then obtain a reference image frame. Fill the reference image frame with gray according to the obstacle block numbers, and then obtain an analysis image. The specific method is as follows:
[0050] According to the sizes of multiple frames of images continuously captured by the robot, create a blank frame. Evenly divide the blank frame into multiple recognition blocks, and at the same time number each recognition block in the blank frame in the order from left to right and from top to bottom, and then obtain the block numbers i corresponding to each recognition block in the blank frame, and then obtain a reference image frame. Extract and mark as fixed blocks the recognition blocks with the same transformed numbers that exist in the changed region images corresponding to each frame of image. Use the block numbers corresponding to each fixed block as obstacle block numbers, and fill the corresponding recognition blocks in the reference image frame with gray according to the obstacle block numbers, and then obtain an analysis image;
[0051] Extract the recognition blocks with the same transformation label that exist in the changed regions of each frame of the image as fixed blocks, and determine the true obstacle regions. These obstacle blocks are the places that the robot needs to avoid during movement. By filling the grayscale of the corresponding obstacle block labels in the reference image frame, an analysis image is generated, which provides an important reference basis for subsequent ranging. After marking the obstacle regions in the reference image frame, the obstacle information can be more intuitively displayed within a unified framework, facilitating subsequent ranging calculations and path planning operations to ensure that the robot can safely and accurately avoid obstacles for ranging and movement.
[0052] Embodiment 2
[0053] As Embodiment 2 of the present invention, in the specific implementation of this application, compared with Embodiment 1, the technical solution of this embodiment is only different from that of Embodiment 1 in that this embodiment further includes Step Five;
[0054] Step Five: Obtain the central position coordinates of the grayscale region corresponding to the analysis image and the central point coordinates of the analysis image, and calculate the distance between the robot and the obstacle region based on the central position coordinates of the grayscale region and the central point coordinates of the analysis image. The specific method is as follows:
[0055] The obtained central coordinates of the grayscale region and the central point coordinates corresponding to the analysis image are the optical center coordinates of the analysis image. Combining the internal and external parameters of the robot camera, both of them are converted into three-dimensional points (XAc, YAc, ZAc) and (XBc, YBc, ZBc) in the camera coordinate system;
[0056] Through the formula: Calculate the straight-line distance between the robot and the center of the grayscale region, and use it as the distance D between the robot and the obstacle region:
[0057] Since the camera is usually installed on the robot, and we know the position and orientation of the camera relative to the robot, we can consider that the position of the robot is close to the position of the camera. Therefore, for the sake of simplifying the calculation, directly calculate the straight-line distance between the camera and the center of the grayscale region, and use it as the distance between the robot and the obstacle region.
[0058] By extracting the recognition blocks with transformation labels from the image to be analyzed and sorting and splicing them in ascending order of the values of the transformation labels, the position and shape of the changed area in the image can be clearly determined. These changed areas are often related to obstacles or other dynamic objects, and these areas are the objects that need to be focused on and analyzed. Extract the recognition blocks with the same transformation labels that exist in the changed areas of each frame of the image as fixed blocks, and the real obstacle areas are determined. These obstacle blocks are the places that the robot needs to avoid during movement. By filling the gray scale of the corresponding obstacle block labels in the reference image frame, an analysis image is generated, which provides an important reference basis for subsequent ranging. After marking the obstacle area in the reference image frame, the obstacle information can be more intuitively displayed in a unified framework, which is convenient for subsequent ranging calculations and path planning operations, etc., to ensure that the robot can safely and accurately avoid obstacles for ranging and movement. By directly calculating the straight-line distance between the camera and the center of the gray area and taking it as the distance between the robot and the obstacle area. Since the camera is usually installed on the robot and we know the position and orientation of the camera relative to the robot, we can consider that the position of the robot is close to the position of the camera. Therefore, for the sake of simplicity in calculation, by directly calculating the straight-line distance between the camera and the center of the gray area and taking it as the distance between the robot and the obstacle area.
[0059] Through the comparative analysis of multiple frames of images, the position and shape of the obstacle can be determined more accurately, thus improving the accuracy of ranging. Through background separation and changed area extraction, the interference of background noise can be effectively excluded, enhancing the robustness of the system. By directly calculating the straight-line distance between the camera and the center of the gray area, the complexity of the ranging calculation is simplified. The robot can perceive the changes in the surrounding environment and the presence of obstacles in real time, and thus make corresponding obstacle avoidance decisions and path planning.
[0060] Embodiment III
[0061] As Embodiment III of the present invention, when this application is specifically implemented, compared with Embodiment I and Embodiment II, the technical solution of this embodiment is only different from that of Embodiment I and Embodiment II in that in this embodiment, a comparative analysis is carried out between the distance D between the robot and the obstacle area and the threshold distance Y2. When the distance D between the robot and the obstacle area is greater than the threshold distance Y2, it means that the distance D between the robot and the obstacle area exceeds the safety distance, and then a warning signal is generated. When the distance D between the robot and the obstacle area is less than or equal to the threshold distance Y2, no processing is performed;
[0062] The specific value of the threshold distance Y2 is determined by relevant personnel according to actual needs.
[0063] Embodiment IV
[0064] As the fourth embodiment of the present invention, the technical solution of this embodiment lies in combining and implementing the solutions of the above-mentioned first embodiment, second embodiment and third embodiment.
[0065] All the above formulas are dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. The preset parameters and threshold selection in the formulas are set by those skilled in the art according to the actual situation.
[0066] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. An intelligent ranging algorithm, characterized in that: The specific implementation steps include the following steps: Step 1: Obtain multiple frames of images taken continuously by the robot; Step 2: Divide and process the multiple frames of images taken continuously, and then obtain the images to be analyzed corresponding to each frame of the image; Step 3: extract and splice the identification blocks corresponding to the change labels in the image to be analyzed corresponding to each frame image, and generate the change area images corresponding to each frame image; Step 4: extracting the identification blocks with the same transformation number existing in the change region images corresponding to each frame image to obtain an analysis image; Step 5: Calculate the distance between the robot and the obstacle area; The specific method of generating the change region image corresponding to each frame image is as follows: Obtaining the images to be analyzed corresponding to each frame image, extracting the identification blocks with the change labels corresponding to each image to be analyzed from each image to be analyzed, and sorting the identification blocks with the change labels in each image to be analyzed in ascending order according to the value corresponding to the block label i in the change label i′ corresponding to the identification blocks with the change labels in each image to be analyzed, thereby obtaining the change region images corresponding to each frame image; The specific method of obtaining the analysis image is: The identification blocks with the same transformation labels that exist in the change area images corresponding to each frame image are extracted to obtain the obstacle block labels, a reference image frame is established, and the corresponding identification blocks in the reference image frame are filled with grayscale according to the obstacle block labels to obtain the analysis image.
2. The intelligent distance measurement algorithm according to claim 1, characterized in that: The specific method of obtaining the image to be analyzed corresponding to each frame image is as follows: First, each frame image is divided into multiple recognition blocks, and each recognition block in each frame image is labeled in order from left to right and from top to bottom, so as to obtain the block label i corresponding to each recognition block of each frame image. Subsequently, the pixel value corresponding to each recognition block in each frame image is obtained, and the pixel value corresponding to each recognition block in each frame image is compared and analyzed with the preset threshold value Y1, so as to obtain the image to be analyzed corresponding to each frame image, wherein i refers to the block label corresponding to each recognition block, i=1, 2,..., e; e refers to the number of recognition blocks in each frame image, e is a positive integer, e>1.
3. The intelligent distance measurement algorithm according to claim 2, characterized in that: The specific method of comparing and analyzing the pixel values corresponding to each identification block in each frame image with the preset threshold value Y1 is as follows: The block label i corresponding to the identification block with a pixel value greater than the threshold value Y1 in each frame image is marked as the transformation label i′ for representation, and no change is made to the block label i corresponding to the identification block with a pixel value less than or equal to the threshold value Y1 in each frame image.
4. The intelligent distance measurement algorithm according to claim 1, characterized in that: The specific method of establishing a reference image frame is: According to the size of multiple frames of images taken continuously by the robot, a blank frame is established, and the blank frame is evenly divided into multiple recognition blocks. At the same time, each recognition block in the blank frame is numbered from left to right and from top to bottom, so as to obtain the block number corresponding to each recognition block in the blank frame, and then obtain the reference image frame.
5. The intelligent distance measurement algorithm according to claim 1, characterized in that: The specific method to obtain the distance between the robot and the obstacle area is: Obtain the center position coordinates of the grayscale area corresponding to the analysis image, as well as the center point coordinates of the analysis image. Calculate the straight-line distance between the robot and the center of the grayscale area based on the center position coordinates of the grayscale area and the center point coordinates of the image, and use it as the distance D between the robot and the obstacle area.
6. The intelligent distance measurement algorithm according to claim 5, characterized in that: The specific method for calculating the straight-line distance between the robot and the center of the gray area is: The center position coordinates of the grayscale area corresponding to the analysis image and the center point coordinates of the analysis image are marked as: (XAc, YAc, ZAc) and (XBc, YBc, ZBc); By formula: Calculate the straight-line distance between the robot and the center of the gray area and use it as the distance D between the robot and the obstacle area.
7. The intelligent distance measurement algorithm according to claim 6, characterized in that: The distance D between the robot and the obstacle area is compared with the threshold distance Y2. When the distance D between the robot and the obstacle area is greater than the threshold distance Y2, a warning signal is generated. Otherwise, no processing is performed.
Citation Information
Patent Citations
Aerial survey platform carried on unmanned aerial vehicle
CN118089672A