Magic Lantern Forum

Using Magic Lantern => General Help Q&A => Topic started by: billacat on January 22, 2013, 09:58:46 PM

Title: Raw Temperature values
Post by: billacat on January 22, 2013, 09:58:46 PM
Does anybody know how the Raw Temperature values in ML relate to actual temperatures (Centigrade or Fahrenheit)?
And where can one find out temperature tolerances for the Canon 600D?

Thanks
Title: Re: Raw Temperature values
Post by: a1ex on January 22, 2013, 11:53:42 PM
http://groups.google.com/group/ml-devel/browse_thread/thread/725ae6f424dd2917

=> grab a thermometer and measure it, then let us know.
Title: Re: Raw Temperature values
Post by: billacat on January 23, 2013, 12:08:29 AM
Thanks for the links Alex.
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 12:22:19 AM
http://groups.google.com/group/ml-devel/browse_thread/thread/725ae6f424dd2917

=> grab a thermometer and measure it, then let us know.

exiftool seems to decode this whole stuff

Code: [Select]
edgar@linux-pusc:~/testordner> exiftool -CameraTemperature  test.CR2
Camera Temperature              : 22 C

So, no thermometer would be necessary :)

Edgar
Title: R: Raw Temperature values
Post by: nanomad on January 23, 2013, 12:26:08 AM
Interesting..
Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 01:03:02 AM
I tried my best to make sense of the structure of exiftool, but I can't find a table or alike which could help us. I assume that the value in the exif already is converted to Celsius.

We can either collect some data by taking photos, checking the temperature in exif, compare to the raw data and create some tables.
Or try to find the tables (or function) somewhere in the firmware.

Or I simply overlooked something in exiftool. (this statement made this post quite useless again ^^)
Title: Re: Raw Temperature values
Post by: 1% on January 23, 2013, 04:46:10 AM
this is worth working out as 6d seems to display similar temps to 600d

probably would be pretty simple if the temp is converted. record them, take a pic. shoot some video, record new temp, take a pic. it doesn't fluctuate that much so if you get a few values you might be able to figure out the rest.
Title: Re: Raw Temperature values
Post by: Walter Schulz on January 23, 2013, 09:04:01 AM
Seems to be stored quite simple:

Exiftool -CameraTemperature source.jpg
Camera Temperature              : 19 C

Exiftool -CameraTemperature -b source.jpg
19

Verified by changing EXIF
Exiftool -CameraTemperature=10 source.jpg

Exiftool -CameraTemperature source.jpg
Camera Temperature              : 10 C

Exiftool -CameraTemperature -b source.jpg
10


Exiftool -CameraTemperature=-10 source.jpg

Exiftool -CameraTemperature source.jpg
Camera Temperature              : -10 C

Exiftool -CameraTemperature -b source.jpg
-10

Ciao, Walter
Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 10:30:04 AM
Okay, I'll collect some data then. My 600D is already outside in order to cool down. Should be a few minus degrees Celsius right now, so we can get data over a wide span. I think 3-4 samples with different temperatures should be good enough do to an okay regression analysis.

When that works out as I hope, I might do the same with a 1100D.

EDIT: okay, lets say round about 10 samples.
Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 11:35:01 AM
Okay, here are the values for the 600D:

raw128130133140157160170176182
7813162424293436

EDIT: a linear regression analysis results with: -57.608+0.516x

I think something like x/2-58 might be what we are looking for

EDIT EDIT:
I just checked what regression models would fit. Even though a logarithmic has a RMSE of 1.173, the linear has 1.211, which appears to be it. So yea, we found it, I think..
Title: Re: Raw Temperature values
Post by: nanomad on January 23, 2013, 03:00:56 PM
Given this "new" discovery, it's worth re-checking the 550D values and see how they compare
Title: Re: Raw Temperature values
Post by: 1% on January 23, 2013, 04:18:54 PM
6d appears to display the same values so i think that scale is the same for all new cameras. i have to run them together and see if they display the same temps at the same time to be sure.
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 06:45:59 PM
Look at this command:

Code: [Select]
edgar@linux-pusc:~/testordner> exiftool -CameraTemperature test.CR2 -v3 | grep CameraTemperature
  | | | | CameraTemperature = 150
  | | | | CameraTemperature = 150

Maybe, these are the raw-data. But I´m not shure about..

Edit:

Yes, looks like raw:

Code: [Select]
| | | | CameraTemperature = 150
  | | | | - Tag 0x000c (2 bytes, int16s[1]):
  | | | |     063c: 96 00                                           [..]

Edgar
Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 07:00:36 PM
that command results in the temperature in Celsius here.. but looks like raw data indeed. What camera is that from?
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 07:11:52 PM
EOS600d

