I am using camera to trace one black marker on blue ball as shown in image below.
I can detect marker position on top of ball image reliably but would need to know how to calculate ball rotation angles based on marker location.
When marker is in the middle as shown both angles should be 0 degrees. When marker is only half visible at left edge as shown horizontal angle should be -90 degrees. I understand calculating angles from 2D-image is non-linear, near the edge similar movement in pixels means bigger change in rotation than in the middle but I just can't come up with the formula.