I have the stereo calibration parameters of two different cameras (different resolutions). I want to use this data for stereo rectification and calculating the disparity map. The problem is that the images from the two cameras have different sizes and I don't know how to specify these sizes. cvStereoRectify takes only a single size, assuming that both the images are of the same size.
Any suggestion in this regard will be highly appreciated.
Regards,
Khan
Have you tried using a region of interest on the higher resolution camera? For example, say you have a 640x480 camera and an 800x600 camera. You might do the following:
VideoCapture videoLo(LOW), videoHi(HIGH);
Mat loRes, hiRes;
Point hiCenter(hiRes.size().width / 2, hiRes.size().height / 2);
int key = 0;
do
{
videoLo >> loRes;
videoHi >> hiRes;
// this will give you the center 640x480 of the high res image.
Mat hiResWin(hiRes, Rect(hiCenter.x - loRes.size().width / 2,
hiCenter.y - loRes.size().height / 2,
loRes.size().width,
loRes.size().height));
key = waitKey(33);
} while((char)key != 27);
Hope that's helpful!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With