Calculate distance to a hill from photography I'm wondering if it's possible to determine the distance to the base of a hill from a photograph.
Using the camera specs including focal length and sensor size, I'm ok with working out the size of objects roughly in the plane of the camera aperture. However, it looks like a sloping plane that is oblique to the plane of the camera changes things.
In the figure below, I know the height of the hill, the slope of the hill, and the height at which the picture was taken. I can get phi, the field of view of the camera.
The camera is not held level to the ground; the vertical midpoint of the photo is not at the height of the camera.
The red lines show the extent of the image, and the aqua lines show the projection of the hill on the image.

The photo looks something like:

It feels like this is an unconstrained problem; I can't quite figure it out. Any pointers would be really helpful!
 A: 
I don't know how modern cameras work, but I assume that the line $PQ$ (which is perpendicular to the centre line $XC'$) is effectively the image. $BO=D$ is the desired unknown. $\phi,H,h$ are known. But $\alpha,\beta$ need to be found.
It is not hard to get: 
$C'P=C'Q=XC'\tan(\phi/2)$
$C'T=XC'\tan\beta$
$C'B'=XC'\tan(\phi/2-\alpha)$
$XC'=XQ\cos(\phi/2)=OL\sec(\phi/2-\alpha)\cos(\phi/2)=(D+H\cos\theta)\sec(\phi/2-\alpha)\cos(\phi/2)$
Presumably from the photo you can get the ratios of $C'T,C'B',C'X$ to $C'P$, so that should give you three equations in three unknowns ($D,\alpha,\beta$). But before I go any further, have I understood the problem correctly? And is $X'$ the point you marked on the photo as "Location of camera height"?
If that is indeed a possible approach, solving looks messy, so almost certainly needs a numerical approach.
A: The problem is well constrained.
From the two green lines on the photo, as well as the camera's field of view, you can determine the visual angle $\alpha_0$ of the slope as seen from the camera.
Given a distance $D$ from the slope, you can determine the visual angle $\alpha(D)$ of the slope as seen from a camera at distance $D$ from the slope, since you know the position of that camera and both ends of the slope. Note that $\alpha(D)$ is strictly monotonous in $D$. Your aim is now to find $D_0$ such that $\alpha(D_0) = \alpha_0$. This can be numerically solved using half-interval search or Newton's method (Newton's method will converge if $D_0 > 0$ and your initial value for $D$ is $0$).
