PnP Sources of Error

I have a fairly new Intel Realsense D405 Stereographic camera. It provides a color frame and a depth frame, as well as camera intrinsics for each.

I am using OpenCV to compare the depth of a checkerboard (6x7 intersections), but I am not getting good consistency with the Realsense’s Depth. For instance, at a physically ruled distance of about 17.2cm, I get the approximately same from the Realsense Depth. However, based on what flags I invoke for the solver, I get ~12.7cm or ~27.5cm. I have also tried nonlinear refinements.

retval, rvec, tvec = cv2.solvePnP(self.target, corners.squeeze(axis=1), self.K, self.D, useExtrinsicGuess=False, flags=cv2.SOLVEPNP_IPPE)

Any suggestions on how to get my error to 1mm or less?

Nevermind, I was running cv2.findChessboardCorners(img, (r#,c#)) instead of (c#,r#). Now my projection error is 0.15 versus double digits.

1 Like