Undistorting a depth map
Hey guys,
I am currently trying to undistort a floating point mat (CV_32F) with the distortion map of the camera. It works well with the RGB image, but produces strange results with the floating point depth map. I always thought, the x/y position gets corrected, independent of the value at the position. But it seems like this is not the case, is it?
(Note: The color map might influence the appearance of the result, but i don't think that much.)
Before undistort:
After undistort:
You may get more attention to this question if you cut and paste some code into your question which serves as a simple reproducer for your issue, and the input data it needs.
Okay, it is answered. I used CV_INTER_LINEAR and my depth map has extreme outliers. These outliers seem to dominate over the inliers. Changed to CV_INTER_NN and it looks good now!
Good to hear it. I'm curious what the improved output looks like.
Also (I see you are new here)... If you have enough Karma (QA Forum points) to able to answer your own question by adding an answer below (it may take 24 hours for your previous points to add up so you can answer your own question), then you may get a bunch more Karma points, which means you have more choices of action next time you have a question. I'm interested in some of the same things you are and am fairly new to OpenCV myself (ROS indigo and kinetic, Ubuntu 14 and 16, disparity, object recognition, etc.).
The improved one looks very similiar to the first image (distortion of the camera was low). That's also what I expected. Can't show a good result, a little bit difficult to grab from my framework. :D