Given a 2d picture of a rectangle distorted by perspective:

I know tha
On the question of why the results give h/w rather then w/h: I'm wondering if the expression of Equation 20 above is correct. Posted is:
whRatio = sqrt (
(n2*A.transpose()^(-1) * A^(-1)*n2.transpose()) /
(n3*A.transpose()^(-1) * A^(-1)*n3.transpose())
)
When I try to execute that with OpenCV, I get an exception. But everything works correctly when I use the following equation which to me looks more like Equation 20: But based on Equation 20, it looks like it should be:
whRatio = sqrt (
(n2.transpose()*A.transpose()^(-1) * A^(-1)*n2) /
(n3.transpose()*A.transpose()^(-1) * A^(-1)*n3)
)