leapuvc icon indicating copy to clipboard operation
leapuvc copied to clipboard

leap_uvc python scripts return identity camera parameters

Open HyperLethalVector opened this issue 4 years ago • 1 comments

As issue describes, the leapuvc python scripts return identity camera paremeters,

they shouldn't be? image

HyperLethalVector avatar Sep 27 '20 11:09 HyperLethalVector

In order to get the calibration data on Win it is necessary to use DSHOW backend. However, it looks like using DSHOW backend currently breaks other things so after you get the calibration data create new MSMF capture in regular way. Following should work.

import cv2
import leapuvc

capResolution = (640, 480)
cam = cv2.VideoCapture(0 + cv2.CAP_DSHOW)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, capResolution[0])
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, capResolution[1])
calibration = leapuvc.retrieveLeapCalibration(cam, capResolution)
cam.release()

print(calibration)

JurajVincur avatar Oct 15 '20 15:10 JurajVincur