# Revision history [back]

I think this is because image distortion is expressed with respect to the center of an image. If the image dimensions are odd numbers, then the position of the image center is always in the same point regardless of the orientation. If the numbers are even (like in your case), then the position of the center depends on the image orientation.

In case of your image the dimensions are 526x390. Image center is probably at [223, 195], but these coordinates correspond to two different points when the image is flipped or not.

You see the differences in the corners, because distortion impact is directly proportional to the distance to the image center.

If you want to make sure, take some image whose dimensions are both odd numbers, and try your code on it. If there is no difference between the results regardless of the order of operations, you've got the answer.

I think this is because image distortion is expressed with respect to the center of an image. image as the position of undistorted pixel is dependent on the parameter r, which is the distance to the image center:

If the image dimensions are odd numbers, then the position of the image center is always in the same point regardless of the orientation. If the numbers are even (like in your case), then the position of the center depends on the image orientation.

In case of your image the dimensions are 526x390. Image center is probably at [223, [263, 195], but these coordinates correspond to two different points when the image is flipped or not.not, which affects the r parameter for particular pixels.

You see the differences in the corners, because distortion impact is directly proportional to the distance to the image center.center. The further from the distance, the more distorted the image is.

If you want to make sure, take some image whose dimensions are both odd numbers, and try your code on it. If there is no difference between the results regardless of the order of operations, you've got the answer.