TemugeB / bodypose3d

Real time 3D body pose estimation with Mediapipe
MIT License
184 stars 32 forks source link

camera calibration #1

Closed hadi1376tm closed 3 years ago

hadi1376tm commented 3 years ago

Hi, love your project, may i ask what calibration toolbox did you use? is it possible to use more than two cameras with your project?

TemugeB commented 3 years ago

Hi,

I don't use any calibration toolbox but I wrote a simple guide here for calibration: link. Make sure you print out a bigger calibration pattern than the one I used and stick it to something as flat as you can find. Otherwise small errors in the calibration pattern lead to large 3D triangulation results.

If you want to use some toolbox for calibration, you can also do that. Just save camera parameters in the same format as my examples in "camera_parameters" folder or rewrite the code to read your own camera parameters. In some cases, the camera manufacturer will post the intrinsic camera matrix in their manual. You can try to look that up.

You can use more than 2 cameras but the DLT function in utils.py need to be updated. Check here for how the math for DLT works here: link.

Essentially you need to add additional entries to the A matrix here: image

This is in line 14 of utils.py. On top of this, you need to modify the bodypose3d.py (line 28) to add additional body pose estimators.

Finally, most of this camera related math is based on the pinhole camera model. Check here if you're not familiar with the concepts: link

hadi1376tm commented 3 years ago

Hi,

I don't use any calibration toolbox but I wrote a simple guide here for calibration: link. Make sure you print out a bigger calibration pattern than the one I used and stick it to something as flat as you can find. Otherwise small errors in the calibration pattern lead to large 3D triangulation results.

If you want to use some toolbox for calibration, you can also do that. Just save camera parameters in the same format as my examples in "camera_parameters" folder or rewrite the code to read your own camera parameters. In some cases, the camera manufacturer will post the intrinsic camera matrix in their manual. You can try to look that up.

You can use more than 2 cameras but the DLT function in utils.py need to be updated. Check here for how the math for DLT works here: link.

Essentially you need to add additional entries to the A matrix here: image

This is in line 14 of utils.py. On top of this, you need to modify the bodypose3d.py (line 28) to add additional body pose estimators.

Finally, most of this camera related math is based on the pinhole camera model. Check here if you're not familiar with the concepts: link

thank you very much.