20 lines
427 B
Python
20 lines
427 B
Python
|
import cv2
|
||
|
|
||
|
c = cv2.VideoCapture(2)
|
||
|
# if not ding this we only have jittery 10fps
|
||
|
c.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"MJPG"))
|
||
|
|
||
|
# set camera resoltion
|
||
|
c.set(3, 1280)
|
||
|
c.set(4, 720)
|
||
|
|
||
|
for i in range(15):
|
||
|
_,im = c.read()
|
||
|
cv2.imwrite('calibrate/left-{:06d}.png'.format(i), im)
|
||
|
cv2.imshow('left', im)
|
||
|
|
||
|
if cv2.waitKey(1000) & 0xFF == ord('q'):
|
||
|
break
|
||
|
|
||
|
c.release()
|
||
|
cv2.destroyAllWindows()
|