Calculate length of photographed object given known width Sorry, I feel like this should be simple, but I'm stumped and I've searched everywhere.  Is it possible to calculate the length of a photographed object in the attached scenario if you know the width and assume it is a perfect rectangle?

 A: You have to know more parameters.
Imagine you're raytracing the rectangle, your viewplane has a certain x, y size value. In general y / x == WINY / WINX. WINY and WINX being the size of your window in pixels. 
Image explaining the very basics of raytracing in case you don't know about it : 

So the eye is your camera, the viewplane is where you cast the image (so the rectangle will appear as in your image here(trapezoid)).
You cast rays to the viewplane to see if they hit an object, if they do, you display the color of the hit object on the viewplane.
Imagine a sheet of paper behind the viewplane, that is your photographied rectangle and when one of the red lines(rays) hit that sheet then it is displayed on the viewplane.
When you have casted enough rays to get a sufficient resolution, you display the viewplane, and then you have your image.
Now imagine you reduce y(viewplane height) but let x, WINY and WINX the same value, the apparent size of l will change but the apparent size of foreground and background w won't change.
I guess you need to know more about the camera specifications
A: I take $l$ and $w$ to be the measured length and width of the unphotographed rectangle. The length (height) of the photo-rectangle (trapezoid) is the perpendicular distance between the lower and upper bases of the trapezoid. Multiply that by the ratio of the measured lower base to the measured upper base to get the corrected length of the photo-rectangle, i.e. the length its image would have if the photo were taken with all parts of the object at a distance from the camera equal to that of the lower base. Then get $l$ by multiplying the corrected photo-length by the ratio of the rectangle's true width to the measured lower base in the photo, its "true" photo-width.
A: If we assume the rectangle to be horizontal (and the picture vertical) at relative height $z$ of the optical axis and distance $d$ of the viewing plane, the coordinates of the two right corners in the image are given by
$$\left(\frac{fw}{2d},-\frac{fz}{d}\right),\left(\frac{fw}{2(d+l)},-\frac{fz}{d+l}\right)$$ where $f$ is the focal length.
If $f$ is unknown, you only have access to the ratio $\dfrac lf$.
