I have a python script that uses the calibratecamera2 method to calibrate a camera from a few views of a checker board. After a successful calibration I go after all origina
I was computing it wrong/differently. I was using this kind of formula:
But opencv uses this one:
So, if anyone is interested the code looks now like:
#Compute mean of reprojection error
tot_error=0
total_points=0
for i in xrange(len(obj_points)):
reprojected_points, _ = cv2.projectPoints(obj_points[i], rvecs[i], tvecs[i], camera_matrix, dist_coeffs)
reprojected_points=reprojected_points.reshape(-1,2)
tot_error+=np.sum(np.abs(img_points[i]-reprojected_points)**2)
total_points+=len(obj_points[i])
mean_error=np.sqrt(tot_error/total_points)
print "Mean reprojection error: ", mean_error
Final reprojection error opencv: 0.571030279037
Mean reprojection error:0.571030718956