I already asked here but I just wonder if this could not be done natively with numpy because I will use numpy later anyway with cv2 that reads numpy arrays.
Background is, I read 13 chunks of 13680 bytes from a usb camera until I got 177840 bytes, that is one raw frame. I do this by appending the chunks:
frame = dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
...
The list is then filled with 0-255 values and two of that values shall form one 0-65535 value. So my question is how can I convert that (I assume) uint8 LSB list to an uint16 numpy array with half size of the list.
Lets assume I have that list:
list = [3,103,3,103]
I then want a numpy array with:
[26371, 26371]
or is there a way to straight away fill a numpy array with 13 reads from my usb device so that it has 177840/2 uint16 values at the end?