Depth camera error calculation method
By using two parallel calibration plates and depth cameras, combined with the SVD algorithm, the problem of frequent manual calibration in the prior art is solved, and the automated error calibration of orbital robots is realized.
Patent Information
- Application Number
- CN202510283634.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-11
AI Technical Summary
The existing depth camera error calibration methods require frequent manual calibration and are not suitable for automated applications of orbital robots.
Two parallel calibration plates and depth cameras are used to calculate the difference between the depth value and the real distance between the parallel plates and the SVD algorithm, and fit the plane equations, the depth camera error is automatically calculated.
It realizes automatic calculation of depth camera errors without manual calibration, saving labor, and is suitable for orbital robot applications.
Smart Images

Figure CN120298504A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera error calculation, and more specifically, to a method for calculating the error of a depth camera. Background Art
[0002] In the fields of computer vision, image processing, and 3D reconstruction, depth cameras are an important tool. Depth cameras can obtain the depth information of objects, thereby constructing 3D models of the objects. In the intelligent aquaculture industry, depth cameras can be used to obtain the backfat thickness and body weight of pigs. However, the accuracy of depth cameras is affected by various factors, one of which is that the distance from the depth camera to the object being measured will deviate over time. Therefore, how to accurately measure this deviation is an important issue.
[0003] Existing solutions mainly involve calibrating depth cameras using calibration plates. A calibration plate is usually a flat surface with some marked points of known height. By calculating the difference between the depth values obtained when the depth camera captures these marked points and the known height, the error of the depth camera can be obtained. The disadvantage of this method is that it is not conducive to the use of rail robots, and calibration needs to be performed manually at regular intervals, which is not conducive to practical applications and operations. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for calculating the error of a depth camera to solve the problem of being not conducive to the use of rail robots and the need for manual calibration at regular intervals as mentioned in the above background art.
[0005] To achieve the above purpose, the present invention provides a method for calculating the error of a depth camera, including the following steps:
[0006] S1. Fix a trolley equipped with a depth camera on a track. There are two calibration plates installed directly below the track. Each calibration plate has a length and width of 250 mm and 200 mm respectively, and the physical height difference between the two calibration plates is 50 mm. The planes of the two calibration plates are parallel to the horizontal plane.
[0007] S2. Obtain the depth values of the two parallel planes respectively. Use the depth camera to capture the two parallel plates and obtain the height values of the two parallel plates.
[0008] S3. Calculate the difference between the depth value and the actual distance.
[0009] S4. Consider random errors.
[0010] As a further improvement of this technical solution, in step S1, it is necessary to adjust the parameters of the depth camera so that it can accurately obtain the depth values of the two parallel plates.
[0011] As a further improvement of this technical solution, the specific operation steps for obtaining the depth values of two parallel planes in step S2 are as follows:
[0012] S21. Run the depth camera capture program, set the capture time, and the Intel D400 will generate a file of bag type. The bag file can be split into grayscale images and depth images;
[0013] S22. Train a target detection network with the grayscale images to detect two calibration plate targets. Use the yolov8 network to implement it and obtain the region boxes of the two planes;
[0014] S23. Obtain the depth point clouds of the two parallel planes in the corresponding depth image regions. Use the SVD algorithm to fit the depth point clouds of the two planes into two planes;
[0015] S24. Approximately calculate the distance d between the two planes according to the distance formula of the parallel planes, that is, the height difference between the two parallel plates measured by the depth camera.
[0016] As a further improvement of this technical solution, the capture time set when running the depth camera capture program in step S21 is 2s.
[0017] As a further improvement of this technical solution, when using the SVD algorithm to fit the depth point clouds of the two planes into two planes in step S23, mark them as: A1X + B1Y + C1Z + D1 = 0, A2X + B2Y + C2Z + D2 = 0.
[0018] As a further improvement of this technical solution, the specific operation method for calculating the difference between the depth value and the real distance in step S3 is: compare the obtained depth value with the real distance between the two parallel plates and calculate the difference between the two.
[0019] As a further improvement of this technical solution, the specific operation method for considering the random error in step S4 is: photograph the two parallel plates multiple times, calculate the difference between the depth value obtained each time and the real distance, and the random error of the depth camera can be obtained by statistically analyzing the distribution of these differences, that is, repeat step S2 and step S3, and record the difference between the depth value obtained each time and the real distance.
[0020] As a further improvement of this technical solution, a total of 5 times of shooting are carried out when repeating step S2 and step S3.
[0021] Compared with the prior art, the beneficial effects of the present invention are:
[0022] 1. In the present invention, it is possible to install two parallel calibration plates, set the program so that the rail robot runs above the calibration plates, and collect some bag files for calculation, saving labor.
[0023] 2. In the present invention, the camera error is calculated by calculating the difference between the distance between two parallel calibration plates and the true distance, and the plane equation is obtained by fitting the plane equation through obtaining the depth point cloud of the two calibration plate planes. After obtaining the point cloud, the SVD is used to fit the plane equation, and the distance between the two planes is calculated according to the distance formula of parallel planes. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart of the calculation method for the depth camera error of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0026] In a specific embodiment, as Figure 1 shown, the present invention provides a method for calculating the depth camera error. In this embodiment, a depth camera and two parallel plates are used to calculate the height difference. The depth camera model is Intel D400. The process is as shown in the attached Figure 1 figures, and the steps are as follows:
[0027] Step 1: Fix the trolley equipped with the depth camera on a track, and two calibration plates are installed directly below the track. The length and width of each calibration plate are 250 mm and 200 mm respectively, and the physical height difference between the two calibration plates is 50 mm. The planes of the two calibration plates are parallel to the horizontal plane. Adjust the parameters of the depth camera so that it can accurately obtain the depth values of the two parallel plates.
[0028] Step 2: Obtain the depth values of the two parallel planes respectively. Use a depth camera to capture two parallel plates and obtain the height values of the two parallel plates. Specifically, run the depth camera capture program, set the capture time for one time to 2s, and the Intel D400 will generate a bag - type file. The bag file can be split into grayscale images and depth maps. First, train an object detection network with the grayscale images to detect the two calibration plate targets. We use the yolov8 network to achieve this. After obtaining the region bounding boxes of the two planes, obtain the depth point clouds of the two parallel planes in the corresponding depth map regions. Use the SVD algorithm to fit the depth point clouds of the two planes into two planes, which are respectively denoted as: A1X + B1Y + C1Z + D1 = 0, A2X + B2Y + C2Z + D2 = 0. Since the two calibration plate planes are physically parallel, we can approximately calculate the distance d between the two planes according to the distance formula of parallel planes. This d is the height difference between the two parallel plates measured by the depth camera.
[0029] Step 3: Calculate the difference between the depth value and the true distance. Compare the obtained depth value with the true distance between the two parallel plates and calculate the difference between the two.
[0030] Step 4: Consider the random error. Capture the two parallel plates multiple times and calculate the difference between the depth value obtained each time and the true distance. By statistically analyzing the distribution of these differences, the random error of the depth camera can be obtained. Specifically, repeat Steps 2 and 3, capture 5 times in total, and record the difference between the depth value obtained each time and the true distance.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] The existing technology uses a single calibration plate to measure the error of the depth camera. It is necessary to set the distance from the calibration plate to the camera in advance, and then use the depth camera to measure and compare. Each time, manual operation is required. The technical operation of this patent can achieve installing two parallel calibration plates, setting the program so that the rail robot runs above the calibration plates, and collecting some bag files for calculation, saving labor.
[0033] At the same time, the present invention proposes a method for measuring the error of a depth camera based on two parallel calibration plates, which is achieved by calculating the difference between the distance between the two parallel calibration plates and the true distance.
[0034] The present invention also proposes a method for obtaining the depth point clouds of the two calibration plate planes to fit the plane equation. After obtaining the point clouds, use SVD to fit the plane equation and calculate the distance between the two planes according to the distance formula of parallel planes.
[0035] The basic principles, main features and advantages of the present invention have been shown and described above. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and the descriptions in the specification are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of the present invention claimed is defined by the appended claims and their equivalents.
Claims
1. A method for calculating the depth camera error, characterized in that, It includes the following steps: S1. Fix a trolley equipped with a depth camera on an orbit. There are two calibration plates installed directly below the orbit. The length and width of each calibration plate are 250 mm and 200 mm respectively, and the physical height difference between the two calibration plates is 50 mm. The planes of the two calibration plates are both parallel to the horizontal plane; S2. Obtain the depth values of the two parallel planes respectively. Use the depth camera to photograph the two parallel plates and obtain the height values of the two parallel plates; S3. Calculate the difference between the depth value and the real distance; S4. Consider random errors.
2. The method for calculating the depth camera error according to claim 1, wherein In step S1, it is necessary to adjust the parameters of the depth camera so that it can accurately obtain the depth values of the two parallel plates.
3. The method for calculating the depth camera error according to claim 1, characterized in that, The specific operation steps for obtaining the depth values of the two parallel planes in step S2 are as follows: S21. Run the depth camera capture program and set the capture time. The Intel D400 will generate a bag-type file. The bag file can be split into grayscale images and depth images; S22. Train a target detection network with the grayscale images to detect the two calibration plate targets. Use the yolov8 network to implement it and obtain the region bounding boxes of the two planes; S23. Obtain the depth point clouds of the two parallel planes in the corresponding depth map regions. Use the SVD algorithm to fit the depth point clouds of the two planes into two planes; S24. Approximately calculate the distance d between the two planes according to the distance formula of the parallel planes, that is, the height difference between the two parallel plates measured by the depth camera.
4. The method for calculating the depth camera error according to claim 3, wherein The capture time set when running the depth camera capture program in step S21 is 2 s.
5. The calculation method of the depth camera error according to claim 1, characterized in that In step S23, when using the SVD algorithm to fit the depth point clouds of the two planes into two planes, mark them as: A1X + B1Y + C1Z + D1 = 0, A2X + B2Y + C2Z + D2 = 0.
6. The calculation method of the depth camera error according to claim 1, characterized in that, The specific operation method for calculating the difference between the depth value and the real distance in step S3 is: Compare the obtained depth value with the real distance between the two parallel plates and calculate the difference between the two.
7. The method for calculating the depth camera error according to claim 1, wherein The specific operation method for considering random errors in step S4 is: Photograph the two parallel plates multiple times and calculate the difference between the depth value obtained each time and the real distance. By statistically analyzing the distribution of these differences, the random error of the depth camera can be obtained, that is, repeat steps S2 and S3 and record the difference between the depth value and the real distance obtained each time.
8. The method for calculating the depth camera error according to claim 7, characterized in that, When repeating steps S2 and S3, a total of 5 shots are taken.