lincolnhard / head-pose-estimation

Real-time head pose estimation built with OpenCV and dlib
MIT License
580 stars 173 forks source link

finding head pose looking direction #30

Open SaddamBInSyed opened 4 years ago

SaddamBInSyed commented 4 years ago

@lincolnhard thanks for your work.

I am using the below code to find the head pose looing direction. (left, right, top, bottom)

y_value = float(str("{:7.2f}".format(euler_angle[1, 0])))
                x_value = float(str("{:7.2f}".format(euler_angle[0, 0])))
                if y_value >= 20:
                    print("looking left")
                elif y_value <= -20:
                    print("looking right")

                if x_value >= 20:
                    print("looking down")
                elif x_value <= -20:
                    print("looking up")

and seems it is fine.

if anyone knows better formula please share here.