Hi,
I have good experience working with OpenCV in both C and Python.
I can provide you a code in Python which can measure the rotation of the object about a center, (or) the pitch, roll and yaw of the object in 3 dimensional space.
But I need to fully understand a requirement with a discussion first, before I can propose my methods for the solution. Looking forward to talking to you in chat.
With Regards,
Anthony