lambdaloop / anipose

🐜🐀🐒🚶 A toolkit for robust markerless 3D pose estimation
http://anipose.org
BSD 2-Clause "Simplified" License
354 stars 67 forks source link

calibration charuco #20

Closed niccle27 closed 3 years ago

niccle27 commented 4 years ago

Hello again!

i was able to try to use a set of 12 videos from 12 cameras disposed arround a cube. As Charuco is robust to occlusion, i tried to calibrate all the cameras directly, though i came some issue:

I'm getting the following output (for the sake of simplicity, i just putted a few cameras):

[cam_0]
name = "1"
size = [ 1920, 1080,]
matrix = [ [ 1352.881831286193, 0.0, 959.5,], [ 0.0, 1352.881831286193, 539.5,], [ 0.0, 0.0, 1.0,],]
distortions = [ 0.06123193869724274, 0.0, 0.0, 0.0, 0.0,]
rotation = [ -0.9187013796846374, -0.1314637697651443, -0.01424130024745966,]
translation = [ -5.619613368346561, -657.6452591254599, -581.905597021176,]

[cam_4]
name = "2"
size = [ 1920, 1080,]
matrix = [ [ 1438.070128521826, 0.0, 959.5,], [ 0.0, 1438.070128521826, 539.5,], [ 0.0, 0.0, 1.0,],]
distortions = [ 0.2796506087772396, 0.0, 0.0, 0.0, 0.0,]
rotation = [ -0.7143773130873536, 1.382841802203809, 0.4807818109132332,]
translation = [ -675.5911522271351, -558.2044612932817, 62.95864975515903,]

[cam_10]
name = "8"
size = [ 1920, 1080,]
matrix = [ [ 1145.838629150258, 0.0, 959.5,], [ 0.0, 1145.838629150258, 539.5,], [ 0.0, 0.0, 1.0,],]
distortions = [ 0.07663770925150003, 0.0, 0.0, 0.0, 0.0,]
rotation = [ 0.1836874264634381, 0.3578359386120759, 0.6576390160822976,]
translation = [ -442.3095802361823, 29.51957730274389, -757.8845126085191,]

As you can see, the intrinsic parameter have a wide variation especially for the focal. I was wondering if by any chance, there is a way to impose those intrinsic parameters? I'm using intel realsense and i can get the intrinsic parameters by some other way.

Once again, thank you a lot for you time !

lambdaloop commented 4 years ago

Hi @niccle27 ,

Unfortunately, there is no way to impose the the intrinsics when doing the bundle adjustment at this time. It would be a nice feature! Another, related feature, would be to constrain the focal length to be the same across all cameras, which seems like it would also help in your case.

For now, you could try to manually set the intrinsics after the calibration runs.

If you have a guess for the extrinsics as well, you can set the path to a calibration toml file in your config.toml like so:

[calibration]
calibration_init = 'path/to/calibration_init.toml'

The calibration_init.toml file has the exact same format as the outputted calibration.toml file, so you can use initialize with a previous calibration too.