# Revision history [back]

So, the answer is, it's complicated.

The big problem with the laser or radar device is pointing it at the ball. Lasers are, obviously, very narrow, and you'll need that for position. That radar gun probably won't work on golf balls, so you'd need a better one, and it is probably narrow too.

For two cameras, there are three main factors driving accuracy. All assuming you can track the ball. If you can't reliably detect and track the ball in both cameras, you're not going to be able to do it at all.

1. Are the cameras widely separated? If the cameras are looking at the target from 90 degrees apart, errors in one don't correlate with errors in the other. If they're close together looking in the same direction, a small error is amplified.
2. Camera position and angular direction. This comes in two flavors, precision and accuracy. Position mostly matters in accuracy. If your camera positions are off by 3 feet, your estimate will be off by 3 feet. For angular measurements, you need both. Accuracy is a constant bias. Imagine drawing two lines that intersect. Now from the start of one, turn your straight edge a bit, and no matter where they now intersect, it's wrong by some amount. Precision is a cone around where you think the line is, where the object could be. This is where resolution matters.
3. Algorithms. Some algorithms introduce bias of their own, or can remove noise. Kalman filtering a series of position measurements can reduce the noise and give you an estimate of velocity at the same time.

With the right choice of algorithm, you can mitigate 1 and 2 by adding more than two cameras. The noise and biases will (hopefully) cancel out as you add more cameras, giving you a more accurate result.

If you want to play with things, I have an OpenCV contrib module that I am (slowly) working on. Right now it calculates 3d position or position and velocity from a series of camera measurements. You input time, the location of the object in the image, camera matrix, distortion matrix, camera translation and rotation, and the size of the image. With a moving camera (or more than one stationary camera), it can give position or position and velocity.