As i see it, what you need to do is simple triangle geometry.
You need the angle of the camera (camera perspective I think), and the size of the base opposed to the angle (target object width).
Suppose you have a triangle with vertices A, B and C, A,B being the bace verts and C being the camera position
.
The distances are a=BC, b=AC and c=AB
You are given that:
AB(base) = Object width (for example 1000)
angle at C = camera perspective (for exemple 60);
I assume thie triangle is a Isosceles Triangle as this is how camera view usualy works…
With this info, you can calculate the angles at A, B:
angle at B=(180°-60°)/2 = 60°
angle at A=(180°-60°)/2 = 60°
Now you have the angles.
Using the sine rule, you can calculate the other sides:
a/sinA=b/sinB=c/sinB
a/sin(60)=b/sin(60)=1000/sin(60)
After calculating the sides, use something like the formula:
Area = (1/2)*c*b*sin(A) to get the area.
Lastly:
Area = Base*Height—-> Height=Area/1000
When you have the height you have the needed distance from camera.
Simple exemple… Hope it works!