head-pose-estimation
head-pose-estimation copied to clipboard
Video Size problem
Hello i was trying to chance the video size to:
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
but when i did that the script crashes and when it works all boxes ate distorted. How can i fix it ?
look the error:
root@jasar-VirtualBox:/home/jasar/head-pose-estimation# ./video_test_shape.py
Traceback (most recent call last):
File "./video_test_shape.py", line 162, in <module>
main()
File "./video_test_shape.py", line 121, in main
cv2.line(frame, reprojectdst[start], reprojectdst[end], (0, 255, 0))
OverflowError: signed integer is greater than maximum
You can just wrap the cv2.line()
call in a try
block.
You can just wrap the
cv2.line()
call in atry
block.
it worked, thank you. but now i have another problem. the cube around the face still distorted.
this is the distorted box
https://imgur.com/a/7TkQZBW
You’ll need to calibrate the camera (see cv2.calibrateCamera()
).
You’ll need to calibrate the camera (see
cv2.calibrateCamera()
).
i dont know how to use opencv calibrate code. could you help me?