Hello!

I’m using the solvePnP function to get a face 3D coordinates.

The camera is properly calibrated since I plotted the x, y and z axis on the chessboard image after the calibration (with the same chessboard image) and the axis are orthonormal.

But when using the function:

(success, rotation_vector, translation_vector) = cv2.solvePnP(

self.model_points,

image_points,

camera_matrix,

dist_coeffs,

flags=cv2.cv2.SOLVEPNP_ITERATIVE,

)

The translation vector gives the face coordinates (the nose endpoint is the origin coordinate so the translation vector should give the 3d pose of the nose endpoint). The ‘z’ coordinate is correct, but the x and y don’t change when i move the face around the image. In fact, they increase / decrease as i move away/closer to the camera.

Anyone knows why might this happen?

Thanks!

PD: The face coords i’m using are:

self.model_points = np.array(

[

(0.0, 0.0, 0.0), # Nose tip

(0.0, -330.0, -65.0), # Chin

(-225.0, 170.0, -135.0), # Left eye left corner

(225.0, 170.0, -135.0), # Right eye right corner

(-150.0, -150.0, -125.0), # Left Mouth corner

(150.0, -150.0, -125.0), # Right mouth corner

]

)