Calculate Depth map of right image

2019-06-01 20:25发布

问题:

What I have done: To create a novel view(right image) from left image(given), I used the formula for pure translation between views(from Zissermann book) as:

x' = x + K.t/Z

x'= [u' v' 1]; x = [u v 1]; K = [f 0 cx; 0 f cy;0 0 1]; t = [t1 t2 t3]^T; Z - depth of pixel in left image

The images and camera matrix were taken from Middlebury stereo 2014 dataset.

By implementing this, I have an image with holes(black regions) due to disocclusions.

What I need to do :

To fill these holes, several algorithms exist which modify the depth map of right view prior to warping.

Can you tell me how I can find depth map of my synthesized(right) view ?

results matlab Above is the result I have got till now, please help!

回答1:

My answer actually is a workaround from Priyamvadha's previous question and my answer to it. If you have extrinsic/intrinsic parameters and 3D points, consider to reverse the process.

  1. transform (as you did with my previous answer) all the 3D points in the right camera's reference system (use extrinsic R and t, "reversing" the transformation)

  2. now that you have all the 3D coordinates in that system, remember that the Z value is strongly linked with the disparity

  3. for each point and its Z coordinate, the disparity should be equal to

    D = (b*f)/Z

with b the baseline and f the focal length from intrinsics.
You should have obtained syntethized disparity for your syntetized image. Link each disparity value with the correspondant projected point in the syntethized image.

Yes, I could have join all the passage and give you a unique formula, but it would not have meant anything for you.

PS if you have no point, there will be no depth for black holes in the image.