head-pose-estimation icon indicating copy to clipboard operation
head-pose-estimation copied to clipboard

Video Size problem

Open TheMasterRoot opened this issue 6 years ago • 6 comments

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 ?

TheMasterRoot avatar Jan 07 '19 15:01 TheMasterRoot

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

TheMasterRoot avatar Jan 09 '19 14:01 TheMasterRoot

You can just wrap the cv2.line() call in a try block.

naftalibeder avatar Jan 09 '19 17:01 naftalibeder

You can just wrap the cv2.line() call in a try block.

it worked, thank you. but now i have another problem. the cube around the face still distorted.

TheMasterRoot avatar Jan 09 '19 18:01 TheMasterRoot

this is the distorted box

https://imgur.com/a/7TkQZBW

JasarOrion avatar Jan 09 '19 18:01 JasarOrion

You’ll need to calibrate the camera (see cv2.calibrateCamera()).

naftalibeder avatar Jan 09 '19 20:01 naftalibeder

You’ll need to calibrate the camera (see cv2.calibrateCamera()).

i dont know how to use opencv calibrate code. could you help me?

TheMasterRoot avatar May 13 '19 17:05 TheMasterRoot