1 | initial version |
First, you will have to calibrate your camera to have the intrinsic parameters (focal length, principal point, distorsion coefficients):
Then, you will have to detect the balls. You can look for example to these questions:
And finally, you will have to match each ball 3D coordinate to his corresponding 2D image coordinate. The pose can be computed with: