I think it may be related to this ...
Shift range of raw values because that is handy for some operation or other (panorama) ...
RAW Temp Range from sensor : 0 27773
convert.exe: divide by zero `14020.368/(0.02656248*(65535*u+-1.0*7342))' @ error/fx.c/FxEvaluateSubexpression/2191.
0 <= 7342 <= 27773
we both understood why the panorama stitching can results in out of range values (logarithm)
I never used flir.php with self generated images and every user can simple edit the script for his requirements
we have here a nice fork for batch converting of images
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg350556/#msg350556 last week I posted
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg352778/#msg352778and changed my lines 173 ff for better color tables
// extract color table, swap Cb Cr and expand video pal color table from [16,235] to [0,255]
// best results: Windows -colorspace sRGB | MAC -colorspace RGB
exec($exiftool.' '.$flirimg.' -b -Palette | '.$convert.' -size "'.$exif[0]['PaletteColors'].'X1" -depth 8 YCbCr:- -separate -swap 1,2 -set colorspace YCbCr -combine -colorspace sRGB '.$embpal);
// clip BT.601 offset, the brightness is limited (16..238?)
exec($convert." ".$embpal." -level 4096,60928 ".$embpal);
Whoa - everyone has been busy this morning!
Ok - I am for sure opening the offending panoramic.jpg's in FLIR Tools and re-saving them. It does not affect every one that I have done but it does affect a few so it does not seem like a one off issue.
I do wonder if I am actually causing this or if it has to do with the fact that I am choosing to not crop the image in MS ICE before processing them though splitjpg.php?
Here is one of the images that seems to fail when running though flir.php
http://members.shaw.ca/orby/FLIR/panoramic.jpg
Of course. I'm not trying to diss you; I quite like the work you're doing. All I am trying to point out that the error message does indicate a div by zero. Why that is (user error, dev error, exploding cpu error), I don't care, div by zero is div by zero. Which was my point to begin with.
At any rate, regardless of intentions, do you see now that div by zero is occuring? What you do with this info is obviously entirely up to you because it's your code. All I try to do is point out what I think is happening, and is causing that error.
I don't think, that the bold expression goes to zero:
u is RAW Sensor value => Integer
u (0.02656248*(65535*u+-1.0*7342)
0 -195,0217282
1 1545,750399
2 3286,522525
3 5027,294652
4 6768,066779
5 8508,838906
6 10249,61103
7 11990,38316
I wrote myself, that Imagemagick u range goes 0...1 (float)
Flir formula goes out of range, if RAW value less then abs(Planck_Offset)
this only happens with self made RAW values (i.e. panorama)
I changed flir.php from
exec($convert." raw.png -fx \"($B/ln($R1/($R2*(65535*u+$O))+$F)-$Smin)/$Sdelta\" ir.png");
to
// check RAW value > |Planck Offset|
// x?y:z Imagemagick ternary conditional expression, returns value y if x > 0, otherwise z
exec($convert." raw.png -fx \"($B/ln($R1/($R2*((65535*u+$O)?(65535*u+$O):1))+$F)-$Smin)/$Sdelta\" ir.png");
tomas123 - you nailed it - all images process without any issues now.
If it were not for the fact that it's -27C outside with a windchill making it -37C (-35F for the people south of me) and my cold - I would be running around outside making pano's all night!
For now indoor ones will have to do.
another topic,
some informations to lens
What is the relationship between lens f-number and camera performance or NEdT?
http://www.flir.com/cvs/cores/knowledgebase/index.cfm?CFTREEITEMKEY=341&view=37198By assigning a value of X to variable 1, and Y to the NEdT value of the camera using optic X, then the normalized value (to f/1.0) can be calculated as: (1.0÷X)² x Y.
As an example, assume a thermal imager with an NEdT of 87mK using an f/1.6 lens.
To normalize its performance to f/1.0, the calculation is:
(1.0÷1.6)² x 0.087; or (0.625)² x 0.087; or 0.3906 x 0.087; equals 0.03398; which is 34.0mK.
This means that a camera with an f/1.6 optic has about 2.5 times less thermal sensitivity than the same camera with an f/1.0 lens.
The E8 FOV calculator is now online
http://flir.custhelp.com/app/utils/fl_fovCalc/pn/63903-0303/ret_url/%252Fapp%252Ffl_download_datasheets%252Fid%252F15Camera: 63903-0303; FLIR E8
Focal length: 6.6 mm
Resolution: 320 × 240 pixels
Field of view in degrees: 44.80
Close focus: 0.5 m (1.6 ft.)
D | 0.50 | 1.00 | 2.00 | 5.00 | 10.00 | 25.00 | 50.00 | 100.00 | m |
HFOV | 0.41 | 0.82 | 1.65 | 4.12 | 8.24 | 20.61 | 41.21 | 82.42 | m |
VFOV | 0.31 | 0.62 | 1.24 | 3.09 | 6.18 | 15.45 | 30.91 | 61.82 | m |
DOF near | 0.32 | 0.47 | 0.62 | 0.76 | 0.82 | 0.87 | 0.88 | 0.89 | m |
DOF far | 1.12 | Infinity | Infinity | Infinity | Infinity | Infinity | Infinity | Infinity | m |
IFOV | 1.29 | 2.58 | 5.15 | 12.88 | 25.76 | 64.39 | 128.79 | 257.58 | mm |
Legend:
D = Distance to target in meters and feet
HFOV = Horizontal field of view in meters and feet
VFOV = Vertical field of view in meters and feet
DOF near = Depth of field near limit in meters and feet
DOF far = Depth of field far limit in meters and feet
IFOV = Instantaneous field of view (size of one detector element) in millimeters and inches
with
http://en.wikipedia.org/wiki/Angle_of_viewI calculate a
Flir Ex sensor size of 4,5mm x 3,0mm
I don't think, that the bold expression goes to zero:
u is RAW Sensor value => Integer
u (0.02656248*(65535*u+-1.0*7342)
0 -195,0217282
1 1545,750399
2 3286,522525
3 5027,294652
4 6768,066779
5 8508,838906
6 10249,61103
7 11990,38316
I wrote myself, that Imagemagick u range goes 0...1 (float)
Flir formula goes out of range, if RAW value less then abs(Planck_Offset)
this only happens with self made RAW values (i.e. panorama)
Quite. But I decided not to rub it in (too much) at the time. That never helps for getting a solution. But now that you already fixed it (nice one!
) I can do a
told you so!!! I still haven't had enough time to mess with panorama's but your results look great. So I will surely borrowgrabstealninjabuildupon some of your php code in the future for that. Keep up the good work!
for fans of calibration values I collected Planck values of 21 Flir E4 Cameras from this forum
the values are good to estimate the valid range
$ exiftool -cameraserialnumber -cameramodel -camerapartnumber -Planck* -T * | sort -u
63900644 FLIR E4 63901-0101 14020.368 1382.9 2.5 -7342 0.02656248
63902276 FLIR E4 63901-0101 16100.758 1423.8 2.5 -7565 0.027524546
63902871 FLIR E4 63901-0101 13065.324 1362.1 2.5 -7426 0.026384041
63902926 FLIR E4 63901-0101 14616.754 1395.2 2.5 -7634 0.027545726
63903757 FLIR E4 63901-0101 15424.458 1411.1 2.5 -7669 0.027808052
63903771 FLIR E4 63901-0101 15623.854 1414.9 2.5 -7683 0.02773639
63903946 FLIR E4 63901-0101 15258.479 1407.9 2.5 -7484 0.027325163
639047xx FLIR E4 63901-0101 14469.053 1392.2 2.5 -7489 0.026838331
63905144 FLIR E4 63901-0101 15565.878 1413.8 2.5 -7702 0.028072728
63905150 FLIR E4 63901-0101 14366.53 1390.1 2.5 -7424 0.026818641
63905373 FLIR E4 63901-0101 13906.795 1380.5 2.5 -7472 0.027203841
63905649 FLIR E4 63901-0101 14911.534 1401.1 2.5 -7619 0.027500641
63906373 FLIR E4 63901-0101 14957.009 1402 2.5 -7386 0.026861623
63906375 FLIR E4 63901-0101 15038.183 1403.6 2.5 -7572 0.027612705
63906504 FLIR E4 63901-0101 14631.607 1395.5 2.5 -7614 0.027706234
63906582 FLIR E4 63901-0101 14871.23 1400.3 2.5 -7575 0.027825247
63906738 FLIR E4 63901-0101 15119.786 1405.2 2.5 -7652 0.027600825
63906800 FLIR E4 63901-0101 14187.615 1386.4 2.5 -7541 0.027075034
63906811 FLIR E4 63901-0101 14221.295 1387.1 2.5 -7543 0.027224826
63907847 FLIR E4 63901-0101 14454.367 1391.9 2.5 -7504 0.027200488
63908691 FLIR E4 63901-0101 13780.099 1377.8 2.5 -7324 0.026437858
and a fast google picture search:
$ exiftool -cameraserialnumber -cameramodel -camerapartnumber -Planck* -T ../google/* | sort -u
63900032 FLIR E8 63904-0101 15206.969 1406.9 2.5 -7453 0.027209383
63900279 FLIR E8 63903-0303 13181.149 1364.7 2.5 -7297 0.026171871
63900287 FLIR E6 63902-0202 24583.551 1546.9 1 -8056 0.030313723
63900288 FLIR E8 63903-0303 23907.283 1538.5 1 -7877 0.02959899
63900327 FLIR E5 63905-0501 14187.615 1386.4 2.5 -7322 0.026472446
63900337 FLIR E4 63901-0101 14513.211 1393.1 2.5 -7355 0.026683211
63900344 FLIR E6 63902-0202 14926.68 1401.4 2.5 -7461 0.027109843
63903538 FLIR E4 63901-0101 15597.475 1414.4 2.5 -7520 0.027363654
63903771 FLIR E4 63901-0101 15623.854 1414.9 2.5 -7683 0.02773639
63904401 FLIR E4 63901-0101 14395.749 1390.7 2.5 -7534 0.027263179
63905648 FLIR E4 63901-0101 14557.501 1394 2.5 -7524 0.027254194
63908674 FLIR E4 63901-0101 14671.283 1396.3 2.5 -7578 0.027321232
63908976 FLIR E4 63901-0101 14459.261 1392 2.5 -7533 0.027230503
interesting, there are two cams with Planck F = 1.0 on Flir Shopping Site (s/n 63900287 and 63900288):
(images from preproduction model?)
-
http://www.revizeshop.cz/fotky29448/fotos/_vyrd11_329FLIR0016.jpg-
http://www.tequipment.net/FlirMSXMulti-SpectralDynamicImaging.html with E8_Transformer_mounted_on_ceiling.jpg
Planck constants:
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.msg23972.html#msg23972boundary condition:
object distance = 0
external optics transmission = 1.0
T = B / ln(R1/(R2*(S+O))+F)
T = object temperature in Kelvins
S = 16 Bit RAW value
R1 Planck R1 constant
R2 Planck R2 constant
B Planck B constant. Value range 1300 - 1600.
F Planck F constant. Value range 0.5 - 2.
O Planck O (offset) constant. Its a negative value.
ln() natural logarithm
calibration:
- sample for low temp.
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg348622/#msg348622- Excel sheet
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg350457/#msg350457
manual of GenICam ICD
FLIR AX5 Camerahttp://www.workswell.cz/manuals/flir/hardware/Ax5_models/ICD_GenICam_ICD_FLIR_Ax5_Camera_PC.pdfTemperature (in Kelvin) = B / log(R / (S - O) + F)
S is the 14-bit digital signal value.
log(x) is the base-e logarithm of the x parameter.
R Planck R constant
B Value range 1300 - 1600.
F Value range 0.5 - 2
O (offset) constant
here comes the analysis
The tolerance of sensors are relatively little versus errors in measurement
This does not explain the large measurement errors of Ex at temperatures below 0 degrees.
see discussion
Today I took a look at the datasheet for the E4 and it says as follows.
Measurement |
Object temperature range | –20°C to +250°C (–4°F to +482°F) |
Accuracy | ±2°C (±3.6°F) or ±2% of reading, for ambient temperature 10°C to 35°C (+50°F to 95°F) and object temperature above +0°C (+32°F) |
and
There has been some discussion on the accuracy (or lack thereof) of the E4 at low temperatures.
I just found the pictures I took some time ago when we had a nippy spell here in the UK. The temperature on the evening when the pictures were taken was +2 Degrees Celsius. I measured the concrete slab and wall with a thermocouple and an IR thermometer. Both confirmed a true surface temperature of +2.5 Degrees Celsius on the wall and and +2.0 Degrees Celsius on the slab.
As can be seen from the pictures, the E4 was somewhat confused in its measurement of the brick wall and concrete slab Temperatures. Both surfaces were dry and clean.
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg348761/#msg348761
Can someone please tell me what progress has been made since the 3b resolution hack and taucher's beta2 mod? I saw reference to a zoom function etc. Are these features going to be added to the menu hack?
Well, I though cameras were calibrated in ambient 20°C. But it is not working either.
Now outside is somewhat -5°C, digital thermometer on swimming pool wall is reading +2°C and it can be true, since water in is not freezed.
When I am with camera inside, in 22°C and just slide a door a little, point it out at pool, it says -7°C and when I point on any other thing, it says like -13°C.
So I though error is caused by low temperature of camera, but this seems not be true.
Why should we replace calibration values with better ones, when camera should be calibrated from factory ? Any explanation ?
Just feel like posting a quick pano image. I cannot thank everyone enough for how much awesome has come out of this thread.
Did someone say the panoramic feature in FLIR Tools+ is not very good ?
I ask because I have Tools+ but have yet to load it. The Panoramic feature was one that I was looking forward to using. So is it cr*p and in what respects ? Any insight appreciated.
Flir Tools is a great software, but the panorama function is extremely bad if you have more then 4 images (multi row, correction of distortion, cross-fade)
try the free 30 day trial Tools+ (a part from Flir Tools)
here is a sample (stitched from 8 images , see my tutorial
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg348715/#msg348715 )
Flir Tools+ (original size)
see the ghosts images at second columns head and the balustrade
and the same images resized and converted with the
free Panorama Software MS ICE this is a relative good result for FlirTools+ (I shoot the images with
tripod)
If you have
rotated images like OrBy's engine bay then FlirTools+
Flir want sell cameras with large sensors and not software solutions.
The imprint of the color scale and a logo in an original E4 image with 80x60 sensor pixels is cheating
Thanks tomas123,
That was exactly what I was asking for. I now understand the issue a little better
I already have FLIR Tools+ as FLIR were kind enough to gift me the upgrade after I sent them feedback on my cameras and the Tools software. I have been using the standard Tools software and have not got around to upgrading it to the + version yet. It will be nice to have the recording facility as well.
Thanks again for taking the time to answer my question with those very informative pictures.
My new ebay micro USB cable came today.
To address the poor placement of the USB port and the chance to damage it since it's not re-enforced that well I picked up a cable with a 90 degree bend in it.
Fits nice and stays flush and there is only a fraction of force being put on it from the rubber flap now.
Now recording video with vdub does not feel like as much of a gamble, and since it's a 6ft'er I am not so tied to the PC.
I bought one of those leads as well. The down side for me was that it was quite hard to get a grip on the plug to remove it, thanks to the recessed socket. I was actually concerned that I was placing more force on the socket in my efforts to remove the right angled plug
Is your particular cable easy to unplug from the camera ?
Mine is very tight as well but I was thinking that adding a zip tie as a small pull tab may help. I am going to try later today.
Good idea. I found I was pulling on the strain relief too much and that caused lateral force on the socket. It really is a great pity that the E4 design team chose such an awful connector but we must do what we can with what is provided. I looked at making a micro to mini USB adapter that would permanently sit in the socket recess. Sadly there is not enough depth for the plug and sockets that I found. I have decided that if my micro USB socket fails I will do some surgery on my E4 and fit a decent connector.... it does not have to be a standard USB type so other options are available.
My FLIR PM series cameras use quality LEMO connectors but they have the down side of being VERY expensive
Quality costs
A bit OT, but a fun game to play with a hacked E4 is thermal hide and seek. Have the hider(s) wear bare feet, start where you are, then close your eyes and give them the count of ten to hide.
Their feet will leave behind big bright footprints for you follow :-)
I played this with my better half until she started tip toeing and hiding behind heat sources.
Good idea. I found I was pulling on the strain relief too much and that caused lateral force on the socket. It really is a great pity that the E4 design team chose such an awful connector but we must do what we can with what is provided. I looked at making a micro to mini USB adapter that would permanently sit in the socket recess. Sadly there is not enough depth for the plug and sockets that I found. I have decided that if my micro USB socket fails I will do some surgery on my E4 and fit a decent connector.... it does not have to be a standard USB type so other options are available.
My FLIR PM series cameras use quality LEMO connectors but they have the down side of being VERY expensive Quality costs
Zip tie pull tab helps a good bit - and if angled correctly adds more strain relief/bracing against the housing while still not coming into contact with the rubber flap!
The print view of this topic now renders a blank page, guess it got too big for SMF as well. Shame. Apart from easy in browser searching the print view is also useful for saving a local copy.
gnif was nice enough to fix this... thanks!
Can someone please tell me what progress has been made since the 3b resolution hack and taucher's beta2 mod? I saw reference to a zoom function etc. Are these features going to be added to the menu hack?
I wrote about the correct syntax of zoom enable in menu. There is a change in Mike's E4-Hack required.
Look at my footer for my post about this. Since this time I deleted the (at time) unused stuff from the file "toolbar-config_z3.xml", for clarity.
It is the actual and final hack status for me. Interesting future features are (for me) image resolution enhancement (like at zoom images) and a higher frame rate.
If you want details, please ask me.
After countless coldstarts there were malfunctions. It is recommendable to reset device settings to factory default. Then and since everything is working properly.
And after my E4 now is better than a E8, I have named E9 (in EEPROM)!
YEAH!!!!! Thanks TONS for the zoom feature!!!! SUPER EASY!!!!
I had installed the e8 hack previously and the zoom entries were already there, but the .xml file had the menu item commented out (disabled), so all I had to do was edit the <toolbar name= (etc) to enable the zoom menu item, and VIOLA!!!!! I got's the zooommmm stuff!
EXCELLENT!!! Thanks tons!