Given the 4 corners of two QR codes on a photographed sheet of paper, can we get a deskewed rectangular image?
The solution is to use an "homography" / aka "projective transformation" (see this PDF, page 16).

Here is a working code showing how to do it with Python + OpenCV.