Author Topic: Running Seek thermal cameras (& others?) on a Raspberry Pi  (Read 7054 times)

0 Members and 1 Guest are viewing this topic.

Offline gtizz2

  • Contributor
  • Posts: 6
  • Country: it
Re: Running Seek thermal cameras (& others?) on a Raspberry Pi
« Reply #25 on: July 28, 2020, 12:20:29 pm »
Quote
It is only the 4 lines you quoted plus the increment.
ok. So, I had modified correctly and attachments files in the previous message are correct. If you need other file let me know.

Quote
Was there supposed to be a hand or other recognizable object in the images for those pixel lists?
a hand.

Quote
Have you made other changes to the py file or the C module?
no, i have no change C module.

An experiment that you can try it's increase millisecond variable in the "label_image.after(...)" (line 976 about), from 1 to 2000 (2 sec) and see the temperature. Compare the temperature of the same object with millisec to 1. You will see that the temperatures are different.
 

Offline IwuzBornanerd

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: us
Re: Running Seek thermal cameras (& others?) on a Raspberry Pi
« Reply #26 on: August 01, 2020, 08:53:51 am »
Okay, I'll try doing this a different way.  I have edited the file myself, but went further & tried to make it so that it will work with all 3 known versions of the non-pro compacts.  I added information to the pixel list files so that I can reconstruct here whatever image there is the same way the program does.  I have tested it so it should not sit there doing nothing, even with your camera.  I have deleted the earlier instructions in order to avoid confusion for future readers.

When you run the calibration it will automatically start using the new correction factors.  This will go away, though, as soon as you switch between internal & external or exit the program, so you will still need to copy the files it creates.

I also "rethunk" the way I derive temperature & implemented that in the program.  You need to understand that Seek does not tell anyone how to determine temperature from the data that comes off the camera, so it may not be possible to get as close to correct as you need for fever detection.  At any rate you will need a calibrated heat (black body) source.  There are other issues also, as mentioned on that virus outbreak thread I linked above.

I am uploading both the program file & the configuration file.  I have changed the names so you won't have to worry about overwriting the original program.  When you run this it will write out a bunch of files on startup.  Please zip those along with your new pixelcal.txt & refframe.txt files AND an image pixel list file and post the .zip here so I can see what all is going on.  After doing that you can edit line 27 of the config file to say "no" to writefiles to keep it from writing all those files every time you run the program.

NOTE:
You will need to edit the config file to have your pixel1atT and ambientT values.  The pixel1atT value is now the warmed-up value NOT the cold-start value!  Use the value that you read off the program when it has stabilized.

My  hope is that this will at least get you a clean image with somewhere-in-the-ballpark temperatures.  The temperatures will be about 20F high when starting the camera "cold" and get closer to correct after 10-20 minutes.

I expect to have to revise the program some more & will delete this version when I post an update.
« Last Edit: August 01, 2020, 09:28:47 am by IwuzBornanerd »
I am not opposed to exercise, unless it is an exercise in futility.
 

Offline gtizz2

  • Contributor
  • Posts: 6
  • Country: it
Re: Running Seek thermal cameras (& others?) on a Raspberry Pi
« Reply #27 on: August 03, 2020, 09:33:58 am »
Hi IwuzBornanerd,
I ran your script but it ends with an error:
Code: [Select]
curvebase =2000  curvemax = 20430  curvetop = 16177  divisor = 2

diffshouldbe =-781

Traceback (most recent call last):
  File "Rpi2SeekA1.py", line 991, in <module>
    show_frame(first=True)
  File "Rpi2SeekA1.py", line 946, in show_frame
    disp_img = get_image()
  File "Rpi2SeekA1.py", line 615, in get_image
    s =  str(ix) +"\t"  +str( (diffcurve[ix][1]<<8) + diffcurve[ix][0]) +"\n"
IndexError: index 16430 is out of bounds for axis 0 with size 16430


In practice, in code line 615 (before the while condition) index variable is 16499 and curvbase  is 16430, so when accessing to curvbase with index, an overlof occurs.
 

Offline IwuzBornanerd

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: us
Re: Running Seek thermal cameras (& others?) on a Raspberry Pi
« Reply #28 on: August 03, 2020, 02:38:47 pm »
The problem is that you have a camera I don't know about.  This is why I need you to post those startup files so that I can see what information is stored on the camera.  This is now the 3rd change in the curve in frame 9 & it goes beyond the 16430 max I was "assuming" from the 2nd revision.  The 2nd rev ends at "curvetop" of 15234, not 16177.  My test condition of delta of 30 might not be good anymore either.  Thanks much for posting that line of program output!

Sadly, though, there is an error in the code regardless, as it looks like the line
            curvebase = curvebase/divisor
needs to be immediately after the "if(curvebase > 3000): divisor = 2" line at line 568
.

Edit: No, that's not quite it either.

 That is one thing I can't test here because I don't have that revision of camera.  Once you do that you will need to change the diffcurve array size to something larger but I can't say how large because I don't have YOUR frame 9!

Going back to bed now.  :)

After breakfast edit:  After looking at it some more, yes the 16430 is a problem (I thought I had dimensioned diffcurve at 17000 as in my other code), but the problem may not be 16499, the real problem is as I stated above because curvetop is an unexpected 16177 & I wonder right now what the real curvemax is.  I need to see frame9.  So if the program did not get frame9 written before it stopped, go ahead & get rid of that "+1" in the line 614 while or change the if writefiles >0 in 611 to >10 so it won't try to write that file.  After all the revisions by Seek this really needs to be done in a way that handles unknown limits & I may not be up to that.
« Last Edit: August 03, 2020, 10:36:06 pm by IwuzBornanerd »
I am not opposed to exercise, unless it is an exercise in futility.
 

Offline IwuzBornanerd

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: us
Re: Running Seek thermal cameras (& others?) on a Raspberry Pi
« Reply #29 on: August 04, 2020, 09:02:55 am »
Further comment to my edits above...
I remember now that I added that "+1" in line 614 because I wasn't getting the last diffcurve value in the file, so I just let it increment another 1 either not thinking clearly or thinking that the array was dimensioned to 17000 as in my C code.  Either way this was a quickie fix & was not the right place to fix it.  I probably do that sort of stuff too much while in troubleshoot mode.  Sorry to subject you to that here.  I probably should not even be trying to write code in my current half-braindead mode anyway.

I came up with the bright idea of reading in a frame9 file instead of processing the frame9 from the camera as a way of enabling me to test different frame9 scenarios and started coding it but it got more & more complicated.  And due to nice weather this week I now need to curtail my computer time until miserably hot weather returns next week, so frame9 will have to wait.

In practice, in code line 615 (before the while condition) index variable is 16499 and curvbase  is 16430, so when accessing to curvbase with index, an overlof occurs.

So if you saw what the problem was why didn't you just increase the array size &  see if it got any farther?  ;D  No use dragging this out over more days.
I am not opposed to exercise, unless it is an exercise in futility.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf