I executed the stereo calibrate function of OpenCV to calculate the rotation matrix and translation vector between two cameras. Then, I printed out the RMS error. But when I execute the code using the same parameters in another system, I get two different error values. I'm asking about the reason for having two different error values.
for i, fname in enumerate(imagesL):
Lframe = cv.imread(imagesL[i])
Rframe = cv.imread(imagesR[i])
Limg = cv.cvtColor(Lframe, cv.COLOR_BGR2GRAY)
Rimg = cv.cvtColor(Rframe, cv.COLOR_BGR2GRAY)
Lframe = cv.undistort(Limg, LcameraMatrix, LdistCoeffs, None, LnewCameraMatrix)
Rframe = cv.undistort(Rimg, RcameraMatrix, RdistCoeffs, None, RnewCameraMatrix)
#cv.imwrite("undistorted/L{}".format(imagesR[i][15:]),Rframe)
#cv.imwrite("undistorted/{}.png".format(i),Lframe)
#ImageView.frame = Rframe
#ImageView.frame = Lframe
retL, Lcorners = getImagePoints(Lframe,boardWidth, boardHeight)
retR, Rcorners = getImagePoints(Rframe, boardWidth, boardHeight)
if retL and retR:
objectPoints.append(objp)
LimagePoints.append(Lcorners)
RimagePoints.append(Rcorners)
#STEREO CALIBRATE
print("calculating stereo paramaeters")
rms, K1, D1, K2, D2, R,T, E, F = cv.stereoCalibrate(objectPoints, LimagePoints, RimagePoints, LcameraMatrix, LdistCoeffs, RcameraMatrix, RdistCoeffs, (Lframe.shape[0], Lframe.shape[1]), criteria=criteria, flags=flags)
print("root mean square erro:\n")
print("rmse = {}".format(rms))