Personal tools

JRF:Stereo 3D position detection

From hpcwiki

Jump to: navigation, search

Execution steps to the detection by Miguel Zamora (miguel.zamora24@gmail.com).

1) Save the calibration videos (Blleza_TAL_Cal_Pattern3, bnt_TAL_Cal_Pattern3_Prima) in the folder Calibration/P12TAL.

2) In Matlab, launch the video viewer app two times (Matlab-> apps -> Video viewer) to open the two calibration videos simultaneously.

3) By playing and pausing the videos, make a list of the frames in which the pattern is visible in both cameras at the same time ("Calibration/P12TAL/P12TAL_CAL_PAT3Frames.txt"). In this case synchronization is more complex since the blinking led was not recorded and the videos were recorded at different frame rates, so we use the parameters offset=0 and factor=4 in the script P12TALVideograbber.m

4) Launch the Stereo Camera Calibrator app. Use the button "Add Images" to add the frames that were obtained in the previous step and set the size of checkerboard. In this test 30 images were paired and 14 pairs of images were rejected.

5) Calibrate using the different options for Radial distortion, Skew and Tangential Distortion in order to get the minimum mean error. By clicking in the bars of the reprojection errors in the GUI, one can also remove the pairs of images that have the greatest errors and recalibrate. (Use cntrl + left click to select several bars, and then go to the left panel and use right click in one of the selected images to remove and recalibrate). Keep in mind that the minimum recommended number of images is 20.

6) Use the button "Export camera parameters" to export the parameters to the matlab workspace. Leave the name of the variable unchanged ("stereoParams"). Right click on the variable stereoParams and save it as *.mat file. ("stereoParams2R1T.mat" in InputData/P12 )

7) Copy one of the previous test (i.e. P08TAR12Hz.m) and name it P12TAL20Hz.m. Considerations: -> Set the paths appropriately. -> Set frame rate, initial and final time (fps, ti, tf variables) -> Set patchImg1 and patchImg 2 as empty. Run the script and look at figures 5 and 6. If the matching was performed correctly press 1 in Matlab, if not press 0 and look at the figures 1 and 2. There will probably be gray shapes that do not correspond to circles. With the "Data cursor" measure the coordinates of a rectangle that encloses the unwanted shapes and use the coordinates to set patchImg1 and pachtImg2. Once all unwanted shapes are removed, if the matching is not perform correctly change the variable matchStratagy.