I have been working on ArUco detection and tracking to get the location of moving camera which is at a distance from the marker(static marker). I implemented solvePnP to achieve the pose of the marker and ultimately got the pose of the of the camera (Z axis distance). I followed this How to calculate the angle from rotation matrix to get the yaw, roll and pitch of the camera. The roll angle results are stable. But I see the yaw angle results are unstable. I have the following questions: 1. As the distance of the camera from the marker increases would there be any instability in detecting the corners? I am using a fairly large sized marker. 2. The yaw angle results seem to be alright when camera is closer to the marker. But as the distance increases the "Z" axis flips giving me the inverted sign values beyond a certain point. How do I go about this? 3. Are there any other possible ways to calculate the yaw angle of the camera which would lead me to stable results?
Any help would be greatly appreciated.