Is anyone interested in panorama images?
create a panorama image with exiftool, imagemagick, MS ICE and php
preparation
(1) download free MS ICE from
http://research.microsoft.com/en-us/um/redmond/groups/ivm/ICE/I use a virtual machine (vmware with windows guest)
(2) install php, see here
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg342072/#msg342072(3) install imagemagick
(4) edit paths inside splitjpg.php
expand raw values from flir images
Variant A: radiometric jpg with embedded 16 Bit RAW (like Flir Exx)
> exiftool -b -RawThermalImage IR_*.jpg -w _%f.tif
8 image files read
8 output files created
Variant B.1: radiometric jpg with embedded 16 Bit PNG with
reverse byte order (like Flir Ex) // first extract all png
$ exiftool -b -RawThermalImage -if '$RawThermalImageType eq "PNG"' *.jpg -w %f.png
// now change byte order (Linux/Mac code)
$ for i in *.png ; do convert $i gray:- | convert -size 320x240 -depth 16 -endian msb gray:- _$i.tif ; done
Variant B.2: if you don't use pipes try Imagemagick mogrify (inside the same folder as convert)
a sample with
reverse byte order (like Flir Ex) $ exiftool -b -RawThermalImage FLIR*.jpg -w %f.png
$ mogrify -format tif -fx 'u/256+int(u*65536)%256)/256' *.png
Variant B.3: as Windows User use a *.cmd like this (untested)
@echo off
for /f "usebackq delims=" %%f in (`dir /a:-d /b /oN IR*.jpg`) do call :over %%f
goto :eof
:over
set a=%1
echo %a:~3,4%
exiftool -b -RawThermalImage %1 | convert - gray:- | convert -depth 16 -endian msb -size 320x240 gray:- RAW%a:~3,4%.tif
Attention: all tiffs are black (check image with
convert my_dark.tif -auto-level preview.jpg )
convert to larger size (and sharp it as you like)
> convert _*.tif -resize 480x -sharpen 0x1 _a%03d.png
now drop the 16 bit png to
MS ICEselect "rotating motion"
crop the image
select export Format Tiff (16 Bit)
-> save as stitch.tiff
create a real thermal flir jpg,
importend: use an image from the same camera as template (same planck values)
template is here IR_0554.jpg - the first image of serie
> php splitjpg.php -i IR_0554.jpg -r stitch.tiff -o pano1
open the new build image
pano1.jpg with
flir tools and rebuild the preview jpg image
I can't post the recreated image pano1.jpg (>1MB blocked), but it looks like here after saving the preview image in Flir Tools
variant
MS ICE is great for stitching untouched raw radiometric 16bit images witch
low in contrast is you are not satisfied with the result of ICE, you can
expand the brightness range and use another panorama software (every 16 Bit panorama tool that finds the control points)
real RAW values are in a narrow range
see here for a table with the relationship RAW and °C
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg356616/#msg356616first expand 16 Bit RAW values to _*.tif as described above
now use a sample image for analyze the temperature range (=raw values)
$ exiftool -rawval* IR_0548.jpg
Raw Value Median : 14530
Raw Value Range : 1268
raw range is here 14530 +/- (1268/2)
alternativ analyze all tif images all at once (Linux syntax)
$ identify -verbose _*.tif | grep -n3 statist | grep -e 'min\|max' | sort -k3 -n | awk '{ if (NR ==1) print} END {print}'
137- min: 13426 (0.204868)
138- max: 15962 (0.243565)
we generous chose 13000 to 16000
change brightness with
-level (minus)
$ convert _*.tif -resize 480x -sharpen 0x1 -level 13000,16000 _c%03d.png
now stitch the images with a 16 bit panorama software
I use here
Photoshop with Photomerge (select Auto and correct lens..)
save the panorama as 16 Bit grayscale image with name pano-ps.png
after then limit the brightness to original brightness with
+level (plus)
use the
same values from above
$ convert pano-ps.png +level 13000,16000 stitch-ps16.png
the last step:
create the real thermal flir jpg,
use a image from the same camera as template (same planck values !!)
$ php splitjpg.php -i IR_0556.jpg -r stitch-ps16.png -o pano1ps
open pano1ps.jpg with flir tools and rebuild the preview jpg image
compare the MS ICE panorama with a Flir Tools+ panorama
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg356910/#msg356910
generate
zoom images from embedded RAW sensor values
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg359747/#msg359747
edit 15.01.2014 : handle spaces in filenames
splitjpg.php
exec($convert." \"$raw16img\" -depth 16 -endian lsb gray:$rawimage");
edit 22.01.2014
a
360 degree panorama from john19
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg370770/#msg370770
edit 03.03.2015
new
MS ICE V 2.0 (Image Composite Editor)
see stitched sample here (with some nice
windows scripts for E4/E40)
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg620145/#msg620145discription of the
panorama image workflow:
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg621514/#msg621514for images with hot spots use a additional gamma correction for ICE 2.0
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg623573/#msg623573