-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Hi,
I'm running Arch Linux with Python 3.13.3.
When I run your script, or many others out there for the Infiray P2Pro, there is an error,
index 96 is out of bounds for axis 0 with size 0
So there is some change in latest Python/Numpy which now requires manually casting the array to 16bit.
Something like this fixes the problem,
##########################
imdata_raw,thdata_raw = np.array_split(frame[0], 2)
height=192
width=256
imdata_data_size = (height, width,2)
imdata=imdata_raw.astype(numpy.uint8).reshape(imdata_data_size)
thermal_data_size = (height, width,2)
thdata=thdata_raw.astype(numpy.uint16).reshape(thermal_data_size)
##########################
and general bug, you need the release and destroy lines before the break,
##########################
if keyPress == ord('q'):
cap.release()
cv2.destroyAllWindows()
break
##########################
Save the next person some time to debug.