fbergama / wass

WASS (Waves Acquisition Stereo System) is an optimized stereo processing pipeline for sea waves 3D reconstruction.
GNU General Public License v3.0
40 stars 13 forks source link

Difficulties with the autocalibrate process #27

Open gitRonang opened 7 months ago

gitRonang commented 7 months ago

I'm having trouble with the auto-calibrate part and therefore rectifying my images in WASS. The extrinsic parameters and therefore the H homography matrix are causing my image to rotate more than necessary. When I calculate ext_T and ext_R separately, I get the right rotations and translations overall, but I can't find this in WASS. Why is this? My images are probably a few mm off axis. What I wan't: stereo What I have with WASS autocalibrate parameters: stereo

Thank's!

fbergama commented 7 months ago

Your cameras are quite close to the water's surface. This is a tricky situation since the reflections won't match that well between the two images. Can you provide more info on the camera geometry? Are the two cameras mounted parallel and side by side? How did you obtain the first image?

gitRonang commented 7 months ago

Yes they are between 1.5 and 2m above the water surface...I could try a better angle next time! This is my setup: IMG_7457 IMG_7456

Basically, 0.4m baseline, 2456*2048 images, 5 fps, More or less the totally parallel :) This is a first setup, I'm considering building a more robust and precise one since WASS works pretty well!

The first image: I have computed intrinsic and extrinsic parameters with an external script, with a chessboard. Then, before the stereo step I replaced the computed extrinsic parameters from WASS by mine. However, it looks good but the homography matrix don't match this parameters and the stereo step fails. I currently try to obtain my own homography matrix that I can control and then reinject it before the stereo step.

fbergama commented 7 months ago

Nice setup! I like it 👍

Ok, the geometry is fine. Considering how close they are I suggest to stereo-calibrate using a chessboard as you did. The way to use it is to create two files: ext_T.xml and ext_R.xml and place them alongside the intrinsic and distortion matrices in the config/ folder. wass_prepare will automatically use them. Then, skip the match and autocalibrate steps.

One last question. How do you ensure that the images are captured at the same time? Those look like rolling-shutter cameras...

gitRonang commented 7 months ago

Ok I'm gonna try this, thank's.

Well, I have tested multiple ways of doing the synchro between two basic camera (Arducam low distortion camera). I achieve <1ms desynchro with a script that purge the buffer before saving the picture. A python script launch 2 calls to get camera images, purge the buffer and then accept. After 10 pictures I achieve strict synchro.

For my setup, do you think that a short baseline like that would be problematic to efficiently run WASS?

gitRonang commented 7 months ago

Moreover, I tried your solution with extrinsic parameters. And then I face a case that I have sometimes: area_grid

Usually the cloud point should be inversed, maybe this is caused by these few outliers?

gitRonang commented 7 months ago

Moreover, I tried your solution with extrinsic parameters. And then I face a case that I have sometimes: area_grid

Usually the cloud point should be inversed, maybe this is caused by these few outliers?

Looks like an issue with the file planes.txt...

fbergama commented 7 months ago

That's clearly wrong, not sure if it's the mean sea-plane estimation or a problem with the extrinsic calibration. If you put your own ext_T values, please ensure that the length of the translation vector is 1.