Difference between revisions of "Meteor M1 Colorizer"

From NebarnixWiki
Jump to navigationJump to search
(added removal of colorant to most dropout areas)
Line 2: Line 2:
  
 
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 automatically visualize the data in a more human readable way.  
 +
 +
==Results==
 +
{|
 +
! Raw channels
 +
!
 +
! Colorized image
 +
|-
 +
| [[File:2015_11_24_LRPT_08-43-43.s_345-rectified.jpg|500px]]
 +
| =>
 +
| [[File:2015_11_24_LRPT_08-43-43.s_345-rectified_colored.jpg|500px]]
 +
|}
  
 
==Imagemagick Script==
 
==Imagemagick Script==

Revision as of 09:24, 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.

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