libseek-thermal
libseek-thermal copied to clipboard
Temp info getting
A useful link I used to get some info: https://github.com/lod/seek-thermal-documentation/wiki/Temperature-Values
Thanks for your contribution. I will merge your code after my holidays.
Hi Andrey,
I tried your contribution concerning temperature on Maarten Project. However, i still can't understand how you managed to get these informations. Can you please explain a bit more your method and eventually how you did to obtain your linear trend line on excel.
Thank you in advance for your help.
@AchrefDash I'm curious, was the information you got meaningful? Did it match real world temperatures?
The method is trivial: I have googled out that raw pixel values from camera are absolute. This means they contain actual temperature data, expressed in Kelvin value with some linear representation. Thus, I made some experiments to figure out linear law for these values, based on ice, boiling water and human body. The values for trend line are expessed in my source code comments.
Hi @undera Thank you for your quick response.
So, the results I have are almost similar to the results obtained with Seek App with a coefficient in addition. After doing some tests on human body, the soldering iron, lamps, electrical cabinets and others, I got an average coefficient of 0.8 to get almost the same Seek App tempetures values but this approach remains very approximate depending on the tests conditions.
I modified your version a little bit to show the max/min hot/cold points with colored circles in the image and show the temperature with one decimal point at that location. It's not very nice but it works as a proof of concept. My problem at this point is that the shown temperatures are a bit too high. But i have to verify this with a known reference temperature.
Example image:
Source file: seek_viewer.zip
The ways to visualize the point may vary. Indeed, the biggest question is the formula of translating raw value to temperature. We need more data, probably, to calibrate it.
just as a side note, Seek Thermal states that
All Seek imagers are generally accurate within 5 degrees C above or below the reading (http://www.eevblog.com/forum/thermal-imaging/seek-compact-pro-temperature-readout-issue/msg1403982/#msg1403982)
I got a new CompactPro last week that had a offset of ~6-7°C after 5! minutes... There is a huge variation in the readings from device to device. But I noticed once you know when the readings has stabilized over time its quite constant and you could use an offset. That adjustable offset is what I really miss with the official Seek App...
@undera can you please explain how you came to this line of code?
return (0.0171156038 * x + 37) - 273;
Where do you got the 0.0171156038 and the 37 from?
Did you got it from Excel as curve function?
@pauledd Yes, I took it from excel function.
@undera thanks, just one more question: you state
// 330C => 603K => 32768 raw (known upper limit, full 15 bits - 2^15)
in your seek_viewer.cpp. Can you pls explain where you got this 15bits from? As I was reading through the eevblog I've only seen that the cam outputs 14bits, then stretched to uint16... how does the 15 come into play?
I don't remember exactly. In my experiments, I used candle as maxed temp value, and probably got this 32768 raw number.
ah, okay. I will try that too :)
Added more things to this PR:
- added device temp sensor data getting to investigate further topic of absolute values getting (#29)
- max/min position pointers (thanks @rainer38, but had to modify code to support rotation and scaling)
made seekpro to have 15fps by default
What do you mean with this? Isn't the Seek Pro restricted to ~9fps?
@pauledd Discrard what I've wrote there, I found I was confused
Now I also have added gradient on the side and central point measurement, hoping we'll collect some more data on raw values.
Ok, my latest hypothesis is that formula is simple linear calculation, assuming 330C is max of 14bit value. Would be cool to gather some more observations.
Values from app when camera self-temp is ~26C:
rmin,rmax,central,devtemp: 15060 15708 15298 6577 / min-max-center: 30.3 43.4 35.1
Same setup, camera cooled down to ~18C:
rmin,rmax,central,devtemp: 16384 17002 16932 6723 / min-max-center: 57.0 69.4 68.0
And after 10minutes:
rmin,rmax,central,devtemp: 14654 15584 15147 6582 / min-max-center: 22.2 40.9 32.1
Which makes me conclude that camera self-temperature highly relates to values measured. I'll look for a way to use devtemp
plus linear 14bit value to 330C
hypothesis together...
I have spent a lot of time calibrating dev sensor versus known temperatures, and I came up with compensation model that should react on device temperature and compensate it. I have added my Excel file calculations.ods
for reference.
@undera Great work! However, from my Seek Compact, I read measurements like
rmin,rmax,central,devtempsns: 15556 15828 15628 4252 min-max-center-device: 890.3 895.8 891.8 591.7
. Did you do your research with a CompactXR or CompactPRO? I suspect there could be different formulae for each model.
I have only one CompactPro for Android device.
@undera Good to know. So I want to do experiments with a Seek Compact and share my findings.
Id did a series of calibration experiments. In the process, I wrote a viewer which stores the raw data in 16bit images for later processing. Unfortunately, finding a function to infer the actual device temperature from the raw value leaves me stumped. @undera How did you find the NTC information? Did you open your camera? I gave up and resorted to a linear approximation which seems to be exact within ±1°C after the device has warmed up. I published the adjustments in the temp-info_compact in my fork.
During my experiments, I also noticed some vignetting. After the device warmed up, the edges of an approximately uniform temperature surface appear 1.6 °C warmer than the centre.
Example: (normalized)
This shows, the vignette increases with device temperature, too.
vignetting is a known thing for cameras, it is known that Seek uses software way to compensate it in their apps.
The problem of simple linear approach is that device's temperature will affect measurements, and I perfectly see that in my experiments.
My approach of making sure sensor has certain temperature is simple: I turn camera off in a room with air conditioner set to certain temp, I let it quite of time to stabilize temp, then I quickly turn it on and record values. I also use trustworthy thermometer to tell what was the temp around it (and inside it).
My approach of making sure sensor has certain temperature is simple: I turn camera off in a room with air conditioner set to certain temp, I let it quite of time to stabilize temp, then I quickly turn it on and record values. I also use trustworthy thermometer to tell what was the temp around it (and inside it).
Thats not practical at all if you want a quick location-independent measurement without doing heavy cool-down calibration measurements and waiting for the sensor to finally settle after 30 minutes (that's what my device takes). My guess is Seek uses some kind of forward prediction math with a predefined characteristic curve for that thermal-sensors that it produces good temp values just right after powering up... just my 2 cents ;)
Yes, I have same feeling that they have some formula they know. I was playing around thermistor formulas, assuming internal sensor is thermistor. I still believe that having right guess and some measurements would give good enough results.
Thank you for your input.
(…) I turn camera off in a room with air conditioner set to certain temp (…)
Unfortunately, I currently have no options to produce environments with a range of stable temperatures wide enough to explore the non-linear parts of the assumed NTC reading. For the non-PRO variant of the Seek Compact, we are left with a linear approximation best fitting for a device temperature of whatever raw value of 4236 is standing for. Which is better than nothing, I guess.
Thats not practical at all if you want a quick location-independent measurement (…)
Fortunately, I want to do a long-term fixed-location measurement (for quick measurements on the go, I'd actually use the official app).
Hello, Any updates on this topic ? I have the feeling that the sensor values changed. I tried your code but I get tempertatures around 80 degrees. How do you get the values used in this fct ?
double device_sensor_to_k(double sensor) {
// formula from http://aterlux.ru/article/ntcresistor-en
double ref_temp = 297.0; // 23C from table
double ref_sensor = 6616.0; // ref value from table
double beta = 200; // best beta coef we've found
double part3 = log(sensor) - log(ref_sensor);
double parte = part3 / beta + 1.0 / ref_temp;
return 1.0 / parte;
}
Thank you in advance
Nothing has changed. My impression is that people get different temperature because my formula is somehow wrong. But I have just one camera, so I have no way to validate this. Nobody brought any reliable measurements to compare, still.