Opencv Stereo match Point cloud visualization

asked 2016-08-30 07:21:15 -0600

unais gravatar image

Scenario : I am trying to generate depth map using stereo image pair and visualize the depthmap.

The following steps I have done.

  1. Calibrated the stereo pair using OpenCV stereo calibration

    Source : https://github.com/opencv/opencv/blob...

    Input : checker board stereo pair

    Output : intrinsic.yml and extrinsic.yml is generated

  2. Depth map generation

    Source : https://github.com/opencv/opencv/blob...

    Input : stereo calibrations generated and stereo pair images (Left and Right)

    Output : Disparity map generated . Point cloud generated

Problem : I got point cloud generated but I could not able to visualize it. My image has a resolution 1280*854 = 1093120 and I got the disparity map also with the same resolution.The point generated has number of lines 904701 which is not equivalent to number of pixels. Why there is less xyz points in my point cloud generated.How I can visualize the point cloud generated.

0.340317 0.242687 0.464209
0.340887 0.242687 0.464209
0.341456 0.242687 0.464209
0.342026 0.242687 0.464209
0.342596 0.242687 0.464209
0.343166 0.242687 0.464209
0.343735 0.242687 0.464209
0.344305 0.242687 0.464209
0.344875 0.242687 0.464209
0.345444 0.242687 0.464209
0.346014 0.242687 0.464209
0.346584 0.242687 0.464209
0.347153 0.242687 0.464209
0.347723 0.242687 0.464209
0.348293 0.242687 0.464209
0.348863 0.242687 0.464209
0.349432 0.242687 0.464209
0.350002 0.242687 0.464209
0.350572 0.242687 0.464209


     Thanks in advance
edit retag flag offensive close merge delete

Comments

3

"Why there is less xyz points in my point cloud generated ?" - see here

berak gravatar imageberak ( 2016-08-30 07:45:07 -0600 )edit

How I can plot these xyz

unais gravatar imageunais ( 2016-09-01 22:57:33 -0600 )edit

The stereo matching will invalidate some matches as not being similar enough. This depends on the stereo matching parameters. These get marked with a special value, and the code berak pointed to is effectively checking for the special value and ignoring such points.

In terms of plotting them in a 3D viewer. OpenCV doesn't have anything like that. You could use MATLAB/Octave (make a figure, use the scatter3 function) ; Point Cloud Library (PCL) ; or a particularly easy one is a program called CloudCompare, which can load points from txt files easily.

AJW gravatar imageAJW ( 2016-09-04 05:37:17 -0600 )edit