Commit e4ac6c72 authored by Niels Fuchs's avatar Niels Fuchs
Browse files

Update README.md

parent cd56ca2b
......@@ -14,6 +14,8 @@ The classification scheme has been particullarly designed to study melt ponds an
## Workflow
Caution: `_P2` in the file name indicate that the script was still developed in python 2 syntax, and has not yet been converted like the `_P3` marked scripts.
### Data preparation
#### Image georeferencing
......@@ -31,9 +33,9 @@ Vignette correction files were obtained from laboratory measurements at the outl
The classification is based on the assumption that surfaces belonging to the same class/subclass always have a comparable appearance, independent of the incident light and camera settings. Therefore flight surveys need to be splitted up into shorter flight legs with mostly constant incident light conditions. These flight legs are then individually corrected in their image brightness. To do so, copy all raw images of a specific flight leg into a directory.
We first convert these into linearly converted and optimized .ppm files. They will be refered to as **lin_opt** files. In this step we adjust the dark current and saturation value, deactivating automatic rotation, gamma correction, white balance correction and colorspace conversion as well as reduce chromatic aberration and noise. Furthermore, a diskrete vignette correction is applied on the data.
Execute the python script [01_Raw_conversion_and_vignette.py](01_Raw_conversion_and_vignette.py). The script requests all image filepaths as argument `{imagefilepath}/*.CR2`.
Execute the python script [01_Raw_conversion_and_vignette.py](01_Raw_conversion_and_vignette_P2.py). The script requests all image filepaths as argument `{imagefilepath}/*.CR2`.
Subsequently, brightness correction is applied to the **lin_opt** images to convert them to **lin_corr** files. At the same step, **lin_corr** and **lin_opt** images are converted to compression free JPEG to be used in Metashape.
Run script [02_Brightness_correction.py](02_Brightness_correction.py) with passing the directory that contains all .ppm images as argument (Python2.7 version, needs to be translated to be used in P3). Then, using polygons, mark one representative ROI of open water and one of smooth, non-directly reflective snow. If possible, in the centre of the picture. If there is none, switch to the next image. As soon as both ROIs are selected, the script starts to prepare brightness corrected images. Change the image file path in Metashape and recompile the orthomosaic.
Run script [02_Brightness_correction.py](02_Brightness_correction_P2.py) with passing the directory that contains all .ppm images as argument (Python2.7 version, needs to be translated to be used in P3). Then, using polygons, mark one representative ROI of open water and one of smooth, non-directly reflective snow. If possible, in the centre of the picture. If there is none, switch to the next image. As soon as both ROIs are selected, the script starts to prepare brightness corrected images. Change the image file path in Metashape and recompile the orthomosaic.
#### Orthomosaic
......@@ -43,7 +45,7 @@ Export the orthomosaic from Metashape in a projected UTM grid as geotiff without
#### Pixelwise classification
The classification script [03_Classify.py](03_Classify.py) uses a random forest classifier trained with PS106 data to classify sea ice geotiffs into ten (+1) different classes. Because of the abundance of sediments on the MOSAiC floe, the scheme has been subsequently extended to include the snow/ice class "sediments" if requested. Since the classifier is stored in a python pickle which cannot be exchanged across different platforms, it needs an initialisation when it is used for first time on a computer. All necessary training data for the initialisation is stored in included datasets.
The classification script [03_Classify.py](03_Classify_P3.py) uses a random forest classifier trained with PS106 data to classify sea ice geotiffs into ten (+1) different classes. Because of the abundance of sediments on the MOSAiC floe, the scheme has been subsequently extended to include the snow/ice class "sediments" if requested. Since the classifier is stored in a python pickle which cannot be exchanged across different platforms, it needs an initialisation when it is used for first time on a computer. All necessary training data for the initialisation is stored in included datasets.
Output of the classification scheme is a geotiff containing labeled pixels and a RGB image of surface classes.\
Use `03_Classify.py {geotiff}.tiff` to classify the sea ice image into subclasses
* Water
......@@ -67,12 +69,12 @@ or `03_Classify.py sediments {geotiff}.tiff` to add **sediments** to the list of
#### Assembling into objects and sieving
High resolution aerial imaging means that the image resolution is in comparison much finer than the minimum size of surface objects. We therefore assume that objects that consist of less than 100 pixels cannot be resolved and can be excluded. Such groups of pixels mostly occur at blurry edges or are caused by noise anyway.
In this processing step [04_Sieve_and_combine.py](04_Sieve_and_combine.py), pixels are combined into objects and too small ones are attached to the adjacent larger ones. Objects of less than 100 pixels are not sieved out however, if they form objects of more than 100 pixels together with surrounding objects of the same main class.\
In this processing step [04_Sieve_and_combine.py](04_Sieve_and_combine_P3.py), pixels are combined into objects and too small ones are attached to the adjacent larger ones. Objects of less than 100 pixels are not sieved out however, if they form objects of more than 100 pixels together with surrounding objects of the same main class.\
Run script `04_Sieve_and_combine.py {classified_geotiff}.tiff`.
#### Calculate area fractions of subclasses
In the last prepared processing step [05_Sub_and_mainclasses.py](05_Sub_and_mainclasses.py), main class objects are retrieved out of the subclasses and saved as shapefile containing a polygon table. For each polygon, the areal fractions of subclasses are calculated, classification uncertainty propagation is determined and pond structures are analysed if they rather belong to submerged ice depending on their position and neighbours. They are relabeled as submerged ice if they adjoining a larger area of open water. \
In the last prepared processing step [05_Sub_and_mainclasses.py](05_Sub_and_mainclasses_P3.py), main class objects are retrieved out of the subclasses and saved as shapefile containing a polygon table. For each polygon, the areal fractions of subclasses are calculated, classification uncertainty propagation is determined and pond structures are analysed if they rather belong to submerged ice depending on their position and neighbours. They are relabeled as submerged ice if they adjoining a larger area of open water. \
Run script `05_Sub_and_mainclasses.py {classified_geotiff}.tiff`.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment