At the moment I'm trying to get image stills (with the intention to use video later) from both of the cameras so that I can do some range and resolution testing.
I've had a read of this thread and tried to implement some of the code examples given:
def on_frame(self, controller):
frame = controller.frame()
for i in range(2):
leap_image = frame.images[i]
imagedata = ctypes.cast(leap_image.data_pointer, ctypes.POINTER(leap_image.width*leap_image.height*ctypes.c_ubyte)).contents
image = PIL.Image.frombuffer("L", (leap_image.width, leap_image.height), imagedata, "raw", "L", 0, 1)
if i == 0:
elif i== 1:
This doesn't output the left and right images, and I'm not sure where it is going wrong...
I would also like to use PIL or MatPlotLib to show one (or both) of the images. Though I think this should be very straightforward once I've got a usable image array.