matlab: calculate the degree given two points in an image

1 visualización (últimos 30 días)
zhang
zhang el 22 de Sept. de 2014
Respondida: stalin el 22 de Sept. de 2014
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?

Respuestas (1)

stalin
stalin el 22 de Sept. de 2014

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by