Cropped rectified stereo images

asked 2016-01-27 05:17:19 -0600

aripod gravatar image

Hello,

I'm using two RGB cameras. They are rotated, one clock-wise and the other counter clock-wise. I'm calibrating them with Ros Stereo Calibration node which is based on OpenCv. The output I get the camera matrix, projection matrix and R and T from cv::stereoCalibrate. The stereo_image_proc node outputs the rectified images that you can see below:

image description

They seem rectified, they are both "facing" the right way but there is a HUGE area of only black pixels......why is that? Does it have to do with some parameter in cv::stereoRectify that I should change?

Thanks for the help.

edit retag flag offensive close merge delete

Comments

I think your callibration is also doing some kind of resize... Have you used imageSize that is not the real one?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-27 06:31:12 -0600 )edit

I'm using a ros node which has the calibration code embedded, but I looked into it and imageSize is not used....

aripod gravatar imagearipod ( 2016-01-27 06:43:17 -0600 )edit

I have just also checked that the rotation matrix R is correct, but the translation vector T is correct in the values but wrong in the magnitud. I know there is only a translation of 10cm in Y axis but T=[0, 0.01, 0] rather than T=[0, 0.1, 0].

aripod gravatar imagearipod ( 2016-01-27 06:51:21 -0600 )edit

After that fix, what is happening? what about magnitude?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-27 07:43:24 -0600 )edit

What fix? I haven't changed any line of code.... I just checked that imageSize is not used and there is no "resizing" T either.....I still have my doubts about the uncalibrated images (raw ones, coming directly from the cameras) are flipped, one 90 degrees and the other one -90 degrees.....

aripod gravatar imagearipod ( 2016-01-27 09:06:00 -0600 )edit

what camera is it? PS I was talking about the T value

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-27 09:34:25 -0600 )edit

They are two UI-3241LE from IDS. I'm using the ueye_cam node to get the synchronized images.... About the T value, I measured the distance between the cameras with a ruler and checked the returned T value.....that's all I did. You don't think the problem comes from the cameras being rotated in opposite directions along the same axis (z)?

aripod gravatar imagearipod ( 2016-01-27 09:42:05 -0600 )edit

It may be the +90 and -90 that are because of the cameras rotations, but I do not think that is a big problem... I think that the problem may come from the displaying part... Aren't you using a big Mat and you display each of the images in 2 different that big Mat?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-27 09:56:28 -0600 )edit

each rectified image is stored in a cv::Mat and in this case, individually published on a ros topic, that would be each "raw" cv::Mat returned from cv::stereoRectify

aripod gravatar imagearipod ( 2016-01-27 10:00:04 -0600 )edit

hm... I have no other idea for now....

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-27 10:01:36 -0600 )edit