Distance determination method, device, intelligent device and storage medium
By acquiring the initial laser image and determining the target laser point and coordinate information, combining the candidate calibration curve and the target calibration interval, the problem of low measurement accuracy and efficiency of distance measurement between the camera and the obstacle is solved, and higher measurement accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202111126781.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-09-26
AI Technical Summary
In the prior art, the distance measurement accuracy and measurement efficiency between the camera and the obstacle are low.
By acquiring the initial laser image, the target laser point and the target coordinate information are determined, the target calibration interval to which the target laser point belongs is determined based on the target coordinate information and at least two candidate calibration curves, and finally the target distance is determined based on the target calibration interval and the target coordinate information.
Improve the accuracy of distance measurement between the camera and obstacles and enhance the measurement efficiency.
Smart Images

Figure CN113870336B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a distance determination method, apparatus, intelligent device and storage medium. Background Art
[0002] Smart devices will encounter various obstacles during operation. In order to enable smart devices to avoid obstacles, many smart devices will add line laser ranging modules.
[0003] When measuring the distance of obstacles through the line laser ranging module, there are two important parameters in the measurement process, namely the field of view angle and the distance measurement accuracy. At present, the measurement accuracy and efficiency of the distance between the camera and the obstacle are low. Summary of the invention
[0004] The present invention provides a distance determination method, an apparatus, an intelligent device and a storage medium, which are used to improve the accuracy of the detected distance between a camera and an obstacle and improve the measurement efficiency.
[0005] A first aspect of an embodiment of the present invention provides a distance determination method, comprising: acquiring an initial laser image, wherein the initial laser image is an image obtained by a target camera shooting a target obstacle and a measuring laser line on the target obstacle; determining a target laser point and target coordinate information of the target laser point according to the initial laser image; determining a target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera; determining a corresponding target distance according to the target calibration interval and the target coordinate information, wherein the target distance is used to represent the distance between the target camera and the target obstacle.
[0006] In a feasible implementation, before determining the target calibration interval to which the target laser point belongs based on the target coordinate information and at least two candidate calibration curves corresponding to the target camera, it includes: determining at least two candidate calibration curves corresponding to the target camera based on parameter information of the target camera.
[0007] In a feasible implementation manner, after determining the corresponding target distance according to the target calibration interval and the target coordinate information, it further includes: correcting the target distance based on the posture parameters of the target camera.
[0008] In a feasible implementation manner, determining the corresponding target distance according to the target calibration interval and the target coordinate information includes: determining a proportional relationship according to the target coordinate information, the proportional relationship being used to represent the ratio between a first boundary distance and a second boundary distance, the first boundary distance being the distance between the target laser point and a first boundary of the target calibration area, the second boundary distance being the distance between the target laser point and a second boundary of the target calibration area; determining the corresponding target distance based on the calibration distance corresponding to the target calibration interval and the proportional relationship.
[0009] In a feasible implementation manner, before acquiring the initial laser image, the method further includes: acquiring at least two candidate calibration curves corresponding to the target camera using at least two calibration laser lines.
[0010] In a feasible implementation, the method of obtaining at least two candidate calibration curves corresponding to a target camera using at least two calibration laser lines includes: performing the following operations for each calibration laser line: obtaining a calibration laser image, wherein the calibration laser image is an image obtained by photographing the calibration laser line; fitting the calibration laser pixels to obtain fitting laser lines corresponding to the calibration laser pixels, wherein the calibration laser pixels are pixels in the calibration laser image used to represent the calibration laser lines; and obtaining a candidate calibration curve corresponding to the target camera based on the fitting laser lines.
[0011] In a feasible implementation, the method of obtaining a candidate calibration curve corresponding to a target camera based on the fitted laser line includes: determining property parameters corresponding to the fitted laser line, wherein the property parameters include a slope; and completing the fitted laser line based on the property parameters to obtain a candidate calibration curve corresponding to the target camera.
[0012] A second aspect of an embodiment of the present invention provides a distance determination device, comprising: an image acquisition module, used to acquire an initial laser image, wherein the initial laser image is an image obtained by a target camera shooting a target obstacle and a measuring laser line on the target obstacle; a laser point determination module, used to determine a target laser point and target coordinate information of the target laser point according to the initial laser image; an interval determination module, used to determine a target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera; and a distance determination module, used to determine a corresponding target distance according to the target calibration interval and the target coordinate information, wherein the target distance is used to represent the distance between the target camera and the target obstacle.
[0013] In a feasible implementation manner, the distance determination device further includes: a first curve determination module, configured to determine at least two candidate calibration curves corresponding to the target camera according to parameter information of the target camera.
[0014] In a feasible implementation manner, the distance determination device further includes: a laser correction module, configured to correct the target distance based on the posture parameters of the target camera.
[0015] In a feasible implementation manner, the distance determination module is specifically used to: determine a proportional relationship based on the target coordinate information, the proportional relationship being used to represent the ratio between a first boundary distance and a second boundary distance, the first boundary distance being the distance between the target laser point and a first boundary of the target calibration area, the second boundary distance being the distance between the target laser point and a second boundary of the target calibration area; and determine the corresponding target distance based on the calibration distance corresponding to the target calibration interval and the proportional relationship.
[0016] In a feasible implementation manner, the distance determination device further includes: a second curve determination module, configured to obtain at least two candidate calibration curves corresponding to each camera using at least two calibration laser lines.
[0017] In a feasible implementation manner, the second curve determination module is specifically used to: perform the following operations for each calibration laser line: obtain a calibration laser image, where the calibration laser image is an image obtained by photographing the calibration laser line; fit the calibration laser pixels to obtain a fitted laser line corresponding to the calibration laser pixels, where the calibration laser pixels are pixels in the calibration laser image used to represent the calibration laser line; and obtain a candidate calibration curve corresponding to the target camera based on the fitted laser line.
[0018] A third aspect of an embodiment of the present invention provides an intelligent device, comprising: a memory and at least one processor, wherein instructions are stored in the memory; and the at least one processor calls the instructions in the memory so that the intelligent device executes the above-mentioned distance determination method.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned distance determination method.
[0020] In the technical solution provided by the embodiment of the present invention, an initial laser image is obtained, which is an image obtained by the target camera shooting the target obstacle and the measuring laser line on the target obstacle; the target laser point and the target coordinate information of the target laser point are determined according to the initial laser image; the target calibration interval to which the target laser point belongs is determined according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera; the corresponding target distance is determined according to the target calibration interval and the target coordinate information, and the target distance is used to represent the distance between the target camera and the target obstacle. In the embodiment of the present invention, the corresponding target distance is determined by at least two candidate calibration curves corresponding to the target camera and the target coordinate information of the target laser point, thereby improving the measurement accuracy corresponding to the distance between the camera and the obstacle and improving the measurement efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of an embodiment of a distance determination method in an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a mobile robot in an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of a scenario in which a mobile robot encounters an obstacle in an embodiment of the present invention;
[0024] Figure 4 A schematic diagram of another scenario in which a mobile robot encounters an obstacle in an embodiment of the present invention;
[0025] Figure 5 A schematic diagram of another scenario in which a mobile robot encounters an obstacle in an embodiment of the present invention;
[0026] Figure 6 A schematic diagram of another embodiment of a distance determination method in an embodiment of the present invention;
[0027] Figure 7 A schematic diagram of a scene of a target calibration interval in an embodiment of the present invention;
[0028] Figure 8 A schematic diagram of another embodiment of a distance determination method in an embodiment of the present invention;
[0029] Fig. 9 The laser line images are respectively taken by three cameras when the calibration distance is 5CM in the embodiment of the present invention;
[0030] Fig.10 The laser line images are respectively taken by three cameras when the calibration distance is 8CM in the embodiment of the present invention;
[0031] Fig.11The laser line images are respectively taken by three cameras when the calibration distance is 15CM in the embodiment of the present invention;
[0032] Fig.12 is a schematic diagram of an uncorrected initial laser image in an embodiment of the present invention;
[0033] Fig.13 is a schematic diagram of a target laser image after correction in an embodiment of the present invention;
[0034] Fig.14 A schematic diagram of an embodiment of a distance determination device in an embodiment of the present invention;
[0035] Fig.15 FIG. 1 is a schematic diagram of an embodiment of a smart device in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present invention provides a distance determination method, an apparatus, an intelligent device and a storage medium, which are used to improve the distance measurement accuracy between a camera and an obstacle and improve the measurement efficiency.
[0037] It is understandable that the present invention can be applied to smart devices. As an example but not limitation, the smart device can be a mobile robot. This application is described using a mobile robot as an example. The mobile robot can be any one of a sweeping robot, a sweeping and mopping robot, a mopping robot, or a washing robot.
[0038] See also Figure 1 , a flow chart of a distance determination method provided by an embodiment of the present invention, specifically comprising:
[0039] 101. Acquire an initial laser image, where the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle.
[0040] As an example but not limitation, the mobile robot obtains an initial laser image through a target camera, and the initial laser image is an image obtained by the target camera shooting the target obstacle and the measuring laser line on the target obstacle. Among them, the measuring laser line is a laser line emitted by the mobile robot through a laser emitting device for detecting the target obstacle. The measuring laser line here is distinguished from the calibration laser line used when determining the candidate calibration curve. The calibration laser line is a laser line emitted by the laser emitting device during calibration, and specifically can be: a laser line presented on the calibration baffle when the laser emitting device on the smart device projects a laser onto the calibration baffle.
[0041] It should be noted that the target camera involved in the embodiment of the present application is any one of the multiple cameras installed on the smart device, or the only camera installed on the smart device. The target camera can be installed at any angle. For example, see Figure 2 A structural schematic diagram of an intelligent device is shown. When three cameras are installed on the intelligent device, the target camera can be a tilted camera located on the left, a tilted camera located on the right, or a non-tilted camera located in the middle. The angle between the optical axis of the tilted camera and the forward direction of the robot can be greater than 0 degrees. The intelligent device also includes a laser emitting device. The intelligent device can also include other structures, such as a moving structure and a cleaning structure, which are not limited here.
[0042] 102. Determine a target laser point and target coordinate information of the target laser point according to the initial laser image.
[0043] As an example but not limitation, the mobile robot determines the target laser point and the target coordinate information of the target laser point based on the initial laser image, wherein the target laser point is the pixel point corresponding to the measuring laser line in the initial laser image, that is, the target laser point is the pixel point used to represent the measuring laser line in the initial laser image.
[0044] 103. Determine a target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera.
[0045] As an example but not a limitation, the mobile robot determines the target calibration interval to which the target laser point belongs based on the target coordinate information and at least two candidate calibration curves corresponding to the target camera. The at least two candidate calibration curves divide the image into multiple regions, and the region to which the target coordinate information belongs is used as the target calibration interval. In this embodiment, the corresponding candidate calibration curve can be first determined by different calibration distances, and then the corresponding distance is calculated based on the area formed by the two candidate calibration curves adjacent to the target laser point, wherein the calibration distance can be: when the candidate calibration curve is obtained using the calibration laser line, the distance between the calibration baffle and the camera.
[0046] The candidate calibration curve can be used to represent: the correspondence between the distance (calibration distance) between the specified object (such as the calibration baffle) and the camera and the image pixels. Specifically, it can be: the correspondence between the distance (calibration distance) between the specified object (such as the calibration baffle) and the camera and the coordinates of the image pixels. The points on the candidate calibration curve include the image pixels corresponding to the calibration distance.
[0047] It should be noted that each camera can correspond to at least two candidate calibration curves. For example, for the central non-tilt camera, the calibration distances can be 5CM, 8CM, 10CM, 13CM, 15CM, 18CM, 20CM, 23CM, 25CM, 28CM, and 30CM respectively. The calibration distance can also be set according to actual conditions, and the interval distance each time can be set to the same or different.
[0048] 104. Determine a corresponding target distance according to the target calibration interval and the target coordinate information, where the target distance is used to represent the distance between the target camera and the target obstacle.
[0049] As an example but not limitation, a target camera is provided on the mobile robot, and the mobile robot determines the corresponding target distance based on the target calibration interval and the target coordinate information. The target distance is used to represent the distance between the target camera and the target obstacle, that is, the target distance can be used to represent the distance between the mobile robot and the target obstacle.
[0050] As an example but not limitation, the target camera in this embodiment can protrude from the shell surface of the mobile robot or be flush with the shell. This embodiment is described as a state where the camera is flush with the shell to calculate the distance between the target camera and the target obstacle, that is, to calculate the distance between the mobile robot and the target obstacle.
[0051] It should be noted that the target laser point can be any randomly selected laser point, or one of the endpoints of the measuring laser line in the initial laser image can be selected as the target laser point. A coordinate system is constructed with a point in the initial laser image (e.g., the point corresponding to the lower left corner or the point corresponding to the upper left corner, or other points) as the origin, and the position information of the target laser point relative to the origin is used as the target coordinate information, thereby improving the calculation efficiency. In addition, the target laser point can also refer to all laser points on a single measuring laser line in the initial laser image. For example, when a non-tilted camera located in the center captures an obstacle, the distance values corresponding to all points on the single laser line will be output in the end, and each distance value represents the corresponding obstacle distance.
[0052] As an example but not a limitation, for the same obstacle, the distances measured by multiple cameras may be the same or different. Figure 3 As shown in , when the side of the obstacle facing the mobile robot is a plane and perpendicular to the laser emission direction, or the side of the obstacle facing the mobile robot is a plane and perpendicular to the shooting direction of the non-tilted camera, the distances measured by the three cameras can be the same. Figure 4As shown in FIG. 1 , when the side of the obstacle facing the mobile robot is a plane and is not perpendicular to the laser emission direction, or the side of the obstacle facing the mobile robot is a plane and is not perpendicular to the shooting direction of the non-tilted camera, the distances measured by the three cameras may be different. Figure 5 As shown, when the obstacle facing the mobile robot is a curved surface, the distances measured by the three cameras may not be exactly the same.
[0053] It can be understood that the curve in this article may include a straight line or a non-straight line.
[0054] The embodiment of the present invention determines the corresponding target distance through at least two candidate calibration curves corresponding to the target camera and the target coordinate information of the target laser point, thereby improving the accuracy of the distance measurement between the camera and the obstacle and improving the measurement efficiency.
[0055] See also Figure 6 , another flow chart of the distance determination method provided by an embodiment of the present invention specifically includes:
[0056] 601. Acquire an initial laser image, where the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle.
[0057] Step 601 is similar to step 101 and will not be described in detail here.
[0058] 602. Determine a target laser point and target coordinate information of the target laser point according to the initial laser image.
[0059] 603. Obtain at least two candidate calibration curves corresponding to the target camera according to parameter information of the target camera.
[0060] As an example but not limitation, the parameter information includes position parameters and / or posture parameters and / or identification information, wherein the position parameters are used to indicate the position of the target camera in the smart device, for example, the position parameters are used to indicate that the center point of the target camera is located at a specific position of the mobile robot. For example, in general, the camera is installed at the front of the shell of the mobile robot. Figure 2 In the schematic diagram shown, the three cameras are installed at the front of the mobile robot shell near the bottom, and the center points of the three cameras are located on the same horizontal line. The attitude parameter is used to represent the tilt angle and / or tilt direction of the target camera. Figure 2In the schematic diagram shown, the cameras on both sides have tilt angles. The left tilt and the right tilt are based on the horizontal direction as the reference line. The tilt angles of the cameras on both sides can be set to be the same, and the tilt directions are different. For example, the left tilt camera is 15 degrees to the left, and the right tilt camera is 15 degrees to the right. The tilt angles of the cameras on both sides can also be set to be different, and can be set according to actual needs. For example, when it is necessary to focus on measuring the actual distance from the right side of the mobile robot to the obstacle, the tilt angle of the right tilt camera can be reduced. For example, the left tilt camera is 20 degrees to the left, and the right tilt camera is 15 degrees to the right. In addition, the identification information can be used to distinguish the cameras. For example, when the mobile robot is provided with a left tilt camera, a non-tilted camera, and a right tilt camera, if the target camera is a left tilt camera, step 603 can be specifically: select (determine) at least two candidate calibration curves corresponding to the left tilt camera according to the identification information corresponding to the left tilt camera.
[0061] It is understandable that if there are at least two cameras installed on the mobile robot, the at least two cameras can be located on the same horizontal line or on horizontal lines at different heights. For example, due to installation requirements and error factors, the inclination angles of the tilted cameras on the left and right sides may not be exactly the same. The installation height of the non-tilted camera located in the center can be higher than the installation height of other cameras with tilt angles. When the installation heights of the cameras are inconsistent, separate distance calibration is required, which is not limited here.
[0062] 604. Determine a target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera.
[0063] 605. Determine a corresponding target distance according to the target calibration interval and the target coordinate information, where the target distance is used to represent the distance between the target camera and the target obstacle.
[0064] In some embodiments, step 605 includes: determining a proportional relationship based on the target coordinate information, the proportional relationship is used to represent the ratio between the first boundary distance and the second boundary distance, the first boundary distance is the distance between the target laser point and the first boundary of the target calibration area, and the second boundary distance is the distance between the target laser point and the second boundary of the target calibration area; determining the corresponding target distance based on the calibration distance corresponding to the target calibration interval and the proportional relationship.
[0065] The first boundary and the second boundary are two different candidate calibration curves constituting the target calibration area.
[0066] For example, Figure 7As shown, assuming that the target calibration interval A to which the target laser point belongs is an interval composed of a 5CM calibration curve and an 8CM calibration curve, the first boundary and the second boundary corresponding to the target calibration interval A are the 5CM calibration curve and the 8CM calibration curve respectively, the first boundary distance is the distance between the target laser point and the 5CM calibration curve, and the second boundary distance is the distance between the target laser point and the 8CM calibration curve. Assuming that the first boundary distance is the same as the second boundary distance, that is, the ratio of the first distance to the second distance is 1:1, it can be determined that the distance corresponding to the target measurement point is 6.5CM.
[0067] The embodiment of the present invention determines the corresponding target distance through at least two candidate calibration curves corresponding to the target camera and the target coordinate information of the target laser point, thereby improving the accuracy of the distance measurement between the camera and the obstacle and improving the measurement efficiency.
[0068] See also Figure 8 , another flow chart of the distance determination method provided by an embodiment of the present invention specifically includes:
[0069] 801. Obtain at least two candidate calibration curves corresponding to a target camera using at least two calibration laser lines.
[0070] As an example but not a limitation, at least two calibration laser lines may be used to obtain at least two candidate calibration curves corresponding to each camera set on the smart device. For example, at least two calibration laser lines may be used to obtain at least two candidate calibration curves corresponding to a left-tilted camera, at least two candidate calibration curves corresponding to a right-tilted camera, and at least two candidate calibration curves corresponding to a non-tilted camera. Assuming that the target camera is a right-tilted camera, it can be seen from the foregoing that at least two candidate calibration curves corresponding to the target camera may be obtained.
[0071] When measuring obstacles with a line laser ranging module, there are two important parameters in the measurement process, namely, the field of view angle and the ranging accuracy. Because the shooting angle of each camera is fixed, the field of view angle can be increased by increasing the number of cameras and shooting images in different directions. For example, a three-camera combination, with one camera in the middle and the left and right cameras tilted several degrees respectively, can maximize the field of view angle.
[0072] It should be noted that the candidate calibration curve of each camera can be calibrated separately. In order to improve the calibration accuracy, when calibrating a candidate calibration curve of a camera, the corresponding calibration laser line can be photographed multiple times to determine the coordinates of the calibration laser pixels in the calibration laser line. For example, for the non-tilted camera located in the center, the non-tilted camera takes 10 photos, and an xy coordinate system is established for the photos. For the calibration laser pixel of X=X0, X0 can correspond to 10 vertical coordinates, and the average of the 10 vertical coordinates is taken, and the average value is used as the vertical coordinate of the calibration laser pixel of X=X0.
[0073] In some embodiments, step 801: determining at least two candidate calibration curves corresponding to a target camera using at least two calibration laser lines, includes: performing the following operations on each calibration laser line:
[0074] Step a, obtaining a calibration laser image, where the calibration laser image is an image obtained by photographing a calibration laser line;
[0075] Step b, fitting the calibration laser pixels to obtain the fitted laser lines corresponding to the calibration laser pixels, where the calibration laser pixels are pixels in the calibration laser image used to represent the calibration laser lines;
[0076] Step c: determining a candidate calibration curve corresponding to the target camera based on the fitted laser line.
[0077] As an example but not a limitation, when the calibration baffle is at the 5CM calibration position (the calibration baffle being at the 5CM calibration position means that the distance between the smart device and the calibration baffle is 5CM), the laser emitting device on the smart device projects the laser onto the calibration baffle, that is, a calibration laser line (assuming it is calibration laser line A) will appear on the calibration baffle, and each camera on the smart device (including the target camera) shoots the calibration laser line A. For ease of description, the calibration laser pixel obtained by the target camera shooting the calibration laser line A can be recorded as the calibration laser pixel a, and the calibration laser line A corresponds to a plurality of calibration laser pixels a. A straight line fitting is performed on the plurality of calibration laser pixels a to obtain the corresponding fitting laser line, and the candidate calibration curve 1 corresponding to the target camera is determined based on the fitting laser line, and the candidate calibration curve 1 corresponds to 5CM. Then the calibration baffle can be sequentially set at other calibration positions, for example, at 5CM, 8CM, 10CM, and 13CM, and similarly, the candidate calibration curve corresponding to 8CM, the candidate calibration curve corresponding to 10CM, and the candidate calibration curve corresponding to 13CM are obtained.
[0078] In some embodiments, step c: determining a candidate calibration curve corresponding to the target camera based on the fitted laser line includes:
[0079] Determine the property parameters corresponding to the fitted laser line, the property parameters including the slope;
[0080] The fitted laser line is completed based on the property parameters to obtain the candidate calibration curve corresponding to the target camera.
[0081] The property parameters corresponding to the fitted laser line may also include an intercept.
[0082] In addition, completing the fitted laser line based on the property parameters refers to determining the coordinates of all pixels on the straight line where the fitted laser line is located in a specified direction based on the property parameters.
[0083] As an example but not limitation, the property parameters include slope and intercept. Assume that the slope and intercept corresponding to the fitted laser line are 2 and 1 respectively, that is, the straight line equation corresponding to the fitted laser line can be expressed as y=2x+1. Assume that the target camera can capture an image with 100 pixels in the x-axis direction, and there are only 8 pixels on the fitted laser line used to represent the laser point. Then, according to the slope and intercept corresponding to the fitted laser line, the coordinates of the other 92 pixels on y=2x+1 can be determined, thereby determining the coordinates of the 100 pixels on y=2x+1.
[0084] Since the fitted laser line can be completed based on the property parameters to obtain the candidate calibration curve corresponding to the target camera, the target distance can be accurately determined by this embodiment when the subsequently captured measurement laser line falls at any position in the initial laser image.
[0085] As an example but not a limitation, when the calibration baffle is in different calibration positions, the laser line images captured by the camera may be the same or may be the same. For example, Figure 2 Taking the three cameras shown in the figure as an example, when the calibration baffle is at the 5CM calibration position, the initial laser images taken by the three cameras are as follows Fig. 9 As shown; when the calibration baffle is at the 8CM calibration position, the initial laser images captured by the three cameras are as follows Fig.10 When the calibration baffle is at the 15CM calibration position, the initial laser images captured by the three cameras are as follows: Fig.11 As shown in the figure, it can be seen that from near to far, the laser lines shot by the non-tilted camera in the center are all horizontal lines, while the laser lines shot by the cameras on the left and right sides change in a trapezoidal pattern. For each calibration distance, the tilt angle of the oblique line is different. The calibrated candidate calibration curve can be saved in the microcontrol unit (MCU) of the mobile robot for storage.
[0086] 802. Acquire an initial laser image, where the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle.
[0087] 803. Determine a target laser point and target coordinate information of the target laser point according to the initial laser image.
[0088] 804. Determine a target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera.
[0089] 805. Determine a corresponding target distance according to the target calibration interval and the target coordinate information, where the target distance is used to represent the distance between the target camera and the target obstacle.
[0090] In some embodiments, after step 805, the method further includes: correcting the target distance based on the posture parameters of the target camera. In this way, the accuracy of the calculated distance between the tilted camera and the obstacle can be improved.
[0091] The posture parameter is used to represent the tilt angle and / or tilt direction of the target camera.
[0092] For example, if the target camera is a left-tilted camera or a right-tilted camera, the target distance is corrected based on the posture parameters of the target camera.
[0093] In some embodiments, after step 802, the method further includes: correcting the target laser point based on the posture parameters of the target camera.
[0094] As an example and not a limitation, assume that the mobile robot includes three cameras, such as Fig.12 As shown in the figure, the measurement laser line photographed by the left tilted camera is tilted to the lower right, and the measurement laser line photographed by the right tilted camera is tilted to the upper right. The corrected target laser point can be Fig.13 shown.
[0095] It should be noted that correcting the target laser point can improve the accuracy of the calculated distance between the tilted camera and the obstacle.
[0096] The embodiment of the present invention determines the corresponding target distance through at least two candidate calibration curves corresponding to the target camera and the target coordinate information of the target laser point, thereby improving the accuracy of the distance measurement between the camera and the obstacle and improving the measurement efficiency.
[0097] The above describes the distance determination method in the embodiment of the present invention. The following describes the distance determination device in the embodiment of the present invention. Fig.14 , an embodiment of the distance determination device in the embodiment of the present invention includes:
[0098] An image acquisition module 1401 is used to acquire an initial laser image, where the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle;
[0099] A laser point determination module 1402 is used to determine a target laser point and target coordinate information of the target laser point according to the initial laser image;
[0100] An interval determination module 1403 is used to determine the target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera;
[0101] The distance determination module 1404 is used to determine the corresponding target distance according to the target calibration interval and the target coordinate information, and the target distance is used to represent the distance between the target camera and the target obstacle.
[0102] Optionally, the distance determining device further includes:
[0103] The first curve determination module 1405 is used to determine at least two candidate calibration curves corresponding to the target camera according to the parameter information of the target camera.
[0104] Optionally, the distance determining device further includes:
[0105] The laser correction module 1406 is used to correct the target distance based on the posture parameters of the target camera after the distance determination module 1404 executes the determination of the corresponding target distance according to the target calibration interval and the target coordinate information, or to correct the target laser point based on the posture parameters of the target camera after the image acquisition module 1401 executes the acquisition of the initial laser image.
[0106] Optionally, the distance determination module 1404 is specifically used to:
[0107] Determine a proportional relationship according to the target coordinate information, the proportional relationship being used to represent a ratio between a first boundary distance and a second boundary distance, the first boundary distance being the distance between the target laser point and a first boundary of the target calibration area, and the second boundary distance being the distance between the target laser point and a second boundary of the target calibration area;
[0108] The corresponding target distance is determined based on the calibration distance corresponding to the target calibration interval and the proportional relationship.
[0109] Optionally, the distance determining device further includes:
[0110] The second curve determination module 1407 is used to obtain at least two candidate calibration curves corresponding to the target camera using at least two calibration laser lines.
[0111] The embodiment of the present invention determines the corresponding target distance through at least two candidate calibration curves corresponding to the target camera and the target coordinate information of the target laser point, thereby improving the accuracy of the distance measurement between the camera and the obstacle and improving the measurement efficiency.
[0112] It should be noted that the above-mentioned distance determination device can execute the distance determination method provided in the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the distance determination device, please refer to the distance determination method provided in the embodiment of the present invention.
[0113] Fig.15 1 is a schematic diagram of the structure of a smart device provided by an embodiment of the present invention. The smart device 1500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 1510 (for example, one or more processors) and a memory 1520, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1533 or data 1532. Among them, the memory 1520 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the smart device 1500. Furthermore, the processor 1510 can be configured to communicate with the storage medium 1530 to execute a series of instruction operations in the storage medium 1530 on the smart device 1500.
[0114] The smart device 1500 may also include one or more power supplies 1540, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1560, and / or one or more operating systems 1531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Fig.15 The structure of the smart device shown does not constitute a limitation on the smart device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0115] By way of example and not limitation, smart device 1500 may be a mobile robot.
[0116] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the distance determination method.
[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0119] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A distance determination method, characterized in that: include: Acquire an initial laser image, where the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle; Determine a target laser point and target coordinate information of the target laser point according to the initial laser image; The target laser point is a pixel point corresponding to the measured laser line in the initial laser image; Determine the target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera; The candidate calibration curve is determined by corresponding to different calibration distances; the calibration distance is the distance between the calibrated designated object and the camera when the candidate calibration curve is obtained by using a calibration laser line; the at least two candidate calibration curves are used to divide the initial laser image into multiple areas, and the area in the target coordinate information is the target calibration interval; The corresponding target distance is determined according to the target calibration interval, the target coordinate information and the calibration distance, and the target distance is used to represent the distance between the target camera and the target obstacle.
2. The distance determination method according to claim 1, characterized in that: Before determining the target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera, the method includes: At least two candidate calibration curves corresponding to the target camera are determined according to the parameter information of the target camera.
3. The distance determination method according to claim 1, characterized in that: After determining the corresponding target distance according to the target calibration interval and the target coordinate information, the method further includes: The target distance is corrected based on the posture parameters of the target camera.
4. The distance determination method according to claim 1, characterized in that: The determining the corresponding target distance according to the target calibration interval and the target coordinate information includes: Determine a proportional relationship according to the target coordinate information, the proportional relationship being used to represent a ratio between a first boundary distance and a second boundary distance, the first boundary distance being the distance between the target laser point and a first boundary of the target calibration area, and the second boundary distance being the distance between the target laser point and a second boundary of the target calibration area; The corresponding target distance is determined based on the calibration distance corresponding to the target calibration interval and the proportional relationship.
5. The distance determination method according to any one of claims 1 to 4, characterized in that: Before acquiring the initial laser image, the method further includes: At least two calibration laser lines are used to obtain at least two candidate calibration curves corresponding to the target camera.
6. The distance determination method according to claim 5, characterized in that: The method of obtaining at least two candidate calibration curves corresponding to the target camera using at least two calibration laser lines includes: For each calibration laser line, do the following: Acquire a calibration laser image, where the calibration laser image is an image obtained by photographing a calibration laser line; Fitting the calibration laser pixels to obtain fitting laser lines corresponding to the calibration laser pixels, wherein the calibration laser pixels are pixels in the calibration laser image used to represent the calibration laser lines; A candidate calibration curve corresponding to the target camera is obtained based on the fitted laser line.
7. The distance determination method according to claim 6, characterized in that: The step of obtaining a candidate calibration curve corresponding to the target camera based on the fitted laser line includes: Determining property parameters corresponding to the fitted laser line, wherein the property parameters include a slope; The fitting laser line is completed based on the property parameters to obtain a candidate calibration curve corresponding to the target camera.
8. A distance determination device, characterized in that: include: An image acquisition module, used to acquire an initial laser image, wherein the initial laser image is an image obtained by a target camera photographing a target obstacle and a measuring laser line on the target obstacle; A laser point determination module, used to determine a target laser point and target coordinate information of the target laser point according to the initial laser image; The target laser point is a pixel point corresponding to the measured laser line in the initial laser image; An interval determination module, used to determine the target calibration interval to which the target laser point belongs according to the target coordinate information and at least two candidate calibration curves corresponding to the target camera; The candidate calibration curve is determined by corresponding to different calibration distances; the calibration distance is the distance between the calibrated designated object and the camera when the candidate calibration curve is obtained by using a calibration laser line; the at least two candidate calibration curves are used to divide the initial laser image into multiple areas, and the area in the target coordinate information is the target calibration interval; The distance determination module is used to determine the corresponding target distance according to the target calibration interval, the target coordinate information and the calibration distance, and the target distance is used to represent the distance between the target camera and the target obstacle.
9. A smart device, characterized in that: The smart device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the smart device to execute the distance determination method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by a processor, the distance determination method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Auxiliary parking device, system and method
CN109484303A
Laser point automatic tracking method and device, storage medium and laser ranging device
CN112099028A