Scaling intrinsic matrix between two image resolutions
I have two camera images A (480x640) and B (1080x1920). A & B represent the same image, just different resolutions.
I have the intrinsic matrix for image A and run solvePnP on this image to calculate a pose for the camera. I then send this pose to Unity for display. The background image in unity is image B and my marker is close but always off centre.
To my knowledge the intrinsic values for the two camera images aren't quite the same and this is why my marker is off from a translation perspective. If I manually offset the principle point I can correct the issue by hand and position the marker perfectly.
How can I modify the intrinsic values to know that the output of solvePnP will result in pose suited for display on image B.
If I am not wrong, you simply scale the focal length and the optical center proportionally to the resolution change. In your case, however, you also change the aspect ratio, so I am not sure if you should scale fx, cx and fy, cy independently?