-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (30 loc) · 1.64 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from imagePreparation_utils import *
from unsupervised_classification_utils import *
# Path to directory where satellite images are stored
inputDirectoryPath = "E:/LGO/ressource/input"
# Path to directory where your prepared images will be stored
outputDirectoryPath = "E:/LGO/ressource/output"
# Path to your desired shapeFile
shapeFileDirectoryPath = "E:/LGO/ressource/shapeFile"
# Path to directory where you want to save results
savingShapeDirectory = "E:/LGO/ressource/savingShape"
# Path to your csv file
csvPath = "E:/LGO/ressource/sortie_bateau.csv"
# Path to your bathymetry data file
bathymetryfilePath = "E:/LGO/ressource/MNT_COTIER_MORBIHAN_TANDEM_PBMA/MNT_COTIER_MORBIHAN_TANDEM_PBMA/DONNEES/MNT_COTIER_MORBIHAN_TANDEM_20m_WGS84_PBMA_ZNEG.bag"
# Path to the directory where updated batymetry will be saved
outputBathymetrytDirectory = "E:/LGO/ressource/output_bathymetry"
# if you want to prepare your images set this flag to 1
flag_preparation = 0
# if you want to do k-means classification set this flag to 1
flag_classification = 1
# if you want to see herbier detection set this flag to 1
flag_herbierDetection = 0
if flag_preparation == 1:
imagePreparation(inputDirectoryPath, outputDirectoryPath, shapeFileDirectoryPath)
if flag_classification == 1:
source, image_classified, prediction = classificationResults(outputDirectoryPath, shapeFileDirectoryPath, bathymetryfilePath, outputBathymetrytDirectory, 30,
invert=True, bathymetry=True)
wantedClass(image_classified, savingShapeDirectory, source)
if flag_herbierDetection == 1:
herbierDetection(outputDirectoryPath, shapeFileDirectoryPath, csvPath, 30, invert=True)