Difference between revisions of "Meteor M1 Colorizer"

From NebarnixWiki
Jump to: navigation, search
(New page)
 
(added windows batch file)
Line 4: Line 4:
  
 
==Imagemagick Script==
 
==Imagemagick Script==
 +
===BASH Script for *nix systems===
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
Line 28: Line 29:
  
 
rm -f redchan.png bluechan.png greenchan.png intermediate.png tealoverlay.png blueoverlay.png
 
rm -f redchan.png bluechan.png greenchan.png intermediate.png tealoverlay.png blueoverlay.png
 +
</pre>
 +
 +
===batch script for windows systems===
 +
<pre>
 +
echo off
 +
echo File %1
 +
echo Separating Channels:
 +
echo Mid IR...
 +
convert %1 -channel b -separate -quality 11 bluechan.png
 +
echo Thermal IR...
 +
convert %1 -negate -channel r -separate -quality 10 redchan.png
 +
echo Dirty IR...
 +
convert %1 -negate -channel g -separate -quality 10 greenchan.png
 +
 +
echo Creating thermal mask...
 +
convert redchan.png ( +clone -fill blue -colorize 100%% ) -compose multiply -composite -quality 10 blueoverlay.png
 +
 +
echo Creating dirty-IR mask...
 +
convert greenchan.png ( +clone -fill teal -colorize 100%% ) -compose multiply -composite -quality 10 tealoverlay.png
 +
 +
echo Applying thermal mask..
 +
convert ( bluechan.png -level 5,100%% -fill gold -colorize 9%% ) tealoverlay.png ( -level 70%%,90%% greenchan.png ) -compose screen -composite -quality 11 intermediate.png
 +
 +
echo Applying dirty-IR mask...
 +
convert intermediate.png blueoverlay.png ( -level 40%%,90%% redchan.png ) -compose screen -composite -level 5,92%%,1.5 -quality 95 %~n1_colored.jpg
 +
 +
echo Done! Saved as %~n1_colored.jpg
 +
del -f redchan.png bluechan.png greenchan.png intermediate.png tealoverlay.png blueoverlay.png
 
</pre>
 
</pre>

Revision as of 08:02, 24 November 2015

Problem statement

Meteor_M1 lives again (for now at least), but the '345' channels (1.6-1.8um, 3.5-4.1um, 10.5-11.5um) are very strange looking when assigned as raw RBG channels. I needed a way to automatically visualize the data in a more human readable way.

Imagemagick Script

BASH Script for *nix systems

#!/bin/bash
echo "File $1"
echo "Separating Channels:"
echo "Mid IR..."
convert $1 -channel b -separate -quality 11 bluechan.png
echo "Thermal IR..."
convert $1 -negate -channel r -separate -quality 10 redchan.png
echo "Dirty IR..."
convert $1 -negate -channel g -separate -quality 10 greenchan.png

echo "Creating thermal mask..."
convert redchan.png \( +clone -fill blue -colorize 100% \) -compose multiply -composite -quality 10 blueoverlay.png
echo "Creating dirty-IR mask..."
convert greenchan.png \( +clone -fill teal -colorize 100% \) -compose multiply -composite -quality 10 tealoverlay.png

echo "Applying thermal mask.."
convert \( bluechan.png -level 5,100% -fill gold -colorize 9% \) tealoverlay.png \( -level 70%,90% greenchan.png \) -compose screen -composite -quality 11 intermediate.png
echo "Applying dirty-IR mask..."
filename=$(echo "$1"|tr '.' '_')
convert intermediate.png blueoverlay.png \( -level 40%,90% redchan.png \) -compose screen -composite -level 5,92%,1.5 -quality 95 ${filename}_colored.jpg
echo "Done! Saved as ${filename}_colored.jpg"

rm -f redchan.png bluechan.png greenchan.png intermediate.png tealoverlay.png blueoverlay.png

batch script for windows systems

echo off
echo File %1
echo Separating Channels:
echo Mid IR...
convert %1 -channel b -separate -quality 11 bluechan.png
echo Thermal IR...
convert %1 -negate -channel r -separate -quality 10 redchan.png
echo Dirty IR...
convert %1 -negate -channel g -separate -quality 10 greenchan.png

echo Creating thermal mask...
convert redchan.png ( +clone -fill blue -colorize 100%% ) -compose multiply -composite -quality 10 blueoverlay.png

echo Creating dirty-IR mask...
convert greenchan.png ( +clone -fill teal -colorize 100%% ) -compose multiply -composite -quality 10 tealoverlay.png

echo Applying thermal mask..
convert ( bluechan.png -level 5,100%% -fill gold -colorize 9%% ) tealoverlay.png ( -level 70%%,90%% greenchan.png ) -compose screen -composite -quality 11 intermediate.png

echo Applying dirty-IR mask...
convert intermediate.png blueoverlay.png ( -level 40%%,90%% redchan.png ) -compose screen -composite -level 5,92%%,1.5 -quality 95 %~n1_colored.jpg

echo Done! Saved as %~n1_colored.jpg
del -f redchan.png bluechan.png greenchan.png intermediate.png tealoverlay.png blueoverlay.png