geometry - matlab: calculate the degree given two points in an image -


the goal rotate image bounding boxes including hand instances axis aligned. please see following examples. first image original 1 , second image rotated version left hand (it's left in image) axis aligned , third image rotated version right hand axis aligned.

the original image , hand instances indicated 2 bounding boxes the rotated image , left hand (in image) axis aligned the rotated image , right hand (in image) axis aligned

now given 4 points indicating hand bounding box, have calculate rotated degree. let me take left hand (it's left in original image) example. assuming 4 points [p1_x, p1_y], [p2_x, p2_y], [p3_x, p3_y], [p4_x, p4_y]. line formed by[p1_x, p1_y] , [p2_x, p2_y] indicates wrist , p1, p2, p3, p4 clockwise. yellow line formed p1_x, p1_y] , [p4_x, p4_y].

my idea calculate degree between yellow line , horizontal axis. left hand, degree -10 , right hand degree -110.

my problem how calculate these degrees?

useatan2d calculate 4-quadrant inverse arctangent. line segment joining [p1_x, p1_y] , [p4_x, p4_y], do:

atan2d(p4_y-p1_y,p4_x-p1_x) 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -