Extracting the 3D coordinates of a moving object from a video Take a look at these two pictures, which are stills from a video which demonstrates magnus effect in football:


I want to extract the coordinates of this ball in 3D space from this video. These are the steps I intend to use:


*

*The ball is initially 1 m away from the camera. I can use this information to calculate the distance from camera in the later frames. (with it's angular diameter)

*A football is 22 cm across. This can be used to calculate a quantity which I'm calling anglePerPixel(which is 22/100/<initial width in pixels>. It can be used to calculate the angle of elevation of the ball from the horizon.

*Imagine a plane perpendicular to the ground and the camera direction, which cuts the camera view in two equal parts. It will appear as a line in the camera view. We can measure perpendicular distance of the ball from this plane in ball units, by measuring how many footballs we can fit between this plane and our football.
These 3 independent coordinates could be used to calculate and plot the path of this ball, i.e., if this procedure was correct, which it isn't.
I'm confident that the first step is correct. The second step yields incorrect results(about half of the expected value). The third step also looks correct to me.
How do I fix the second step? (and any mistake in the other two steps, if there's any)
Edit:
It's possible to use the method of second step to calculate the elevation as well, but it won't be very accurate since the camera is about 30 cm above ground and is aimed about 3-4 degrees above the horizon.
Maybe we could calculate the position of ball relative to the direction of the camera (instead of the ground) and try to translate it once it's done.
 A: There are a couple of possible errors associated with step 2. For instance, the formula for the angle of elevation actually gives the tangent of the angle, not the angle per se, so it would be accurate for small angles only. But this error should be insignificant and could be easily corrected by changing the formula.
Another possible source of error in step 2 could be due to the elevation of the camera.
Based on the first picture, we can infer that the camera is mounted above the equatorial plane of the soccer ball. This is because the line of horizon (the edge of the field) is above the center of the ball. If the camera was mounted at the same level as the center of the ball, the line of horizon would be below the center of the ball. This is illustrated on the diagram below with a blue line.  

As a result of such placement of the camera, the estimated elevation angle could be greater than the actual elevation angle. The angles, $\theta '$ and $\theta$, are shown on the diagram below. 

Even if the camera was properly aligned with the ball, the estimated angle would not be quite accurate, due to the $1$ meter offset between the ball and the camera, but the error here would not be significant.
I think that for estimating the elevation of the ball, you could use the same method you are using for estimating the lateral displacement of the ball in step 3. You could use ground as a reference plane: the lower the position of the camera, the smaller the error will be.  
A: For step 1, which you did not describe, you need to include a factor that takes into account that you are not measuring actual angles but a size in a picture. The geometry is like the picture below (sorry for the terrible drawing).
if we call $R$=distance to the ball, $R'$=distance to the picture, $S$=size of the ball, $S'$ size of the ball in the picture, then you have:
$\theta=S/r=S'/r'=>S/(R/ \cos \alpha)=S'/(R'/ \cos \alpha)$
so that
$R=SR'/S'$
with the initial distance you can calculate $R'$, and then $R$ for any distance, using the formula $R=SR'/S'$. S is the arc, but is a reasonable approximation to the ball's projection, but you can make it more precise if you want
For step 2 you can calculate the height but you need either the height of the camera, $y_0$, or the distance from the camera to the bottom of the picture, R_0. If $y$ is the actual height of the ball from the floor, $y_0$ the height of the camera, $R$ and $R'$ the same as before,  $y'$ and $y'_0$ are the height of the ball in the picture (in pixels) and the height in the picture of an object at the height of the camera (which is independent of the distance), then you have:
$\frac{y-y_0}{R}=\frac{y'-y'_0}{R'}$ (1)
with 
$y'_0=y_0R'/R_0$   (2)
Step 3 is the same as step (2) only that here $y'_0=0$


