Angle measurement from video discontinuity problem

24 views (last 30 days)
AC
AC on 20 Dec 2024 at 10:45
Commented: AC on 20 Dec 2024 at 13:22
I want to measure the angle of a pendulum as it moves between specific limits, but I have a video of its motion ranging from 0 to 330 degrees. I’ve tried measuring the angle in MATLAB, but the results are inconsistent and appear to jump. Red one is what i want. How can I fix this?
My goal is to measure the pendulum angle smoothly across the full 360 degrees, similar to what is shown in this YouTube video. This is the initial phase of the project, and I’m looking for help. If anyone is interested and help, we could collaborate.

Answers (1)

Divyajyoti Nayak
Divyajyoti Nayak about 2 hours ago
Hi @AC,
On running the code and trying to debug it, I found that the 'jump' in angle values is because of the values of 'x1','y1','x2' and 'y2'. The calculation of the angle is coded with an assumption that 'x1' and 'y1' are the center of the pendulum about which it is rotating but that is not true in each iteration.
angle = atan2d(y2 - y1, x2 - x1); %Assuming x1 and y1 are center coordinates
On printing out the values of the four coordinates, you can see that after some time 'x2' and 'y2' contain the value of the center. Hence, there is a "jump" in angle calculated as it is being calculated in a different direction.
  1 Comment
AC
AC 43 minutes ago
So, How can i fix this? If you see youtube video it is measured all the angles..

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!