Hello, I’m working on a project to determine the pose of a 3D array of markers, shown below.
Camera matrix : [[627.44372826 0. 354.49962245] [ 0. 625.94738517 235.52154125] [ 0. 0. 1. ]]
Distortion Matrix : [[-0.00227971 0.0592749 0.00193853 -0.00431801 -0.05491578]]
Object points: np.array([(-25, -22, 0), (-25, 22, 0), (0, 0, -15), (25, -22, 0), (25, 22, 0) ], dtype=np.float32)
I’m able to successfully detect the image points using SimpleBlobDetector
and pass those points into solvePnpRansac
in the same order they are passed in the object points.
When I inspect the output translation vector however, the x, y, and z do not seem to be correct. Specifically, the Z-value is off by about 5x. edit - after fine-tuning my HSV mask the output tvec z-distance 0.5 the actual distance
I calibrated my camera using the chessboard scaled to the size of the chessboard squares (21.8mm) using:
objp = np.zeros((6*9, 3), np.float32) objp[:, :2] = np.mgrid[0:9, 0:6].T.reshape(-1, 2)*21.8
.
Can someone give me an assessment of my approach and/or validate what I’m seeing? I’m just kind of using a ruler to estimate, but I’m not getting valid numbers.
Thank you.