Meteor M1 Colorizer

From NebarnixWiki
Revision as of 21:53, 23 November 2015 by NebarnixWikiSysop (talk | contribs) (New page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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

#!/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