Distorted images after camera calibration+stereo_image_proc [closed]
Hello everyone!
This question might not be specific to ROS, but I decided to give it a try anyway. I am using stereo_image_proc to rectify my camera's image output and produce the corresponding disparity image, but the results are bizarre.
As seen below, where the top images are the unrectified images displayed within my node (plus an unscaled disparity image obtained locally, which is of no interest to this discussion) and the bottom images are the output from stereo_image_proc, severely distorted due to some mistake I am making.
For camera calibration, I used the graphical tool in the camera_calibration package. I published those using the CameraInfo message, doing nothing obviously wrong.
So what could I be doing wrong? These are the hypotheses I have tested:
Wrong calibration parameters: Initially I was using the parameters obtained from my camera's standard calibration tool (smallv, from SVS). I thought that might be the problem, due to conflicting calibration models. After reading about both models, I was convinced they were equivalent, but decided I should try calibration from within ROS just to be sure. Turns out the parameters I got were very similar, as were the results.
Swapped left/right images: I don't know why I thought that could be the reason for such a problem, but a quick test ruled that out of the question. If someone has a strong argument for this hypothesis, though, I will be more thorough in my testing.
Swapped matrices in CameraInfo: The results are so bad I thought I might be swapping a couple parameters in the calibration results. What is the standard way to build CameraInfo messages from the raw result from camera_calibration? I simply parsed the text output and copied the values I deemed appropriate into the messages, since I have not yet implemented the set_camera_info service.
I would appreciate any help I can get, I am completely stumped!
Note: I am able to rectify the images using SVS, but I would like to be able to do that using stereo_image_proc instead
If I remove the distortion parameters, the images are at least visible... So my guess is the problem is there.