Ask Your Question

Revision history [back]

stereoRectification - alpha parameter impact

I have doubts what is the meaning of alpha parameter in stereoRectify function. Of course I've read what documentation says. I obtain two frames from a stereo set of cameras. They are properly calibrated. I need two frames that are rectangle, row aligned and have the same zoom (all objects have exactly the same size on both frames) and preserves original ratio.

When I leave the alpha parameter with default value (-1) I get two frames that seems to be original frames with no pixels lost and each of them has it's own ROI (region of interest, rectangle with all interior pixels valid). But these rectangles are slightly different, especially regarding height, i.e:

left: [1255 x 697 from (25, 13)]
right: [1258 x 699 from (0, 14)]

Does it mean that the frames are aligned from 0 row and have 697 corresponding rows and those two rows from right frame are only additional?

2) When I set the alpha to 1 I get two pretty 1280x720 frames but my question is how are they obtained under the hood? Is each ROI resized separately to expected size? That would mean that I lost common ratio

[1255 x 697]=>[1280 x 720]
[1258 x 699]=>[1280 x 720]

or, are they zoomed equally somehow (with common ration preserved)?