imsanjoykb / Data-Science-Regular-Bootcamp

Regular practice on Data Science, Machien Learning, Deep Learning, Solving ML Project problem, Analytical Issue. Regular boost up my knowledge. The goal is to help learner with learning resource on Data Science filed.
https://imsanjoykb.github.io/
MIT License
106 stars 40 forks source link

Calculating angles opencv #134

Open imsanjoykb opened 2 years ago

imsanjoykb commented 2 years ago

def calculate_angle(a,b,c): a = np.array(a) # First b = np.array(b) # Mid c = np.array(c) # End

radians = np.arctan2(c[1]-b[1], c[0]-b[0]) - np.arctan2(a[1]-b[1], a[0]-b[0])
angle = np.abs(radians*180.0/np.pi)

if angle >180.0:
    angle = 360-angle

return angle