Here is a python + opencv toolbox that can help you calibrate your multi-camera extrinsic parameters. All 2D and 3D position data are numpy array
based.
singleball + global registion: Video#1
doubleball: Video#2
I've assume that you've installed basic libs, like opencv
, numpy
, scipy
. Here is the multive calib package, just install it.
The multiview_calib
is modified from https://github.com/cvlab-epfl/multiview_calib
, take care use my version.
pip install -U git+https://github.com/chenxinfeng4/multiview_calib
You can use single-ball
, double-ball
or triple-ball
.
Routine:
!!! The ball detector is not contain in this code, so you should manually give me the position of ball in each view. You can use YOLO-v8 to detect.
The
single-ball
,double-ball
ortriple-ball
are most the some pipeline. Except the double/triple-ball can restore the scale information. It will be helpful when you don't care about the world origin point and axes direction. Other wise I recommand you to usesingle-ball
pluscheckboard
, which can onstep registerworld axes
.
The test data is contained in the tutorial.
See the 1_intrinsic_calib/intrinsic_calib.ipynb
. You will get the intrinsic_calib.json
.
See the 2A_ball_extrinsic_calib/ball_extrinsic_calib.ipynb
and 2B_triball_extrinsic_calib/tripleball_extrinsic_calib.ipynb
. You will get the *calibpkl
.
The calibpkl contains the all intrinsic & extrinsic parameters.
K
(3, 3);
dist
[K1, K2, T1, T2, K3];
t
(3,);
R
(3, 3);
See the 3_worldaxes_register/worldaxes_register.ipynb
. You will get the refined calibration model *.recalibpkl
.
See the 4_transform_between2D_and_3D/mutual_transform_2D_3D.ipynb
All 2D and 3D position data are numpy array
based, so the calibration and reconstruction would be fast.
The calibration error is 0.6 mm
in 3D construction, and 1.6 pixel
in 2D image projection. Only 50-100 time slice ball-allview samples are enough for calibration.
checkboard
. It's for intrinsic
calibration. Also, it's for world axes
registration.single-ball
or one triple-ball
. And also a ball detection software. In my case, I use open-mmlab/mmpose
, it offer 1000 images/sec ball detection. The config of mmpose is not release in this code yet.