- Find a bounding box, where the box can be rotated, not a box that is aligned with the axes.
- Find the orientation (angle of inclination) of the long sides of the bounding box. atan2 will help you there.
- Nothing more needed, since atan2 did all the work.
How to calculate the rotation of this egg?
조회 수: 5(최근 30일)
Suppose I have this egg in figure1, standing still. But when it rotates a bit in figure 2, how can I calculate the rotation angle using MATLAB coding? Can anyone please give an idea on it?
I have attached the images in the question. (egg1, and egg2). Any suggestion from you will be much appreciated ^_^
John D'Errico 2022년 8월 9일
편집: Matt J 2022년 8월 9일
First, crop the black corders from your image fiels. Then, use ellipticalFit() from,
rotation = fobj2.angle-fobj1.angle