프로젝트
GitHub에서 보기
jerryhouuu/Face-Yaw-Roll-Pitch-from-Pose-Estimation-using-OpenCV
소개
얼굴 랜드마크(왼쪽 눈, 오른쪽 눈, 코, 왼쪽 입꼬리, 오른쪽 입꼬리, 턱)를 사용해 자세(요, 피치, 롤)를 추정합니다.
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalFace-Yaw-Roll-Pitch-from-Pose-Estimation-using-OpenCV
Description
This work is used for pose estimation(yaw, pitch and roll) by Face landmarks(left eye, right eye, nose, left mouth, right mouth and chin). Roll:+90°:-90°/Pitch:+90°:-90°/Yaw:+90°:-90°, like the picture below:

The order of numbers is ROLL, PITCH, YAW:
Preprocessing
- I fine-tune the MTCNN into the output of 6 landmark feature points, reference and make some adjustments in this article 'Head Pose Estimation using OpenCV and Dlib'.
- Because the MTCNN's eyes are the middle of the position rather than the corner of the eye, so we modify the world coordinate(model point) from original to (-150.0, -150.0, -125.0)# Left Mouth corner/(150.0, -150.0, -125.0)# Right mouth corner
- Modify the camera matrix's focal_length from original to img_size[1]/2 / np.tan(60/2 * np.pi / 180).
Step
- imgpts, jac = cv2.projectPoints(axis, rotation_vector, translation_vector, camera_matrix, dist_coeffs)
- modelpts, jac2 = cv2.projectPoints(model_points, rotation_vector, translation_vector, camera_matrix, dist_coeffs)
- rvec_matrix = cv2.Rodrigues(rotation_vector)[0]
- proj_matrix = np.hstack((rvec_matrix, translation_vector))
- eulerAngles = cv2.decomposeProjectionMatrix(proj_matrix)[6]
- pitch, yaw, roll = [math.radians(_) for _ in eulerAngles]
- pitch = math.degrees(math.asin(math.sin(pitch)))
- roll = -math.degrees(math.asin(math.sin(roll)))
- yaw = math.degrees(math.asin(math.sin(yaw)))
References
관련 프로젝트 살펴보기
불러오는 중…