Ask Your Question

Revision history [back]

Fill gaps in Depth Map

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?