Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problem with stereoRectify() results [magnified output]

Hello, newbie here. I have problems concerning the rectification of a stereo image pair. I have as a input videos from a pair of cameras attached to a stereo microscope. My final task is to 3D reconstruct the result. At this point I have stereo calibrated them with a reprojection error of about 1.1 per camera and 4 for the stereo result. After, I pass the calibration results for stereo rectification in stereoRectify() and remap.

stereoRectify(KL , DL , KR , DR , image_size , R , T , R1 , R2 , P1 , P2 , Q , 0, 0.01 ) ;

initUndistortRectifyMap(KL,DL,R1,P1,image_size, CV_16SC2 , map11, map12) ; initUndistortRectifyMap(KR,DR,R2,P2,image_size, CV_16SC2 , map21, map22) ;

remap(initial_image[0],remappedImage0, map11,map12, INTER_LINEAR, BORDER_CONSTANT, Scalar()); remap(initial_image[1],remappedImage1, map21,map22, INTER_LINEAR, BORDER_CONSTANT, Scalar());

Now the output image pair looks rectified, but its a scaled up version of the input. Actually I see only a magnified region of the center on both final images as the rectification result.

I try to realize why this is happening, but I'm still missing something and I'm stuck. Is there any hint or reference or someone that has faced similar problems in the past? I attach a couple of images for reference. One is with the pair of the original and the rectified image (where the zoom in is obvious), and the second one is the rectification result.

Any help would be invaluable. My opencv version is 3.4.5 on Linux Mint 18.3

-A pair of the original and the rectified image

A pair of the original and the rectified image

  • Stereo rectification image pair

Stereo rectification image pair

problem with stereoRectify() results [magnified output]

Hello, newbie here. I have problems concerning the rectification of a stereo image pair. I have as a input videos from a pair of cameras attached to a stereo microscope. My final task is to 3D reconstruct the result. At this point I have stereo calibrated them with a reprojection error of about 1.1 per camera and 4 for the stereo result. After, I pass the calibration results for stereo rectification in stereoRectify() and remap.

stereoRectify(KL , DL , KR , DR , image_size , R , T , R1 , R2 , P1 , P2 , Q , 0, 0.01 ) ;

initUndistortRectifyMap(KL,DL,R1,P1,image_size, CV_16SC2 , map11, map12) ; initUndistortRectifyMap(KR,DR,R2,P2,image_size, CV_16SC2 , map21, map22) ;

remap(initial_image[0],remappedImage0, map11,map12, INTER_LINEAR, BORDER_CONSTANT, Scalar()); remap(initial_image[1],remappedImage1, map21,map22, INTER_LINEAR, BORDER_CONSTANT, Scalar());

Now the output image pair looks rectified, but its a scaled up version of the input. Actually I see only a magnified region of the center on both final images as the rectification result.

I try to realize why this is happening, but I'm still missing something and I'm stuck. Is there any hint or reference or someone that has faced similar problems in the past? I attach a couple of images for reference. One is with the pair of the original and the rectified image (where the zoom in is obvious), and the second one is the rectification result.

Any help would be invaluable. My opencv version is 3.4.5 on Linux Mint 18.3

-A pair of the original and the rectified image

A pair of the original and the rectified image

  • Stereo rectification image pair

Stereo rectification image pair

problem with stereoRectify() results [magnified output]

Hello, newbie here. I have problems concerning the rectification of a stereo image pair. I have as a input videos from a pair of cameras attached to a stereo microscope. My final task is to 3D reconstruct the result. At this point I have stereo calibrated them with a reprojection error of about 1.1 per camera and 4 for the stereo result. After, I pass the calibration results for stereo rectification in stereoRectify() and remap.

stereoRectify(KL , DL , KR , DR , image_size , R , T , R1 , R2 , P1 , P2 , Q , 0, 0.01 ) ;

; initUndistortRectifyMap(KL,DL,R1,P1,image_size, CV_16SC2 , map11, map12) ; initUndistortRectifyMap(KR,DR,R2,P2,image_size, CV_16SC2 , map21, map22) ;

; remap(initial_image[0],remappedImage0, map11,map12, INTER_LINEAR, BORDER_CONSTANT, Scalar()); remap(initial_image[1],remappedImage1, map21,map22, INTER_LINEAR, BORDER_CONSTANT, Scalar());

Scalar());

Now the output image pair looks rectified, but its a scaled up version of the input. Actually I see only a magnified region of the center on both final images as the rectification result.

I try to realize why this is happening, but I'm still missing something and I'm stuck. Is there any hint or reference or someone that has faced similar problems in the past? I attach a couple of images for reference. One is with the pair of the original and the rectified image (where the zoom in is obvious), and the second one is the rectification result.

Any help would be invaluable. My opencv version is 3.4.5 on Linux Mint 18.3

-A pair of the original and the rectified image

A pair of the original and the rectified image

  • Stereo rectification image pair

Stereo rectification image pair