Fill gaps in Depth Map [closed]
I have a depth map computed, which is sparse (about 75% of the entries are "empty"). Now I want to fill the empty entries. The problem is that the type of my Mat is CV_32F and "empty entries" are -1. Furthermore the values of the filled entries are quite small. So I can't convert it to CV_8U and use inpaint because I would loose to much precision.
I tried resizing the DepthMap but then, OpenCV uses the "empty entries" for interpolation which leads to distorted values at the edge of the holes of the depthMap.
Is there another OpenCV function I can use to fill those gaps?
This seems just interpolation between neighboring pixels right?
Uh I would want to know that answer as well, filling "holes" in depth maps by approximating the depth values via the neighbours should be not so hard, I think inpaint would do to much, it would even fill areas where there is no depth information by neighbours available
If you have point1 and point 2 in 3D space, you first calculate the euclidean distance, then look what the intensity value difference between them is and then rescale all the pixels on the line between them to a value corresponding to the difference interval? Basic interpolation right?
Wouldn't it be better to do this interpolation directly on the depth map values in terms of efficiency? its much easier to interpolate the 2d depth map before converting it to the 3d point cloud or not?