Intelligent distance measurement algorithm
Through the intelligent ranging algorithm, the multi-frame image is processed and analyzed, which solves the problem of insufficient information in a single-frame image, and more accurate identification of obstacle positions and shapes, improving the accuracy of ranging and the robustness of the system.
Patent Information
- Application Number
- CN202411578474.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-11
- 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 CN119594932A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of distance measurement, and in particular relates to an intelligent distance measurement algorithm. Background Art
[0002] In robot navigation, the stereoscopic vision function of the human eye is simulated by the camera to estimate the distance of objects in the scene, which is used for obstacle avoidance and path planning. The robot can navigate and avoid obstacles in various environments. For example, in industrial production, the robot needs to move in a complex workshop environment and accurately measure the distance to obstacles to avoid collisions, so as to ensure safe and efficient production. In the field of service robots, such as household cleaning robots and logistics delivery robots, accurate distance measurement is also required to achieve autonomous navigation and obstacle avoidance to better complete the task. In addition, it also has broad application prospects in the fields of autonomous driving and drones, and can provide important technical support for the safe operation of these devices.
[0003] However, although the ranging method based on stereo vision has broad application prospects in the field of robot navigation and obstacle avoidance, the common robot ranging method, generally based on a single sensor, often has limitations and is difficult to adapt to complex and changeable practical application scenarios. At the same time, due to the limited information of the acquired single-frame image, it is difficult to accurately determine the position and shape of the obstacle. 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 power field operations, which solves the technical problem that the common robot ranging method based on a single sensor has limitations and is difficult to accurately determine the position and shape of obstacles due to the limited information of the acquired single-frame image.
[0005] An intelligent ranging algorithm, the specific implementation steps include the following steps:
[0006] Step 1: Obtain multiple frames of images taken continuously by the robot;
[0007] 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;
[0008] 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;
[0009] 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;
[0010] Step 5: Calculate the distance between the robot and the obstacle area.
[0011] As a further solution of the present invention: the specific method of obtaining the image to be analyzed corresponding to each frame image is:
[0012] 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.
[0013] As a further solution of the present invention, 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:
[0014] 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.
[0015] As a further solution of the present invention, the specific method of generating the change region images corresponding to each frame image is as follows:
[0016] The images to be analyzed corresponding to each frame image are obtained, and the identification blocks with transformation labels corresponding to each image to be analyzed are extracted from each image to be analyzed. According to the value corresponding to the block label i in the transformation label i′ corresponding to the identification block with transformation label in each image to be analyzed, the identification blocks with transformation labels in each image to be analyzed are sorted in ascending order, so as to obtain the change area images corresponding to each frame image.
[0017] As a further solution of the present invention: the specific method of obtaining the analysis image is:
[0018] 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.
[0019] As a further solution of the present invention, a specific method of establishing a reference image frame is as follows:
[0020] 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.
[0021] As a further solution of the present invention: the specific method of obtaining the distance between the robot and the obstacle area is:
[0022] 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.
[0023] As a further solution of the present invention: the specific method of calculating the straight-line distance between the robot and the center of the gray area is:
[0024] 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);
[0025] 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.
[0026] As a further solution of the present invention: a comparison and analysis is performed 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, a warning signal is generated, otherwise, no processing is performed.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The present invention can more accurately determine the position and shape of obstacles through comparative analysis of multiple frames of images, thereby improving the accuracy of distance measurement; can effectively eliminate the interference of background noise through background separation and change area extraction, thereby enhancing the robustness of the system; and simplifies the complexity of distance measurement calculation by directly calculating the straight-line distance between the camera and the center of the grayscale area. The robot can perceive the changes in the surrounding environment and the existence of obstacles in real time, thereby making corresponding obstacle avoidance decisions and path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the process of the present invention;
[0030] Figure 2 is a schematic diagram of a reference image frame of the present invention;
[0031] Figure 3 Schematic diagram of an image to be analyzed according to the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] Embodiment 1
[0034] See also Figure 1 - Figure 3 , this application provides, the specific implementation steps include the following steps:
[0035] Step 1: Obtain multiple frames of images taken continuously 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 images be compared and analyzed to determine information such as the changed areas and obstacle areas in the image.
[0036] 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. The specific optimization processing method is:
[0037] First, each frame image is divided into a plurality of recognition blocks, and each recognition block in each frame image is numbered in the order from left to right and from top to bottom, so as to obtain the block number i corresponding to each recognition block in each frame image, where i refers to the block number 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;
[0038] It should be noted that, here, dividing each frame image into multiple recognition blocks is uniform division, that is, the size of each recognition block is the same, and here it is assumed that the image sizes of multiple frames of images continuously taken by the robot are equal;
[0039] Then, the pixel values corresponding to each recognition block in each frame image are obtained, and the pixel values corresponding to each recognition block in each frame image are compared and analyzed with the preset threshold value Y1, so as to obtain the image to be analyzed corresponding to each frame image. The specific method is as follows:
[0040] The block number i corresponding to the identified block whose pixel value in each frame image is greater than the threshold value Y1 is marked as the transformation number i′ for representation, and the block number i corresponding to the identified block whose pixel value in each frame image is less than or equal to the threshold value Y1 is not changed, thereby obtaining the image to be analyzed corresponding to each frame image, and realizing the background separation operation of each frame image;
[0041] Obtaining multiple frames of images taken continuously by the robot provides a data basis for subsequent analysis and processing. Only by obtaining multiple frames of images can we compare and analyze the images to determine information such as the changed areas and obstacle areas in the images. This is the starting step of the entire ranging algorithm and provides the necessary materials for subsequent steps.
[0042] The specific value of the threshold value Y1 is formulated by relevant personnel according to actual needs;
[0043] For example, assume that a frame image is evenly divided into 6 recognition blocks, and the 6 recognition blocks are numbered from left to right and from top to bottom, and the block numbers of the 6 recognition blocks are 1, 2, 3, 4, 5, and 6, respectively. 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 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 image are changed to transformation numbers 2′, 4′, and 5, and the rest are not changed, thereby obtaining the image to be analyzed corresponding to this frame image;
[0044] The image is evenly divided into multiple recognition blocks and labeled, so that a more detailed regional analysis of the image can be performed. By comparing with the preset threshold Y1, the recognition blocks with pixel values greater than the threshold are labeled and the background separation operation is realized. This step is one of the key steps. It can highlight the parts of the image where obstacles or other areas may exist, distinguish them from the background, and prepare for the subsequent extraction of the changed area image.
[0045] Step 3: Extract and splice the identification blocks corresponding to the transformation labels in the images to be analyzed corresponding to each frame image, and then generate the change area images corresponding to each frame image. The specific method is as follows:
[0046] 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;
[0047] For example, assume that a frame 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 value Y1, the block labels of the recognition blocks numbered 2, 4 and 5 in the frame image are changed to transformation labels 2′, 4′ and 5, and the rest are not changed. The recognition blocks with transformation labels in the frame image are extracted, and according to the block labels 2, 4 and 5 in the transformation labels 2′, 4′ and 5 corresponding to the recognition blocks with transformation labels, the recognition blocks with transformation labels are spliced in sequence to obtain the change area image corresponding to the frame image.
[0048] By extracting the identification blocks with change labels from the image to be analyzed and sorting them from small to large according to the values of the change labels to generate a change area image, the position and shape of the changed area in the image can be clearly determined. These change areas are often related to obstacles or other dynamic objects. These areas are the objects that need to be focused on and analyzed. By splicing these area images, the overall situation of the change area in the image can be more intuitively understood.
[0049] Step 4: Extract the identification blocks with the same transformation labels that exist in the change area images corresponding to each frame image, mark them as fixed blocks, extract the block labels corresponding to each fixed block to obtain the obstacle block labels, and establish a blank frame according to the size of the multiple frames of images taken continuously by the robot. Use the same method to divide and process the multiple frames of images taken continuously to divide and label the blank frame, and then obtain the reference image frame. Fill the reference image frame with grayscale according to the obstacle block labels, and then obtain the analysis image. The specific method is as follows:
[0050] 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 i corresponding to each recognition block in the blank frame, and then obtain the reference image frame, extract the recognition blocks with the same transformation number that exist in the change area image corresponding to each frame image, and mark them as fixed blocks, and use the block number corresponding to each fixed block as the obstacle block number, and fill the corresponding recognition block in the reference image frame with grayscale according to the obstacle block number, so as to obtain the analysis image;
[0051] The identification blocks with the same transformation labels that exist in the change area of each frame image are extracted as fixed blocks, and the real obstacle areas are determined. These obstacle blocks are places that the robot needs to avoid during movement. By gray-filling the corresponding obstacle block labels in the reference image frame, an analysis image is generated, which provides an important reference for subsequent distance measurement. 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 distance measurement calculations and path planning operations, so as to ensure that the robot can safely and accurately avoid obstacles for distance measurement and movement.
[0052] Embodiment 2
[0053] As the second embodiment of the present invention, when the present application is implemented, compared with the first embodiment, the technical solution of the second embodiment is different from the first embodiment only in that the second embodiment further includes step five;
[0054] Step 5: Obtain the center position coordinates of the grayscale area corresponding to the analysis image, and the center point coordinates of the analysis image. Calculate the distance between the robot and the obstacle area based on the center position coordinates of the grayscale area and the center point coordinates of the analysis image. The specific method is:
[0055] The obtained grayscale area center coordinates and the center point coordinates corresponding to the analysis image, i.e., the optical center coordinates of the analysis image, are converted into three-dimensional points (XAc, YAc, ZAc) and (XBc, YBc, ZBc) in the camera coordinate system by combining the robot camera internal and external parameters.
[0056] By formula: Calculate the straight-line distance between the robot and the center of the grayscale area and use it as the distance D between the robot and the obstacle area:
[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 assume that the position of the robot is close to that of the camera. Therefore, in order to simplify the calculation, the straight-line distance between the camera and the center of the grayscale area is directly calculated and used as the distance between the robot and the obstacle area.
[0058] By extracting the recognition blocks with transformation labels from the image to be analyzed and sorting and splicing them according to the values of the transformation labels from small to large to generate the change area image, the position and shape of the changed area in the image can be clearly determined. These change areas are often related to obstacles or other dynamic objects. These areas are the objects that need to be focused on and analyzed. The recognition blocks with the same transformation labels that exist in the change area of each frame image are extracted as fixed blocks to determine the real obstacle area. These obstacle blocks are places that the robot needs to avoid during movement. By gray-filling the corresponding obstacle block labels in the reference image frame, an analysis image is generated, which provides an important reference 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 to ensure that the robot can safely and accurately avoid obstacles for ranging and movement. The straight-line distance between the camera and the center of the gray area is directly calculated and used 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 assume that the position of the robot is close to that of the camera. Therefore, in order to simplify the calculation, the straight-line distance between the camera and the center of the grayscale area is directly calculated and used as the distance between the robot and the obstacle area.
[0059] By comparing and analyzing multiple frames of images, the position and shape of obstacles can be determined more accurately, thereby improving the accuracy of ranging. By separating the background and extracting the changed area, the interference of background noise can be effectively eliminated, enhancing the robustness of the system. By directly calculating the straight-line distance between the camera and the center of the grayscale area, the complexity of the ranging calculation is simplified. The robot can perceive the changes in the surrounding environment and the existence of obstacles in real time, and make corresponding obstacle avoidance decisions and path planning.
[0060] Embodiment 3
[0061] As the third embodiment of the present invention, when the present application is specifically implemented, compared with the first and second embodiments, the difference between the technical solution of this embodiment and the first and second embodiments is that in this embodiment, the distance D between the robot and the obstacle area is compared and analyzed with 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 based on actual needs.
[0063] Embodiment 4
[0064] As the fourth embodiment of the present invention, the technical solution of this embodiment is to combine and implement the solutions of the above-mentioned first embodiment, second embodiment and third embodiment.
[0065] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0066] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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. Therefore, the protection scope of the present application should be based on 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.
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 2, characterized in that: The specific method of generating the change region image corresponding to each frame image is as follows: The images to be analyzed corresponding to each frame image are obtained, and the identification blocks with transformation labels corresponding to each image to be analyzed are extracted from each image to be analyzed. According to the value corresponding to the block label i in the transformation label i′ corresponding to the identification block with transformation label in each image to be analyzed, the identification blocks with transformation labels in each image to be analyzed are sorted in ascending order, so as to obtain the change area images corresponding to each frame image.
5. The intelligent distance measurement algorithm according to claim 4, characterized in that: 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.
6. The intelligent distance measurement algorithm according to claim 5, 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.
7. The intelligent distance measurement algorithm according to claim 5, 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.
8. The intelligent distance measurement algorithm according to claim 7, 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.
9. The intelligent distance measurement algorithm according to claim 8, 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
Operation action recognition method and device and storage medium
CN113989944A
Aerial survey platform carried on unmanned aerial vehicle
CN118089672A
Apparatus and method for motion detecting sensor using camera
KR101240924B1