Difference between revisions of "Meteor M1 Colorizer"

From NebarnixWiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
==Problem statement==
 
==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.  
+
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 [http://nebarnix.com/amigos/images/gal.php automatically] visualize the data in a more human readable way.
 +
 
 +
==Idea==
 +
 
 +
The thought occured to me that 5 contains raw temperature information, and could use used to colorize the image blue (because blue feels colder) but that the channel 4 contains information about where we might find water ice. Therefore, a teal overlay (because glacial ice seems to be kinda tealish??) could signify that there is water ICE here, not just cold. I don't know how sound the idea is, but it certainly does seem to color the images in a way that makes sense in this way, that is, snow and whispy northern clouds are teal. Also, if the raw image was slightly golden tinted it would give the warmer areas a warmer feel (cold areas would get the gold tinted strongly blue to cancel out the effect).
  
 
==Results==
 
==Results==

Latest revision as of 09:31, 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.

Idea

The thought occured to me that 5 contains raw temperature information, and could use used to colorize the image blue (because blue feels colder) but that the channel 4 contains information about where we might find water ice. Therefore, a teal overlay (because glacial ice seems to be kinda tealish??) could signify that there is water ICE here, not just cold. I don't know how sound the idea is, but it certainly does seem to color the images in a way that makes sense in this way, that is, snow and whispy northern clouds are teal. Also, if the raw image was slightly golden tinted it would give the warmer areas a warmer feel (cold areas would get the gold tinted strongly blue to cancel out the effect).

Results

Raw channels Colorized image
2015 11 24 LRPT 08-43-43.s 345-rectified.jpg => 2015 11 24 LRPT 08-43-43.s 345-rectified colored.jpg

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 -fuzz 3% -fill white -opaque black -negate -channel r -separate -quality 10 redchan.png
echo "Dirty IR..."
convert $1 -fuzz 3% -fill white -opaque black -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 -fuzz 3%% -fill white -opaque black -negate -channel r -separate  -quality 10 redchan.png
echo Dirty IR...
convert %1 -fuzz 3%% -fill white -opaque black -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