Binocular camera calibration method and device, computing equipment and medium
By detecting the QR code corner points of the binocular camera and constructing the reprojection error objective function, combined with binocular ranging and random texture map inspection, the problems of cumbersome process and low efficiency in the binocular camera calibration method are solved, and high efficiency is achieved. , accurate calibration results and consistency.
Patent Information
- Application Number
- CN202410678497.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-10-01
AI Technical Summary
The existing binocular camera calibration method is cumbersome and inefficient, and lacks a standard calibration image acquisition method, making it difficult to guarantee the accuracy and consistency of the calibration results.
A binocular camera calibration method is used to obtain binocular original images of multiple target scenes, detect the QR code corners of the calibration board, initialize internal and external parameters, construct a reprojection error objective function, and use a robust kernel function Minimize the error, obtain the calibrated internal and external parameters, and use binocular ranging and random texture maps to check the results to ensure the accuracy and consistency of the calibration results.
It realizes the automated binocular camera calibration process, switches the calibration in different directions in real time, and completes the calibration efficiently. It provides a standardized calibration plate positioning method to ensure the accuracy and consistency of each calibration, and through integrated calibration and The inspection process improves the accuracy of the results.
Smart Images

Figure CN118736018A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a calibration method, device, computing equipment and medium for a binocular camera. Background Art
[0002] Autonomous obstacle avoidance technology is one of the core technologies for autonomous flight of UAVs. It can plan the flight trajectory in real time according to the flight mission information and obstacle information during the flight, so that the UAV can avoid obstacles in the environment while completing the flight mission. Autonomous obstacle avoidance technology can not only greatly reduce the losses caused by operational errors, but also is a basic technology that UAVs must have when completing certain automatic flight missions (such as automatic inspections, etc.). It is one of the key technologies that are essential for realizing the automation or intelligence of UAVs.
[0003] Binocular vision sensors have the advantages of low cost, large perception range, high perception accuracy, and flexible layout, and are more suitable for light-load platforms such as drones. In order to ensure the normal operation of visual obstacle avoidance, fast and accurate binocular positioning technology is the basic core work. The current calibration method requires offline image acquisition, manual calibration, and finally manual upload. The entire calibration process is cumbersome and inefficient. In addition, the current calibration method lacks a set of standard calibration image acquisition methods, and cannot guarantee the accuracy and consistency of each calibration. Summary of the invention
[0004] In view of the above analysis, the embodiments of the present invention aim to provide a binocular camera calibration method, apparatus, computing device and medium to solve the problems of cumbersome procedures and low efficiency of existing calibration methods.
[0005] On the one hand, an embodiment of the present invention provides a binocular camera calibration method, comprising the following steps:
[0006] Acquire binocular original images of multiple target scenes collected by the movable object using the binocular camera, wherein the multiple target scenes include calibration plates placed in different positions;
[0007] In response to the number of the binocular original images satisfying a threshold range, the binocular camera is calibrated using a target calibration algorithm, wherein the target calibration algorithm comprises the following steps:
[0008] Detecting the coordinates of the corner points of the QR code of the calibration plate in the binocular original image;
[0009] Initializing the internal parameters of the binocular camera;
[0010] Initialize the external parameters of the binocular camera corresponding to the binocular original image;
[0011] According to the internal parameters and external parameters of the binocular camera and the coordinates of the corner points of the two-dimensional code, a reprojection error objective function is constructed and minimized, and the internal parameters and external parameters corresponding to the minimization of the reprojection error objective function are obtained as the internal parameters and external parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
[0012] Based on the further improvement of the above method, the calibration method further includes:
[0013] Acquire a depth map of a test scene determined by a movable object according to a calibration result of the binocular camera;
[0014] Obtaining a real distance between the binocular camera and a target object in the test scene measured by a laser rangefinder; and
[0015] A verification result of a calibration result of the binocular camera is determined according to an error between the depth information of the target object in the depth map and the actual distance.
[0016] Based on a further improvement of the above method, the test scene includes a random texture map, the real distance is the distance between the random texture map in the test scene and the binocular camera, and according to the error between the depth map and the real distance, determining the inspection result of the calibration result of the binocular camera includes:
[0017] It is determined whether the error between the center point distance of the random texture image in the depth map and the true distance is less than a preset threshold. If so, the calibration result of the binocular camera is correct; otherwise, the calibration result of the binocular camera is wrong.
[0018] Based on the further improvement of the above method, the placement posture of the calibration plate includes:
[0019] At a position where the calibration plate is separated from the binocular camera by a first distance, the calibration plate is placed flat at the upper left, upper right, middle, lower left, and upper right positions in the target scene respectively;
[0020] At a position where the calibration plate is separated from the binocular camera by a first distance, the calibration plate is tiltedly placed at the upper left, upper right, middle, lower left, and upper right positions in the target scene respectively;
[0021] At a position where the calibration plate is separated from the binocular camera by a second distance, the calibration plate is placed flat at the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions in the target scene respectively;
[0022] At a position where the calibration plate is separated from the binocular camera by a second distance, the calibration plate is tiltedly placed at the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions in the target scene respectively;
[0023] Wherein, the first distance is smaller than the second distance.
[0024] Based on the further improvement of the above method, the binocular camera is a binocular camera in multiple directions, and in the multiple target scenes for the binocular camera in each direction, the placement posture of the calibration plate is the same.
[0025] Based on the further improvement of the above method, the robust kernel function is:
[0026]
[0027] Among them, e i is the reprojection error, and δ is the error threshold.
[0028] Based on the further improvement of the above method, the calibration method further includes:
[0029] Acquire a binocular original image of a test scene captured by the movable object using the binocular camera;
[0030] Obtaining a rectified image of a movable object to an original binocular image of the test scene;
[0031] The depth map is depth information of the correction map, and the center point of the correction map coincides with the center point of the random texture map.
[0032] On the other hand, an embodiment of the present invention provides a calibration device for a binocular camera, wherein the binocular camera is disposed on a movable object, and the calibration device communicates with the movable object through a robot operating system topic, and the calibration device includes:
[0033] An acquisition module, used for acquiring, from the movable object, binocular original images of a plurality of target scenes collected by the movable object using the binocular camera, wherein the plurality of target scenes include calibration plates placed in different positions;
[0034] A calibration module is used for calibrating the binocular camera using a target calibration algorithm in response to the number of the binocular original images satisfying a threshold range, wherein the target calibration algorithm comprises the following steps:
[0035] Detect the corner points of the QR code of the calibration plate in the binocular original image;
[0036] Initialize the internal parameters of the binocular camera;
[0037] Initialize the external parameters of the binocular camera corresponding to the binocular original image;
[0038] According to the coordinates of the corner points of the two-dimensional code in the binocular original image and their corresponding three-dimensional coordinates, a reprojection error objective function is constructed and minimized, and the corresponding internal parameters and external parameters when the reprojection error objective function is minimized are obtained as the internal parameters and external parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
[0039] On the other hand, an embodiment of the present invention provides a binocular camera calibration system, including:
[0040] A movable object provided with a binocular camera, wherein the movable object is used to collect binocular original images of multiple target scenes using the binocular camera, wherein the multiple target scenes include calibration plates placed in different positions;
[0041] A computing device, wherein the computing device communicates with the movable object by way of a robot operating system topic, the computing device comprising:
[0042] one or more processors;
[0043] A storage device for storing one or more programs;
[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the binocular camera calibration methods.
[0045] On the other hand, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, any of the above-described binocular camera calibration methods is implemented.
[0046] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0047] 1. The embodiment of the present invention provides an automated binocular camera calibration process, which can switch binocular cameras in different directions in real time and efficiently complete the calibration of the binocular camera.
[0048] 2. The embodiment of the present invention provides a set of standardized calibration plate placement methods to ensure the accuracy and consistency of each calibration result.
[0049] 3. The embodiment of the present invention adopts a binocular ranging method to quantitatively test the accuracy of binocular calibration results, thereby realizing the integrated processing of the calibration process and the inspection process.
[0050] 4. The method for checking the calibration result provided by the embodiment of the present invention uses a random texture map as the ranging background, thereby avoiding the influence of scene differences on binocular ranging.
[0051] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0053] Figure 1 An exemplary system architecture that can be applied to the calibration method of a binocular camera provided in an embodiment of the present invention is shown.
[0054] Figure 2 The figure is a flow chart of a binocular camera calibration method according to an embodiment of the present invention.
[0055] Figure 3 An example of a target scene according to an embodiment of the present invention is shown.
[0056] Figure 4 An example of a depth map according to an embodiment of the present invention is shown.
[0057] Figure 5 An example of a random texture map according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0058] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0059] Figure 1 An exemplary system architecture that can be applied to the calibration method of the binocular camera provided in the embodiment of the present invention is shown. Figure 1 As shown, the system architecture may include a computing device 101, a network 102, and a movable object 103. The network 102 is used to provide a medium for a communication link between the computing device 101 and the movable object 103. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc. The movable object 103 may include a drone, an unmanned airship, an unmanned vehicle, or an unmanned ship, etc.
[0060] The computing device 101 interacts with the movable object 103 through the network 102 to receive or send messages, etc. Various client applications, such as automatic calibration software, can be installed on the computing device 101. The computing device 101 can be hardware or software. When the computing device 101 is hardware, it can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the computing device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0061] The movable object 103 may be provided with a binocular camera. The movable object 103 may use the binocular camera to shoot a scene and generate a binocular original image. The movable object 103 may correct the binocular original image and generate a required corrected image. The movable object 103 may also generate a depth map based on the calibration of the binocular camera and using a binocular ranging block matching algorithm. The movable object 103 may upload the double-sided original image, the corrected image, and the depth map to the computing device 101 by means of a robot operating system topic.
[0062] It should be noted that the binocular camera calibration method provided in the embodiment of the present application is generally executed by the computing device 101 , and accordingly, the binocular camera calibration device is generally provided in the computing device 101 .
[0063] It should be understood that Figure 1 The number of computing devices, networks, and movable objects in the embodiment is only for illustration. Any number of computing devices, networks, and movable objects may be provided as required.
[0064] Figure 2 The figure is a flow chart of a binocular camera calibration method according to an embodiment of the present invention.
[0065] Combine the following Figure 2 An embodiment of the present invention will be described.
[0066] like Figure 1 As shown, the calibration method of the binocular camera includes:
[0067] Step 201: obtaining binocular original images of a plurality of target scenes captured by the movable object using the binocular camera.
[0068] In this embodiment, each target scene includes a calibration plate placed in a certain posture, and the placement postures of the calibration plates in each target scene are different.
[0069] Figure 3An example of a target scene according to an embodiment of the present invention is shown. Figure 3 As shown in the figure, in this target scene, a worker holds a calibration plate, the distance between the calibration plate and the binocular camera is 0.5 meters, and the calibration plate is placed flat. That is, Figure 3 The calibration plate is placed in the following position: It is placed horizontally at a distance of 0.5 meters from the binocular camera.
[0070] In this embodiment, each binocular original image corresponds to a target scene, and the placement positions of the calibration plates in each binocular original image are different. In this embodiment, a binocular original image refers to two images taken by a binocular camera of the same target scene. For example, the left eye image is taken by the left eye camera, and the right eye image is taken by the right eye camera. The left eye image and the right eye image together constitute a binocular original image.
[0071] In this embodiment, if Figure 3 As shown, each time the worker changes the placement of the calibration plate, the movable object can collect a binocular original image. To this end, a threshold range of the number of binocular original images to be collected can be pre-set, and when the number of binocular original images obtained reaches the threshold range, the next step is entered. Exemplarily, the threshold range can be equal to 28 images.
[0072] In this embodiment, the binocular original image can be obtained from the movable object by means of the robot operating system topic. The Robot Operating System (ROS) is an open source framework for writing robot software. It provides a series of tools and libraries to help researchers and developers create complex and robust robot applications. The basic working principle of ROS is a message passing mechanism based on the publish / subscribe model. Nodes (such as Figure 1 The movable objects in the can publish messages to the topic, and other nodes (such as Figure 1 Computing devices in the network can subscribe to these topics to receive messages. Publishers (such as Figure 1 movable objects in ) and subscribers such as Figure 1 The computing devices in the network are loosely coupled and can run in a distributed system without knowing each other’s implementation details. Figure 1 When a movable object in a topic publishes a message to the topic, all nodes subscribing to the topic (such as Figure 1 The computing device in the network will receive the message. This message transmission mechanism enables flexible communication and data sharing between nodes.
[0073] Step 202: In response to the number of the binocular original images satisfying a threshold range, calibrate the binocular camera using a target calibration algorithm.
[0074] In this embodiment, the target calibration algorithm includes the following steps:
[0075] Step S10: Detecting the coordinates of the corner points of the two-dimensional code of the calibration plate in the binocular original image.
[0076] Step S20: Initialize the internal parameters of the binocular camera.
[0077] Step S30: Initialize the external parameters of the binocular camera corresponding to the binocular original image.
[0078] Step S40: According to the internal parameters and external parameters of the binocular camera and the coordinates of the corner points of the two-dimensional code, a reprojection error objective function is constructed and minimized, and the internal parameters and external parameters corresponding to the minimization of the reprojection error objective function are obtained as the internal parameters and external parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
[0079] In step S10, for each pair of binocular original images, the April tag two-dimensional code detection method can be used to detect multiple two-dimensional codes on the calibration plate in the binocular original images. Then, the coordinates of the corner points of each two-dimensional code can be extracted. Figure 3 As shown in the figure, the corner points of the QR code refer to the black boxes at the four vertices of the QR code. The coordinates of the corner points of the QR code refer to the pixel coordinates of the corner points of the QR code. For example, if the coordinates of the corner points of the QR code are (10,10), then the coordinates indicate that the corner points of the QR code are located at the 10th pixel on the X-axis and the 10th pixel on the Y-axis of the image.
[0080] In step S20, the internal parameters of the binocular camera may include the focal length of the camera and the image coordinates of the camera center point.
[0081] In step S30, the external parameters of the binocular camera may include the camera pose. Specifically, the three-dimensional coordinates of the corner points of the QR code can be calculated by knowing the size of the calibration plate (for example, 40cm×40cm). For example, the size of the calibration plate is known, and the center point of the calibration plate is used as the coordinate origin. The x-axis and y-axis are on the calibration plate, and the z-axis is perpendicular to the calibration plate to define the coordinate system, and the three-dimensional coordinates of each corner point of the QR code can be obtained. At the same time, the internal parameters of the binocular camera determined in step S20 and the coordinates of the corner points of the QR code on each image are known, and the PnP algorithm (Perspective-n-Point) can be used to calculate the camera pose. The PnP algorithm is a method for solving 3D to 2D point pair motion. It describes how to estimate the pose of the camera when we know n 3D space points and their projection positions.
[0082] In step S40, the three-dimensional coordinates of the corner points of the two-dimensional code are known (obtained in step S30), and the three-dimensional coordinates of the corner points of the two-dimensional code can be projected onto the plane where the binocular original image is located to obtain the expected coordinates of the corner points of the two-dimensional code. Specifically, the three-dimensional coordinates of the corner points of the two-dimensional code are known to be The expected coordinates of the corner points of the QR code can be obtained by using the following projection function:
[0083]
[0084] Among them, the internal reference is: The rotation component in the external parameter is: The translation component in the external parameter is: Afterwards, the expected coordinates of the corner points of the two-dimensional code and the coordinates of the corner points of the two-dimensional code obtained in step S10 are subtracted to obtain the reprojection error. Finally, the reprojection errors of all images are summed to obtain the reprojection error objective function, and the reprojection error objective function is optimized to obtain the optimized internal and external parameters of the binocular camera. The optimized internal and external parameters of the binocular camera are the calibration results in the present invention. The optimization problem of the reprojection error objective function is a least squares optimization problem, which can be optimized by the Gauss-Newton iterative optimization method. Since the Gauss-Newton iterative optimization method is an existing optimization method, it will not be repeated here.
[0085] It should be noted that since the corner features are affected by factors such as illumination and image quality, erroneous feature points are introduced. These erroneous feature points will affect the convergence of the objective function. In order to avoid the negative impact of erroneous feature points, this embodiment proposes to introduce a robust kernel function in the optimization process using the least squares method. The robust kernel function is a method for statistical analysis, mainly used to process data sets containing outliers. Its basic idea is to replace the original two-norm measurement of the error with a function that does not grow so fast while ensuring its own smooth properties. In this way, even if there are outliers, a relatively stable statistical inference can be obtained. In this embodiment, by introducing a robust kernel function, the maximum value of the objective function gradient can be limited, reducing the impact of large error items on the optimization process.
[0086] In some embodiments, the robust kernel function is:
[0087]
[0088] Among them, e i is the reprojection error, and δ is the error threshold. It can be seen that when the reprojection error e i When it is greater than a certain threshold δ, the function growth changes from a quadratic form to a linear form, which is equivalent to limiting the maximum value of the gradient and reducing the impact of large error terms on optimization.
[0089] In some embodiments, the binocular camera in the above embodiments is a binocular camera in multiple directions, such as a six-way binocular camera. The following takes a six-way binocular camera as an example to illustrate the calibration method of a multi-directional binocular camera in an embodiment of the present invention.
[0090] First, the computing device 101 and the movable object 103 are connected via the network 102. For example, the computing device 101 and the movable object 103 may be set in the same local area network.
[0091] Secondly, the client on the computing device 101 can select a binocular camera in a certain direction, such as a forward-looking binocular camera. It should be noted that the six-directional binocular camera includes a forward-looking binocular camera, a rear-looking binocular camera, a left-looking binocular camera, a right-looking binocular camera, an upward-looking binocular camera, and a downward-looking binocular camera.
[0092] Afterwards, after the movable object receives the calibration instruction for the forward-looking binocular camera, it can use the forward-looking binocular camera to shoot the target scene, and send the obtained binocular original image to the computing device 101. After the computing device 101 obtains the corresponding forward-looking binocular original image, it can be displayed on the screen of the computing device 101.
[0093] Afterwards, the worker can move the calibration plate to different locations to obtain different target scenes and repeat the above steps until a sufficient number of binocular original images are obtained.
[0094] Then the target calibration algorithm described above can be used to calibrate the forward-looking binocular camera. After completing the calibration of the forward-looking binocular camera, the above steps can be repeated until the calibration of the binocular cameras in other directions is completed.
[0095] It should be noted that in the process of calibrating the binocular cameras in various directions, the placement of the calibration plate in the target scene used is the same. For example, in the process of calibrating the forward-looking binocular camera, the placement of the calibration plate in each target scene is:
[0096] Place the calibration plate 0.5 meters away from the binocular camera at the upper left, upper right, middle, lower left, and upper right positions of the target scene;
[0097] Place the calibration board at an angle of 0.5 meters between the calibration board and the binocular camera at the upper left, upper right, middle, lower left, and upper right positions of the target scene;
[0098] Place the calibration plate 0.9 meters away from the binocular camera in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right of the target scene.
[0099] With the calibration plate 0.9 meters away from the binocular camera, place the calibration plate at an angle in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions of the target scene.
[0100] Similarly, during the calibration of the rear-view binocular camera, the placement of the calibration plate in each target scene is also:
[0101] Place the calibration plate 0.5 meters away from the binocular camera at the upper left, upper right, middle, lower left, and upper right positions of the target scene;
[0102] Place the calibration board at an angle of 0.5 meters between the calibration board and the binocular camera at the upper left, upper right, middle, lower left, and upper right positions of the target scene;
[0103] Place the calibration plate 0.9 meters away from the binocular camera in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right of the target scene.
[0104] With the calibration plate 0.9 meters away from the binocular camera, place the calibration plate at an angle in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions of the target scene.
[0105] In some embodiments, during the process of calibrating the binocular cameras in various directions, the placement of the calibration plate in the target scene is performed in the following manner:
[0106] 1. Close distance: The width of the calibration plate accounts for about 65% of the image width (for example, the calibration plate is about 0.5 meters away from the camera). The calibration plate is placed flat at the upper left, upper right, middle, lower left, and upper right positions in the target scene; the calibration plate is placed tilted at the upper left, upper right, middle, lower left, and upper right positions in the target scene.
[0107] 2. Long distance: The width of the calibration plate accounts for about 33% of the image width (for example, the calibration plate is about 0.9 meters away from the camera). The calibration plate is placed flat in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right of the target scene; the calibration plate is placed tilted in the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right of the target scene.
[0108] The embodiment of the present invention provides a specific and standard method for collecting calibration plate images. When calibrating each movable object and binocular camera in each direction, the calibration plate adopts the same placement method. The embodiment of the present invention can ensure that the calibration results of each movable object and binocular camera in each direction have good accuracy and consistency through a standard and efficient calibration image acquisition method.
[0109] In some embodiments, Figure 2 The calibration method of the binocular camera in also includes the following steps:
[0110] Step S110: obtaining a depth map of a test scene determined by the movable object according to a calibration result of the binocular camera.
[0111] In this embodiment, a binocular ranging block matching algorithm may be used to calculate the depth map of the test scene. Figure 4 An example of a depth map according to an embodiment of the present invention is shown. Figure 4 As shown in FIG. 1 , the movable object can first use a binocular camera to collect the binocular original image of the test scene, and then use the binocular ranging algorithm to calculate the depth information of the binocular original image, thereby obtaining a depth map of the test scene. It should be noted that the binocular original image is two images. Figure 4 Only the original image and its depth map of one of the images are shown. It should be noted that the calibration result of the binocular camera is required when using the binocular ranging algorithm to calculate the depth information of the binocular original image.
[0112] Step S120: obtaining the actual distance between the binocular camera and the target object in the test scene measured by using a laser rangefinder.
[0113] In this embodiment, a laser rangefinder can be used to measure the actual distance between the binocular camera and an object at any position in the test scene. Figure 4 In the test scene shown, a laser rangefinder can be used to measure the actual distance between the stereo camera and the pillar located at the center of the scene.
[0114] Step S130: determining a verification result of a calibration result of the binocular camera according to an error between the depth map and the actual distance.
[0115] In this embodiment, the distance information of the target object in the test scene in the depth map and the actual distance between the target object and the binocular camera can be compared, and the error between the two can be calculated. If the calculated error is less than a preset threshold, it is considered that the calibration result determined according to step 201 to step 202 is correct, otherwise it is wrong.
[0116] In some embodiments, the test scene may include a random texture map, and the actual distance measured according to step S120 is the distance between the random texture map in the test scene and the binocular camera, and step S130 includes:
[0117] It is determined whether the error between the center point distance of the random texture image in the depth map (i.e., the center point depth value) and the actual distance is less than a preset threshold. If so, the calibration result of the binocular camera is correct, otherwise, the calibration result of the binocular camera is wrong. Figure 5 An example of a random texture map according to an embodiment of the present invention is shown. Since the random texture map provides rich random textures and has rich multi-scale texture features, the influence of different test scenes on binocular ranging can be avoided by using the random texture map as the ranging background.
[0118] In some embodiments, during the process of verifying the calibration result of the binocular camera, Figure 2 The calibration method of the binocular camera in also includes the following steps:
[0119] Step S111: obtaining a binocular original image of a test scene captured by the movable object using the binocular camera.
[0120] Step S222: obtaining a rectified image of the movable object for the binocular original image of the test scene.
[0121] In this embodiment, after the movable object 103 collects the binocular original image of the test scene, it can correct the binocular original image so that the target object (such as a random texture image) in the test scene is located at the center of the image. Afterwards, the movable object 103 can use the binocular ranging block matching algorithm to calculate the depth map of the corrected image. The depth map is the depth information of the corrected image, and the center point of the corrected image coincides with the center point of the random texture image. Finally, the calibration results of the binocular camera are checked according to steps S120 and S130 described above.
[0122] On the other hand, an embodiment of the present invention provides a calibration device for a binocular camera, wherein the binocular camera is disposed on a movable object, and the calibration device communicates with the movable object through a robot operating system topic, and the calibration device includes:
[0123] An acquisition module, used for acquiring, from the movable object, binocular original images of a plurality of target scenes collected by the movable object using the binocular camera, wherein the plurality of target scenes include calibration plates placed in different positions;
[0124] A calibration module is used for calibrating the binocular camera using a target calibration algorithm in response to the number of the binocular original images satisfying a threshold range, wherein the target calibration algorithm comprises the following steps:
[0125] Detecting the coordinates of the corner points of the QR code of the calibration plate in the binocular original image;
[0126] Initializing the internal parameters of the binocular camera;
[0127] Initialize the external parameters of the binocular camera corresponding to the binocular original image;
[0128] According to the internal parameters and external parameters of the binocular camera and the coordinates of the corner points of the two-dimensional code, a reprojection error objective function is constructed and minimized, and the internal parameters and external parameters corresponding to the minimization of the reprojection error objective function are obtained as the internal parameters and external parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
[0129] The binocular camera calibration device provided in the embodiment of the present invention can execute the binocular camera calibration method provided in any embodiment, and has the corresponding functional modules and beneficial effects of the execution method.
[0130] On the other hand, an embodiment of the present invention provides a binocular camera calibration system, including:
[0131] A movable object provided with a binocular camera, wherein the movable object is used to collect binocular original images of multiple target scenes using the binocular camera, wherein the multiple target scenes include calibration plates placed in different positions;
[0132] A computing device, wherein the computing device communicates with the movable object by way of a robot operating system topic, the computing device comprising:
[0133] one or more processors;
[0134] A storage device for storing one or more programs;
[0135] When the one or more programs are executed by the one or more processors, the one or more processors implement any binocular camera calibration method described above.
[0136] The processor in the binocular camera calibration system provided in the embodiment of the present invention can execute the binocular camera calibration method provided in any embodiment, and has the corresponding beneficial effects of the execution method.
[0137] On the other hand, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the calibration method of any binocular camera described above is implemented.
[0138] Compared with the prior art, the embodiments of the present invention can achieve at least one of the following beneficial effects:
[0139] 1. The embodiment of the present invention provides an automated binocular camera calibration process, which can switch binocular cameras in different directions in real time and efficiently complete the calibration of the binocular camera.
[0140] 2. The embodiment of the present invention provides a set of standardized calibration plate placement methods to ensure the accuracy and consistency of each calibration result.
[0141] 3. The embodiment of the present invention adopts a binocular ranging method to quantitatively test the accuracy of binocular calibration results, thereby realizing the integrated processing of the calibration process and the inspection process.
[0142] 4. The method for checking the calibration result provided by the embodiment of the present invention uses a random texture map as the ranging background, thereby avoiding the influence of scene differences on binocular ranging.
[0143] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for calibrating a binocular camera, wherein the binocular camera is arranged on a movable object, characterized in that: The steps include: Acquire binocular original images of multiple target scenes collected by the movable object using the binocular camera, wherein the multiple target scenes include calibration plates placed in different positions; In response to the number of the binocular original images satisfying a threshold range, the binocular camera is calibrated using a target calibration algorithm, wherein the target calibration algorithm comprises the following steps: Detecting the coordinates of the corner points of the QR code of the calibration plate in the binocular original image; Initializing the internal parameters of the binocular camera; Initialize the external parameters of the binocular camera corresponding to the binocular original image; According to the intrinsic parameters and extrinsic parameters of the binocular camera and the coordinates of the corner points of the two-dimensional code, a reprojection error objective function is constructed and minimized, and the intrinsic parameters and extrinsic parameters corresponding to the minimization of the reprojection error objective function are obtained as the intrinsic parameters and extrinsic parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
2. The calibration method according to claim 1, characterized in that: Also includes: Acquire a depth map of a test scene determined by a movable object according to a calibration result of the binocular camera; Obtaining a real distance between the binocular camera and a target object in the test scene measured by a laser rangefinder; as well as A verification result of a calibration result of the binocular camera is determined according to an error between the depth information of the target object in the depth map and the actual distance.
3. The calibration method according to claim 2, characterized in that: The test scene includes a random texture map, the real distance is a distance between the random texture map in the test scene and the binocular camera, and according to an error between depth information of a target object in the depth map and the real distance, determining a test result of a calibration result of the binocular camera includes: It is determined whether the error between the center point distance of the random texture image in the depth map and the true distance is less than a preset threshold. If so, the calibration result of the binocular camera is correct; otherwise, the calibration result of the binocular camera is wrong.
4. The calibration method according to claim 1, characterized in that: The placement of the calibration plate includes: At a position where the calibration plate is separated from the binocular camera by a first distance, the calibration plate is placed flat at the upper left, upper right, middle, lower left, and upper right positions in the target scene respectively; At a position where the calibration plate is separated from the binocular camera by a first distance, the calibration plate is tiltedly placed at the upper left, upper right, middle, lower left, and upper right positions in the target scene respectively; At a position where the calibration plate is separated from the binocular camera by a second distance, the calibration plate is placed flat at the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions in the target scene respectively; At a position where the calibration plate is separated from the binocular camera by a second distance, the calibration plate is tiltedly placed at the middle, top, bottom, left, right, upper left, upper right, lower left, and lower right positions in the target scene respectively; Wherein, the first distance is smaller than the second distance.
5. The calibration method according to claim 4, characterized in that: The binocular camera is a binocular camera in multiple directions, and in the multiple target scenes for the binocular camera in each direction, the placement posture of the calibration plate is the same.
6. The calibration method according to claim 1, characterized in that: The robust kernel function is: Among them, e i is the reprojection error, and δ is the error threshold.
7. The calibration method according to claim 3, characterized in that: Also includes: Acquire a binocular original image of a test scene captured by the movable object using the binocular camera; Obtaining a rectified image of a movable object to an original binocular image of the test scene; The depth map is depth information of the correction map, and the center point of the correction map coincides with the center point of the random texture map.
8. A binocular camera calibration device, wherein the binocular camera is arranged on a movable object, and the calibration device communicates with the movable object through a robot operating system topic, and the calibration device comprises: An acquisition module, used for acquiring, from the movable object, binocular original images of a plurality of target scenes collected by the movable object using the binocular camera, wherein the plurality of target scenes include calibration plates placed in different positions; A calibration module is used for calibrating the binocular camera using a target calibration algorithm in response to the number of the binocular original images satisfying a threshold range, wherein the target calibration algorithm comprises the following steps: Detect the corner points of the QR code of the calibration plate in the binocular original image; Initializing the internal parameters of the binocular camera; Initialize the external parameters of the binocular camera corresponding to the binocular original image; According to the coordinates of the corner points of the two-dimensional code in the binocular original image and their corresponding three-dimensional coordinates, a reprojection error objective function is constructed and minimized, and the corresponding internal parameters and external parameters when the reprojection error objective function is minimized are obtained as the internal parameters and external parameters of the calibrated binocular camera, wherein the reprojection error satisfies the robust kernel function.
9. A binocular camera calibration system, characterized in that: include: A movable object provided with a binocular camera, wherein the movable object is used to collect binocular original images of multiple target scenes using the binocular camera, wherein the multiple target scenes include calibration plates placed in different positions; A computing device, wherein the computing device communicates with the movable object by way of a robot operating system topic, the computing device comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the binocular camera calibration method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the binocular camera calibration method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Self-supervised end-to-end visual reconstruction method and system
CN120182503A
