matlab: calculate the degree given two points in an image

조회 수: 3 (최근 30일)
zhang
zhang 2014년 9월 22일
답변: stalin 2014년 9월 22일
The goal is to rotate an image so that the bounding boxes including the hand instances are all axis aligned. Please see the following examples. The first image is the original one and the second image is the rotated version where the left hand (It's left in the image) is axis aligned and the third image is also a rotated version where the right hand is axis aligned.
Now given four points indicating the hand bounding box, we have to calculate the rotated degree. Let me take the left hand (It's left in the original image) as an example. Assuming the four points are [p1_x, p1_y], [p2_x, p2_y], [p3_x, p3_y], [p4_x, p4_y]. The line formed by[p1_x, p1_y] and [p2_x, p2_y] indicates the wrist and p1, p2, p3, p4 are clockwise. So the yellow line is formed by p1_x, p1_y] and [p4_x, p4_y].
My idea is the calculate the degree between the yellow line and the horizontal axis. For the left hand, the degree is about -10 and for the right hand the degree is about -110.
My problem is how to calculate these degrees?

답변 (1개)

stalin
stalin 2014년 9월 22일

태그

Community Treasure Hunt

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

Start Hunting!

Translated by