get3DPoint to be more easily understood. See the following survey comment for the used approach of the code.
Since we change from
float mid-calculation, I couldn't rewrite everything as I wanted without breaking tests.
/* Basic Idea: * All points projecting onto a point on the image plane lie on the same * line (cf. pinhole camera model). We can determine this line in the form: * * g: x = lambda * v * * This line exists in camera coordinates. Let v be the projection with * depth 1 (i.e. v_3 = 1). Then lambda is the depth of the resulting point. * We'll continue to call lambda z instead, to show this. * We now want to determine the depth at which the resulting point has height h * in world coordinates. The transformation from cam to world is: * * W = R * C - T * W := Point in World Coords * C := Point in Cam Coords * R,T := Rotation and Translation of Cam * * By putting in our x = z * v, we get: * W = R * (z * v) - T * <=> W = z * Rv - T * <=> W + T = z * Rv * <=> (W + T)/Rv = z * We select the third row of this to solve for z. Finally g(z) is transformed * into World Coords. */
Closes #118 (closed)