Edgar
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 07:16:27 PM
maybe, you forgot the -v3 option, which does the binary stuff

Edgar
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 08:05:17 PM
I wrote a little bash-script:

Code: [Select]
#!/bin/bash

for all in $HOME/testordner/testreihe/*.CR2
do
  exiftool -CameraTemperature $all >> $HOME/testordner/testreihe/log
  exiftool -CameraTemperature $all -v3 | grep CameraTemperature >> $HOME/testordner/testreihe/log
  echo >> log
done

Then I took some pictures and looked into the exifs with the bash-script. this is the result for my 600d
Code: [Select]
Camera Temperature              : 21 C
  | | | | CameraTemperature = 149
  | | | | CameraTemperature = 149

Camera Temperature              : 24 C
  | | | | CameraTemperature = 152
  | | | | CameraTemperature = 152

Camera Temperature              : 27 C
  | | | | CameraTemperature = 155
  | | | | CameraTemperature = 155

Camera Temperature              : 28 C
  | | | | CameraTemperature = 156
  | | | | CameraTemperature = 156

Camera Temperature              : 31 C
  | | | | CameraTemperature = 159
  | | | | CameraTemperature = 159

Camera Temperature              : 34 C
  | | | | CameraTemperature = 162
  | | | | CameraTemperature = 162

Camera Temperature              : 34 C
  | | | | CameraTemperature = 162
  | | | | CameraTemperature = 162

Camera Temperature              : 36 C
  | | | | CameraTemperature = 164
  | | | | CameraTemperature = 164
 
Edgar
Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 08:08:12 PM
You are right.. the values fit somewhat to what i read manually when doing the tests. The test with 128 is 125 in the exif.
I don't know, maybe the value in the ML menu might now be fully up to date. Can someone please confirm that?

That script is great, now we just need to collect a bunch of pictures from different cameras and do regression analysis on the data.

Important edit: I noticed quite a little difference between your and my data around 130, but 36° is 182 here (from ML menu), 164 for you (in exif). Should we trust the exif or the ML menu?
PS: what I read to be 182 in ML menu is 164 in exif too. I took the picture while the camera was set to film, so almost no delay which could give a chance to cool it down.
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 08:24:44 PM
Hmm, if the exif-data and the data of ML are the same, then it´s only necessary to substract 128 to get °C. If they are not the same, then I don´t know...

Edgar
Title: Re: Raw Temperature values
Post by: escho on January 23, 2013, 09:02:15 PM

Important edit: I noticed quite a little difference between your and my data around 130, but 36° is 182 here (from ML menu), 164 for you (in exif). Should we trust the exif or the ML menu?
PS: what I read to be 182 in ML menu is 164 in exif too. I took the picture while the camera was set to film, so almost no delay which could give a chance to cool it down.

In my case is 164 in exif 164 in ML. See this list:

Code: [Select]
ML.. 145 146 148 156 158 159 161 164
exif 149 152 155 156 159 162 162 164

In the first 4 cases, the temperature was rising quite quickly, maybe that is the difference here

Edgar

Title: Re: Raw Temperature values
Post by: SDX on January 23, 2013, 09:11:13 PM
Okay, well, that convinces me.

x-128, that's easy
Title: Re: Raw Temperature values
Post by: nanomad on January 24, 2013, 09:29:01 AM
1100D seems to be using x-128 too. I'll have to check the 650D and the M but x-128 makes perfect sense from a metadata point of view as it allows temps in a range from -128C to 128C using a uint8_t
Title: Re: Raw Temperature values
Post by: SDX on January 24, 2013, 04:18:21 PM
We are able to print on the screen while doing a bulb exposure, aren't we? Would be great if we could put some useful information there (such as the temperature).
Title: Re: Raw Temperature values
Post by: escho on January 24, 2013, 09:59:40 PM
I looked at sourcecode of exiftool:

Code: [Select]
#..............................................................................
# common CameraInfo tag definitions
.
.
.
my %ciCameraTemperature = (
    Name => 'CameraTemperature',
    Format => 'int8u',
    ValueConv => '$val - 128',
    ValueConvInv => '$val + 128',
    PrintConv => '"$val C"',
    PrintConvInv => '$val=~s/ ?C//; $val',
);

Edgar
Title: Re: Raw Temperature values
Post by: a1ex on January 24, 2013, 10:38:00 PM
So... the 550D measurements were not accurate?
Title: Re: Raw Temperature values
Post by: escho on January 24, 2013, 11:35:29 PM
I looked at my old pictures. 450d fits to x-128

Edgar
Title: Re: Raw Temperature values
Post by: a1ex on January 24, 2013, 11:45:45 PM
Right now, my 5D3 says 152, the 5D2 says 151 and the wall thermometer says 25. Makes sense.