I have a camera matrix $P$ which defines a projective transformation $\mathbb{P}^3 \rightarrow \mathbb{P}^2$. In the former space there is a plane $[ x|\pi^Tx=0 ]$. The image of the plane under $P$ does not preserve angles. 
How can I find a transformation $H : \mathbb{P}^2 \rightarrow \mathbb{P}^2$ such that a right angle in the plane remains a right angle after applying $H \circ P$?


The application for this problem is extracting texture from a photo of a planar surface where the surface and camera locations are known. 



Rectifying texture from image
By picking orthogonal coordinates in the given plane you can make an angle preserving projective map $\mathbb{P}^2\to\mathbb{P}^3$ whose image is the given plane. Composing with your camera mapping, you now have a mapping $G\colon\mathbb{P}^2\to\mathbb{P}^2$ that does not preserve angles. Let $H=G^{-1}$. The composition $HG=I$ clearly preserves angles; hence so does $HP$ when restricted to the given plane.


(Reverse the order of composition if you follow the usual computer graphics convention of letting matrices act on the right.)


