The objectives of the experiment are to develop a system for land categorization and classification system of satellite photos from Raspberry Pi NoIR camera. Such technologies (but on a bigger scale) would also allow analysing unknown land and easy constructions of rudimentary maps on less discovered places on Earth or analysing land of newly discovered planets, as well as navigation systems based on land images.
Our algorithm uses OpenCV’s Python library and Numpy to process images. For every photo, it uses colour-based classification functions to generate grayscale masks for clouds, oceans, and land, as well as edge detection. We decided to use OpenCV’s threshold with a value between 185 and 255 for cloud detection, ocean mask was detected with checking if red and green components of each pixel were smaller than blue one, and land mask additionally checked that all three components are similar enough.
Program takes all photos in directory, process each of them in separate process, and saves grayscale masks to new directories. We also made additional program which uses Matplotlib to display all masks as coloured overlays on original photo.
Program is written in Python 3 and requires numpy
, cv2
and matplotlib
modules.
All raw photos need to be stored in raw
directory relative to main.py
. It is recommended that directory only contains both Python scripts, raw photos and virtual environment if needed. All other directories will be created on run and will be overwritten.
To analyse photos, you need to run python main.py
. The program uses multiple processes and it may use 100% of your CPU so it is recommended to close all other programs and to not use your computer while the program is running. After program is finishes, various other directories will be created and will contain masks of original photos.
To view analysed photo run python display.py [filename]
, where [filename]
is filename of photo you want to view, without any directory path. This will open Matplotlib window with original photo, overlayed with clouds, ocean and land masks.
Other masks are currently unused, but it may be used in the future.