robotology / stereo-vision

Repository containing apps for stereo vision
https://robotology.github.io/stereo-vision/
GNU General Public License v2.0
19 stars 19 forks source link

Disparity map calibration #20

Closed samvinanzi closed 4 years ago

samvinanzi commented 5 years ago

Hello!

I have been having issues in obtaining a clean disparity map from our iCub (Manchester01) and I would benefit from some support.

These are the eyes home position when yarprobotinterface is running:

eyes1 eyes2

I have run stereoCalib with the standard chessboard printed on an A4 sheet, keeping it as close as possible to the cameras during the calibration phase and using the following parameters:

[STEREO_CALIBRATION_CONFIGURATION]
boardWidth 8
boardHeight 6
boardSize 0.024
numberOfPairs 20

Obtaining an error of more or less 0.2. The following is a view from the eyes after the calibration, using pinhole projection and the centercross:

eyes_view

At this point, I prepare a table with objects of different height and I try to calibrate SFM, but the procedure often fails and even when it succeeds, the resulting disparity map looks like a grey flickering blob. Here are two examples:

sfm_1 sfm_2

(In this second picture, I tried to raise the table to the robot’s eye level instead of making it lower its gaze, plus I eliminated any background)

Of course, what I would like to obtain is something as clear as this example: https://youtu.be/PqpHrxgJqfY Am I doing something wrong? Are there some other calibrations I should run? Any help will be highly appreciated :)

pattacini commented 5 years ago

Hi @samvinanzi

The images you posted are not displayable actually. It might be that those links point to a private repository of yours. A possible workaround would be to drag & drop those pictures herein straight away.

samvinanzi commented 5 years ago

Oh, good to know that you can simply drag and drop! By the way, they should be visible now.

vtikha commented 5 years ago

Hi @samvinanzi

The first condition is the one typically used as the robot is able to have a wider range and sees different planes. Please try reducing the gain of the cameras as you are failing to detect features on the objects that are useful for SFM or maybe use less bland objects (at least for calibration). eg: You could use some books (put vertically) etc that are rich in features.

samvinanzi commented 5 years ago

I can't lower the gain of the cameras as it's already set to 0, but I've changed the scene and run some trials:

1) I've tried using the "default" parameters specified here: http://www.icub.org/doc/icub-main/groupicubdragonfly2.html.

screenshot from 2019-01-24 11-43-50

2) I tweaked a bit those "default" parameters:

screenshot from 2019-01-24 11-47-53

3) I went back to our custom parameters, but I raised the sharpness and moved around the objects on the table. For sake of completeness, these are the parameters I'm using: yarpdev --device grabber --subdevice dragonfly2 --width 320 --height 240 --video_type 1 --white_balance 0.514 0.610 --gain 0.0 --shutter 0.913 --name /icub/cam/left --brightness 0 --DR2 --stamp --sharpness 1.0 --hue 0.48 --gamma 0.4 --saturation 0.420 --framerate 30 --guid 00b09d01006fb1fa

screenshot from 2019-01-24 11-51-52

As you can see, I didn't obtain any improvements. Do you have any other ideas?

GiuliaP commented 5 years ago

Hi @samvinanzi

you could also try changing some parameter of the SFM module (please refer to the module's documentation).

You could try:

Giulia

samvinanzi commented 5 years ago

Thank you too for the suggestions!

Several combinations of parameters for LIBELAS didn't bring much improvement (I like the effect that is given by --elas_add_corners, but overall the output still looks like a meaningless gray surface).

SGBM gave better results, in my opinion, but you still can't really distinguish the scene in the disparity map. Here is what it looks like (I also added the rectified images, they might help):

screenshot from 2019-01-24 15-19-39

pattacini commented 5 years ago

Just wanted to share here a pointer to a similar issue: https://github.com/robotology/icub-support/issues/163.

samvinanzi commented 5 years ago

Just wanted to share here a pointer to a similar issue: robotology/icub-support#163.

Thank you for pointing it out. I was aware of that issue and, actually, the reason why I provided pictures of iCub's eyes and views was to pinpoint any possible mechanical errors (e.g. displaced eyebulbs, unfocused lens, etc...) as was the case for the Barcelona team.