I have many calibrated cameras.(Known K. Actually images were taken by the same camera). And I do bundle adjustment to retrieve extrinsic of each image. The camera parameters are correct and well verified.
Now I wish to use stereoBM to estimate depth map for me.
I compile opencv's sample stereo_match and use it directly with
stero_match ..\data\left.png ..\data\right.png --max-disparity=64 --blocksize=5 -i="..\data\intrinsic.yaml" -e=".\extrinsic.yaml"
However the images are distorted very badly. I've check that both intrinsic and extrinsic are correctly loaded.
There is one thing. I don't know if I am calculating [R|T] correctly. All the example available directly use the output of stereoCalibrate. However, I only have extrinsic parameter of each image.
# quaternion(w x y z) T(x y z)
# Rx+t
(1 0 0 0) 0 0 -10
(0.995267 0.00147206 0.0971636 0.000665091) 0 0 -10
I calculate related R|T by first converting both extrinsic parameters into matrix form. then M2*M1^-1. finally extract R and T from the matrix I am not quite sure if I am correct.