How to improve PnP pose estimation?

I’m doing pose estimation of an ArUco marker with a OAK-D Pro. I’m using

params.cornerRefinementMethod = cv.aruco.CORNER_REFINE_SUBPIX

detector = cv.aruco.ArucoDetector(aruco_dict, params)
[corners, ids, _] = detector.detectMarkers(self.cvImg)


_, rvecs, tvecs = cv.solvePnP(objPoints, corners[i], self.mtx, self.dist)

If i rotate the cam just around it’s y axis the translation vector should stay rather constant. I rotated the cam around 13° and the tvec is changing from
[[ 0.01710385]
[ 0.33584111]]
[ 0.31829297]]

this means the error is around 5 cm in the x-axis. Is there a way to further improve the pose estimation? Thanks in advance!

and which axis is that, relative to the camera, and why do you think it’s that axis, and why should the translation vector not change from that?

the translation vector describes the marker’s pose, in the camera frame. when applied, this transformation transforms marker-local coordinates into camera-local coordinates.

Thanks for your reply. That’s what I mean with y axis rotating the cam around the vertical axis.


I thought the translation vector should stay the same if i just rotate the camera without translating it - but that’s just the case in the marker frame but not in the camera frame?

I got confused I thought the tvec are given in the marker frame, so the tvec should indeed stay constant when transforming the tvec into the marker frame (RotationMatrix * tvec)?

What do you mean with when applied?