I am considering the problem of how to (manually) change camera model parameter to make it "valid" on a rotated image. This question tackles resizing, but does not consider lens distortion.
My problem is this:
Given 3x3 camera parameter matrix + 5 radial distortion coefficients as computed by OpenCV, how do these parameters need to be adapted to be valid on an image which has been rotated by 90° clockwise?
I am reasonably sure that the focal lengths fx, fy need to be flipped, cx replaced by image.height - cy, cy by cx, but I am not sure if I can just keep the radial distortion parameters.
According to my reading of OpenCV's camera model as below, the radial distortion is symmetric around the principal point. So if all my image coordinates get remapped via image rotation, the distortion coefficients should still apply, since the distortion is a function of the distance from the intersection point of optical axis and sensor plane. Assuming no sensor tilt and only radial distortion, no recalibration of the coefficients should be necessary.
Is this assessment correct? If not, why not?
The question if prompted by the fact that undistorting a rotated image according to this procedure produces a different result from using the original orientation and original camera matrix. So I must be making a mistake.
