Row not aligned when rectifying images with stereoRectify

Hi,

I am try to rectify stereo images. I displayed 8 rows and 11 columns calibration pattern on my laptop and used the code from this github repo to calibrate and rectify images.
When I plot results of rectification with my chessboard images, rows are perfectly aligned in both sides.

Some information about calibration :

95 stereo pairs for calibration

Rotation matrix :
[[ 0.9984 -0.0103 -0.0549]
[ 0.0074 0.9985 -0.0533]
[ 0.0554 0.0528 0.9971]]

K_left [[949.6753 0. 639.5 ]
[ 0. 949.6753 479.5 ]
[ 0. 0. 1. ]]

K_right [[949.6753 0. 639.5 ]
[ 0. 949.6753 479.5 ]
[ 0. 0. 1. ]]

Flags I used in stereoCalibrate :
flags = ( cv2.CALIB_ZERO_TANGENT_DIST + cv2.CALIB_FIX_PRINCIPAL_POINT
+ cv2.CALIB_FIX_ASPECT_RATIO + cv2.CALIB_SAME_FOCAL_LENGTH )

Flags I used in stereoRectify :
flags= cv2.CALIB_ZERO_DISPARITY, alpha = 0

Calibration images are 1280 x 960 (width x height)

Reprojection loss = 0.33

However, when I rectify new images (ie, not calibration images), rows from left and right images are not aligned. :

( Remark : these images are 960 x 540 so I added a black padding in each sides to make them 1280 x 960, as calibration images. So the black corners are from images and not from any value of alpha in stereoCalibrate).

I don’t understand what is wrong. (The aformentionned reprojection error of 0.33 seems high to me, but I don’t know what should I change to get lower error. ). Do you know where could be the problem ? (calibration images, flags) ? Let me know if you need additionnal information.

Thank you in advance for your replies.

looks like left/right might be mixed up.

don’t trust anyone’s code just because it’s on github and has been pushed onto PyPI for easy installation.

related: camera calibration - OpenCV : rows not aligned after stereo rectification - Stack Overflow