A depth map colorization method based on monocular depth camera
By using a monocular depth camera and a stereo matching algorithm in depth map colorization, the problems of low automation and inaccurate algorithms in the existing technology are solved, efficient depth map colorization is achieved, and depth map color texture information is given, improving display effect.
Patent Information
- Application Number
- CN202011620677.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Existing depth map colorization methods have problems such as low automation, inaccurate algorithms, and high time complexity, making it difficult to effectively convert depth maps into color maps for easy display.
A method based on a monocular depth camera is adopted, using an infrared camera, a color camera and an infrared speckle array projector. The disparity map is calculated through the stereo matching algorithm and the triangular ranging principle, and the depth map is obtained. The calibration parameters calculate the correspondence between the color image and the speckle image to achieve colorization of the depth map.
It achieves fully automated colorization of depth maps with high algorithm accuracy and low time complexity. It gives the depth map color texture information of the scene under test, improving the visualization effect of the display.
Smart Images

Figure CN112700484B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics, and in particular to a method for colorizing a depth map based on a monocular depth camera. Background Art
[0002] In computer vision systems, 3D scene information provides more possibilities for various computer vision applications such as image segmentation, target detection, and object tracking, and depth maps have been widely used as a universal way to express 3D scene information. The grayscale value of each pixel in a depth image can be used to represent the distance of a certain point in the scene from the camera.
[0003] A depth image, also known as a range image, refers to an image that uses the distance (depth) from the image collector to each point in the scene as the pixel value. It directly reflects the geometric shape of the visible surface of the scene.
[0004] The RGB color model is a color standard in the industry. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that human vision can perceive and is one of the most widely used color systems. RGB images are composed of a three-dimensional array in the format of M×N×3, where "3" can be understood as three M×N two-dimensional images (grayscale images). These three images represent the R, G, and B components respectively, and the pixel value range of each component is [0,255].
[0005] Since it is difficult for the human eye to identify objects and perceive depth changes in the depth map we obtain, visualization is often required when displaying. At this time, the depth map needs to be converted into a color map for display. Most of the existing depth map colorization methods have problems such as not being fully automated, the algorithm is not very accurate, and the time complexity is high. Summary of the invention
[0006] In order to simplify the existing depth map colorization method and improve its automation and accuracy, the present invention provides a depth map colorization method based on a monocular depth camera.
[0007] The technical solution of the present invention is as follows: A method for colorizing a depth map based on a monocular depth camera, comprising the following steps: Step 1. Using an infrared camera, a color camera and an infrared speckle array projector to form a miniaturized monocular depth camera, the infrared speckle array projector projects a random speckle pattern onto a measured scene, and the infrared camera and the color camera synchronously collect images;
[0008] Step 2. Use a stereo matching algorithm to calculate the disparity map between the speckle image captured by the infrared camera and the speckle image of a reference plane at a known distance, and obtain a depth map based on the principle of triangulation;
[0009] Step 3. According to the calibration parameters between the infrared camera and the color camera, the correspondence between the speckle image taken by the infrared camera and the color image taken by the color camera is calculated through the depth map, so as to realize the colorization of the depth map and give the depth map the color texture information of the measured scene.
[0010] Preferably, in step one, the infrared camera, the color camera and the infrared scattered spot array projector are all placed horizontally, and the three are on the same horizontal line. The distance between the infrared camera and the infrared scattered spot array projector is the farthest, and the color camera is located between the infrared camera and the infrared scattered spot array projector and close to the infrared camera.
[0011] Preferably, step 2 is specifically as follows:
[0012] First, an infrared camera is used to capture a speckle image of a reference plane at a known distance. Ref The acquired speckle image is called the reference image. Through the triangulation relationship, the reference disparity value d of the reference image can be calculated according to the following formula: Ref ,
[0013]
[0014] Wherein, B is the distance between the infrared camera and the infrared speckle array projector, and f is the focal length of the infrared camera;
[0015] Secondly, the speckle image of the scene being measured captured by the infrared camera is called the target image. For each valid matching point p(x, y) in the target image, the correct corresponding reference point p can be found in the reference image through the stereo matching algorithm. Ref (x Ref ,y Ref ), p(x,y) and p Ref (x Ref ,y Ref ) is,
[0016] (x,y)=(x Ref +d Rel ,y Ref ),
[0017] Among them, d Rel is the relative disparity value of the target image relative to the reference image;
[0018] Again, the actual disparity value d of each valid target point is obtained,
[0019] d=dRef +d Rel ;
[0020] Finally, after obtaining the disparity map with sub-pixel accuracy, the depth value Z can be obtained through triangulation.
[0021]
[0022] Preferably, in step three, the correspondence between the speckle image captured by the infrared camera and the color image captured by the color camera is calculated through the depth map according to the calibration parameters between the infrared camera and the color camera.
[0023]
[0024]
[0025] Among them, C x , C y 、M x 、M y 、N x and N y are the calibration parameters between the infrared camera and the color camera, respectively, (x c ,y c ) are the coordinates of the corresponding points on the color image.
[0026] The present invention has the following advantages: the present invention uses an infrared camera, a color camera and an infrared speckle array projector to form a miniaturized monocular depth camera, the infrared speckle array projector projects a random speckle pattern onto the scene to be measured, and the infrared camera and the color camera synchronously collect images; the corresponding relationship between the speckle image taken by the infrared camera and the color image taken by the color camera is calculated through the depth map, thereby realizing the colorization of the depth map and giving the depth map the color texture information of the scene to be measured. Compared with the existing depth map colorization method, the present invention has the advantages of full automation, accurate algorithm and low time complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The present invention is a flowchart of a method for colorizing a depth map based on a monocular depth camera in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] The present invention proposes a depth map colorization method based on a monocular depth camera, and the method includes the following three steps.
[0030] Step 1. Use an infrared camera, a color camera and an infrared speckle array projector to form a miniaturized monocular depth camera. The infrared speckle array projector projects a random speckle pattern onto the scene under test, and the infrared camera and the color camera synchronously collect images. The infrared camera, the color camera and the infrared speckle array projector are all placed horizontally, and the three are on the same horizontal line. Among them, the distance between the infrared camera and the infrared speckle array projector is the farthest, and the distance is 35mm. The color camera is located between the infrared camera and the infrared speckle array projector, and it is close to the infrared camera.
[0031] Step 2. Use the stereo matching algorithm to calculate the disparity map between the speckle image taken by the infrared camera and the speckle image of the reference plane at a known distance, and obtain the depth map based on the triangulation principle.
[0032] First, an infrared camera is used to capture a speckle image of a reference plane at a known distance. Ref The acquired speckle image is called the reference image. Through the triangulation relationship, the reference disparity value d of the reference image can be calculated according to the following formula: Ref ,
[0033]
[0034] Wherein, B is the distance between the infrared camera and the infrared speckle array projector, and f is the focal length of the infrared camera.
[0035] Secondly, the speckle image of the scene being measured captured by the infrared camera is called the target image. For each valid matching point p(x, y) in the target image, the correct corresponding reference point p can be found in the reference image through the stereo matching algorithm. Ref (x Ref ,y Ref ), p(x,y) and p Ref (x Ref ,y Ref ) is,
[0036] (x,y)=(x Ref +d Rel ,y Ref ),
[0037] Among them, d Rel is the relative disparity value of the target image relative to the reference image.
[0038] Thus, the actual disparity value d of each valid target point can be obtained in this way,
[0039] d=d Ref +d Rel .
[0040] Finally, after obtaining the disparity map with sub-pixel accuracy, the depth value Z can be obtained through triangulation.
[0041]
[0042] In step 3, the depth map is colorized, and the depth map is given color texture information of the measured scene.
[0043] According to the calibration parameters between the infrared camera and the color camera, the corresponding relationship between the speckle image taken by the infrared camera and the color image taken by the color camera is calculated through the depth map.
[0044]
[0045]
[0046] Among them, C x , C y 、M x 、M y 、N x and N y are the calibration parameters between the infrared camera and the color camera, respectively, (x c ,y c ) are the coordinates of the corresponding points on the color image, thereby realizing the colorization of the depth map and giving the depth map the color texture information of the measured scene.
[0047] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for colorizing a depth map based on a monocular depth camera, characterized in that: Here are the steps: Step 1. Use an infrared camera, a color camera and an infrared speckle array projector to form a miniaturized monocular depth camera. The infrared speckle array projector projects a random speckle pattern onto the scene being measured, and the infrared camera and the color camera synchronously collect images. Step 2. Use the stereo matching algorithm to calculate the disparity map between the speckle image taken by the infrared camera and the speckle image of the reference plane at a known distance, and obtain the depth map based on the principle of triangulation; Step 2 is as follows: First, an infrared camera is used to capture a speckle image of a reference plane at a known distance. The acquired speckle image is called the reference image. Through the triangulation relationship, the reference disparity value of the reference image can be calculated according to the following formula: , , in, is the distance between the infrared camera and the infrared speckle array projector, is the focal length of the infrared camera; Secondly, the speckle image of the scene being measured captured by the infrared camera is called the target image. For each valid matching point in the target image , the correct corresponding reference point can be found in the reference image through the stereo matching algorithm , and The relationship between them is, , in, is the relative disparity value of the target image relative to the reference image; Again, get the actual disparity value of each valid target point , ; Finally, after obtaining the disparity map with sub-pixel accuracy, the depth value can be obtained through triangulation. , ; Step 3. According to the calibration parameters between the infrared camera and the color camera, the corresponding relationship between the speckle image taken by the infrared camera and the color image taken by the color camera is calculated through the depth map, so as to realize the colorization of the depth map and give the depth map the color texture information of the measured scene.
2. The method for colorizing a depth map based on a monocular depth camera according to claim 1, characterized in that: In step 1, the infrared camera, the color camera and the infrared speckle array projector are all placed horizontally, and the three are on the same horizontal line. The distance between the infrared camera and the infrared speckle array projector is the farthest, and the color camera is located between the infrared camera and the infrared speckle array projector and close to the infrared camera.
3. The method for colorizing a depth map based on a monocular depth camera according to claim 1, characterized in that: In step 3, according to the calibration parameters between the infrared camera and the color camera, the corresponding relationship between the speckle image taken by the infrared camera and the color image taken by the color camera is calculated through the depth map. , , in, , , , , and are the calibration parameters between the infrared camera and the color camera, are the coordinates of the corresponding points on the color image.
Citation Information
Patent Citations
Depth map real-time acquisition algorithm based on array camera
CN101556696A
High-resolution depth map acquisition method based on active and passive fusion
CN105869167A
RGB-D camera and stereophonic sound-based passage prediction system and method for visually impaired people
CN107341789A
Binocular depth camera system and depth image generating method
CN108234984A
Multi-view-based full-automatic multi-modal three-dimensional color measurement method
CN109579741A
