leapuvc icon indicating copy to clipboard operation
leapuvc copied to clipboard

Device calibration is not working

Open MichaelSom opened this issue 5 years ago • 1 comments

When I run the python examples with Python 3.6.7: In leapuvc.py in retrieveLeapCalibration, there is the property knocking routine that retrieves the device calibration data and writes it to a struct. In the for-loop, the sharpness is correctly set on my device, however, the cap.get(cv2.CAP_PROP_SATURATION) always reads the same value, namely the one I set when I do cap.set(cv2.CAP_PROP_SATURATION, [value]).

When I run the python examples with Python 2.7.15: The cap.set(cv2.CAP_PROP_SHARPNESS) is also not working and doesn't set the value at all. Additionally, I get the following error in the line after the knocking:

Traceback (most recent call last): File "stereoExample.py", line 6, in leap = leapuvc.leapImageThread(source=2, resolution=(640, 480)) File "/home/michi/anyexo_ws/src/any_haptics/leapuvc/Python/leapuvc.py", line 33, in init self.calibration = retrieveLeapCalibration(self.cam, self.resolution) File "/home/michi/anyexo_ws/src/any_haptics/leapuvc/Python/leapuvc.py", line 175, in retrieveLeapCalibration calibrationArray = struct.unpack('BBBBIffffffffffffffffffffffffffffffffffffI', bytes(calibrationBytes)) struct.error: unpack requires a string argument of length 156

I also tested to retrieve the calibration data natively with v4l2-ctl --device=2 --set-ctr=sharpness=100 Again, the setting works fine, but the saturation value is not changing.

Additional Info: Linux 4.18.0-17-generic opencv-python Version: 4.1.0.25

MichaelSom avatar May 16 '19 12:05 MichaelSom

I believe I see the simular issue on both Windows and Linux.

The false calibration data blocks the rectify option. On linux the rectified result from CameraControlExample.py is:

Screenshot-LeapUVC-rectify

msuencksen avatar Dec 22 '22 12:12 msuencksen