completely black rectified images (Kind of solve....?) [closed]
Hello,
I just got a couple of cameras for stereo vision. I calibrated them with camera_calibration. I got the ost.txt file which looks like this:
# oST version 5.0 parameters
[image]
width
640
height
480
[stereo/left]
camera matrix
2936.789087 0.000000 583.498064
0.000000 2865.839793 254.251806
0.000000 0.000000 1.000000
distortion
-0.224767 -2.059623 -0.000719 0.023231 0.000000
rectification
0.779954 0.219443 -0.586102
-0.092957 0.966743 0.238258
0.618894 -0.131348 0.774414
projection
7412.660530 0.000000 6128.045624 0.000000
0.000000 7412.660530 -855.670516 0.000000
0.000000 0.000000 1.000000 0.000000
# oST version 5.0 parameters
[image]
width
640
height
480
[stereo/right]
camera matrix
2822.855469 0.000000 113.685666
0.000000 2746.930572 199.606104
0.000000 0.000000 1.000000
distortion
-0.986390 4.581731 0.017456 0.010306 0.000000
rectification
0.146495 0.250593 -0.956944
-0.488950 0.859289 0.150169
0.859923 0.445898 0.248409
projection
7412.660530 0.000000 6128.045624 -86524.314248
0.000000 7412.660530 -855.670516 0.000000
0.000000 0.000000 1.000000 0.000000
That file I separated left and right .ini and .yaml:
left.ini: # oST version 5.0 parameters
[image]
width
640
height
480
[nstereo/left]
camera matrix
2936.789087 0.000000 583.498064
0.000000 2865.839793 254.251806
0.000000 0.000000 1.000000
distortion
-0.224767 -2.059623 -0.000719 0.023231 0.000000
rectification
0.779954 0.219443 -0.586102
-0.092957 0.966743 0.238258
0.618894 -0.131348 0.774414
projection
7412.660530 0.000000 6128.045624 0.000000
0.000000 7412.660530 -855.670516 0.000000
0.000000 0.000000 1.000000 0.000000
right.ini:
# oST version 5.0 parameters
[image]
width
640
height
480
[stereo/right]
camera matrix
2822.855469 0.000000 113.685666
0.000000 2746.930572 199.606104
0.000000 0.000000 1.000000
distortion
-0.986390 4.581731 0.017456 0.010306 0.000000
rectification
0.146495 0.250593 -0.956944
-0.488950 0.859289 0.150169
0.859923 0.445898 0.248409
projection
7412.660530 0.000000 6128.045624 -86524.314248
0.000000 7412.660530 -855.670516 0.000000
0.000000 0.000000 1.000000 0.000000
And with rosrun camera_calibration_parsers convert left.ini left.yaml and rosrun camera_calibration_parsers convert right.ini right.yaml I obtained the .yaml.
Once I launched the node with the embedded drivers for my cameras ueye_cam node I echoed the camera_info topic from both cameras and I got every data according to the calibration.
Then I ran ROS_NAMESPACE=stereo rosrun stereo_image_proc stereo_image_proc and the images obtained (raw_image directly from the driver's node, rectified and mono from stereo_image_proc) are shown below:
First of all, master camera is rotated 90 deg clockwise and slave is rotated 90 counter clockwise. The calibration was with the chessboard pattern farther from the two objects I'm showing in ...
You could try running undistortPoints on some sample points like the center of the image, and the four corners, to see if those calibrations are reasonable. Is the calibration process stereo-aware? Maybe try calibrating a single camera and rectifying without any stereo stuff running.
I'm out for holidays now. I'll calibrate them separately when I get back. But shouldn't I have something to project both images to a common plane for the sterevision? And what about the extrinsic parameters then?
In my opinion, your calibration looks wrong. The cx and cy terms should be close to the half of the resolution. Try to attach the calibration pattern to a rigid surface (wood) and repeat the calibration. Don't move the cameras, move the pattern instead, and focus the cameras.