The script uses ImageMagick for identifying clouds in pictures of the Kiruna All-sky camera. The script tries to differentiate between clouds and aurora in images and computes a cloudiness fraction which is tested against a threshold value.
- ImageMagick (tested with ImageMagick 6.9.1-2 Q16 x86_64)
- Download a number of images ready for processing.
- Place the script into the same folder.
- From the terminal execute
./bacc.sh
(make sure the script is executable). - The script will output which images are cloudy and which are not and report the cloudiness factor.
You can change parameters such as the thresold in the script itself.
Threshold value above which an image is considered cloudy. Keep in mind that this is a circle in a rectangular black image, therefore a good portion of the image remains black even when fully clouded. Fraction values range from 0.00 to 0.30ish (default 0.0004).
Based on the HSV values clouds and aurora can be differentiated. These values can be obtained by manually inspecting an image using the color picker in any popular image procesing program (e.g., GIMP). Make sure to get the HSL values (not RGB, HSV, HSB etc).
Name | Range | Aurora | Clouds |
---|---|---|---|
(H)ue | [0,360] | [80,95] | [20,40] |
(S)aturation | [0,100] | [30,70] | [50,95] |
(L)ightness | [0,100] | [10,100] | [10,100] |
It is adviced to use broad ranges and tweak accordingly by inspecting the intermediate results (result1.png
/result2.png
).
All files in the same folder as the script that match *.JPG
(see for f in *.JPG
statement) will be processed by the script. Adapt this expression to your needs.
- Patrik Karang for the inspiration for the script and providing examples.
- Kiruna All-sky Camera (http://www.irf.se/allsky/rtascirf.php)
- HSL definition for ImageMagick (http://www.wizards-toolkit.org/discourse-server/viewtopic.php?f=1&t=25660)
Possible improvements include:
- Improving the cloudiness score, by correcting for the margins around the circular image.
- Calcultating an edge cloudiness score, by applying a circular mask (smaller than the picture by an edge distance) and again correcting the score.
- Better handling of input files through commandline options.
Copyright 2015 by Jacco Geul jacco@geul.net
Licensed under GNU General Public License 3.0 or later.