But your camera is a non-fast frame unit, correct? OR does the Seek app identify it as Seek Compact PRO FF (like it does with my camera)?
Yes, its the normal CompactPro (ID 289d:0011)
I currently trying to figure out whether my frames are valid ones or whether where to look for the actual image in it. I only concentrate on the nomal frames with id=3.
I got a
function from stackoverflow that converts all pairs of uint8 values to into a single uint16 value (I guess this is what happens in the correct_endianness function in the libseek-thermal lib). Of cause the size off the array is then half 177840 = 88920...
while (status != 3):
frame = []
send_msg(0x41, 0x53, 0, 0,'\x58\x5B\x01\x00')
frame = dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
frame += dev.read(0x81, 0x3570, tout)
status = frame[4]
if (status == 3):
frame16 = array.array('H', ((j << 8 ) | i
for (i,j)
in zip(frame[::2], frame[1::2])))
print "frame_uint8=", frame[:32]
print "frame_uint16=", frame16[:32]
Here I've printed two lines with 32 positions for the same id=3 frame, the first is the unprocessed uint8 frame, the second is the uint16 array with the data from the uint8 array. Now in the uint16 data I can see that the frame_count byte is at index frame16[1]=33, and the frame_id byte is at frame16[2] = 3, as expected... the index for those two changed to the half number (the frame_id in the uint16 was at frame[4]):
frame_uint8= array('B', [121, 5, 33, 0, 3, 0, 0, 0, 33, 0, 31, 25, 152, 58, 0, 0, 0, 0, 0, 0, 48, 0, 37, 55, 0, 0, 0, 0, 0, 0, 0, 0])
frame_uint16= array('H', [1401, 33, 3, 0, 33, 6431, 15000, 0, 0, 0, 48, 14117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
I am not shure if I can simply throw the frame16 data into an cv2::Mat/PIL::whatever to display the image or whether I need to crop the raw dimensions to the 320x240, and if so, I am not sure how to do it. The writer of
this python code just put the array into "calimg = Image.fromstring("I", (208,156), ret9, "raw", "I;16")" without cropping it to 207x154 for the "Compact"...
I know the C++ code in the libseek-thermal lib contains all the steps but I am quite awkward in understanding it
. Thats why I take it to pieces here in python