0
$\begingroup$

Rosanswers logo

Hello,

I'm trying to write a GPU implementation of stereo_image_proc and am having some trouble getting a proper disparity map from my GPU. What I'm wondering is if I missed a filtering step. The current program flow goes as follows.

  1. Load left and right camera calibration data from two YAMLs and store in a Mat for OpenCV to later process
  2. Run initUndistortRectifyMap from OpenCV on said data to get the map matrices for rectification
  3. Upload map matrices as well as left and right camera images to GPU
  4. Rectify the images using gpu::remap
  5. Compute disparity map using gpu::StereoBM_GPU
  6. Bring image back to computer from GPU and publish into a ROS topic

I know everything up to and including rectifying the cameras images is correct because the rectified images are the same as those returned by stereo_image_proc. Below are the left and right camera images along with the disparity that is returned from the GPU. I also can't explain why there's a black bar on the left of the disparity map.

Left, Right, and Disparity

I can provide code if needed but I didn't want to clutter up the post if it was as simple as a missing step. Thanks for any help with this matter!


Originally posted by wpi_igvc12 on ROS Answers with karma: 58 on 2012-02-02

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Judging by the perspective, it looks like your left and right images may be swapped.


Originally posted by ahendrix with karma: 47576 on 2012-02-02

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

It turned out to be a combination of having the images swapped and the images not being in gray scale (MONO8).


Originally posted by wpi_igvc12 with karma: 58 on 2012-02-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.