First I would recommend doing the calculations found
here in order to convert your pixels to actual angles, as the relationship between pixels and angles is not exactly linear.
From there what we did is we calculated the vertical angle taken up by the target and found this angle at various distances in .5 foot increments and using Excel found a curve that fit our points very well. This has worked extremely well and using the curve of best fit we are now able to measure distance to the target with less than an inch of error.