Historical Map  1.0
Plugin for automatic extraction of old forest from historical map
 All Classes Namespaces Files Functions Variables
Public Member Functions | List of all members
HistoricalMap.function_historical_map.classifyImage Class Reference

Classify image with learn clasifier and learned model. More...

Collaboration diagram for HistoricalMap.function_historical_map.classifyImage:
Collaboration graph

Public Member Functions

def initPredict
 
def rasterMod
 
def vectorMod
 
def scale
 Function that standardize the data. More...
 
def predict_image
 The function classify the whole raster image, using per block image analysis. More...
 

Detailed Description

Classify image with learn clasifier and learned model.

Create a raster file, fill hole from your give class (inClassForest), convert to a vector, remove parcel size which are under a certain size (defined in inMinSize) and save it to shp.

Input :
    inRaster : Filtered image name ('sample_filtered.tif',str)
    inModel : Output name of the filtered file ('training.shp',str)
    outShpFile : Output name of vector files ('sample.shp',str)
    inMinSize : min size in acre for the forest, ex 6 means all polygons below 6000 m2 (int)
    TODO inMask : Mask size where no classification is done                                     |||| NOT YET IMPLEMENTED
    inField : Column name where are stored class number (str)
    inNODATA : if NODATA (int)
    inClassForest : Classification number of the forest class (int)

Output :
    SHP file with deleted polygon below inMinSize

Definition at line 312 of file function_historical_map.py.

Member Function Documentation

def HistoricalMap.function_historical_map.classifyImage.initPredict (   self,
  inRaster,
  inModel 
)

Definition at line 334 of file function_historical_map.py.

def HistoricalMap.function_historical_map.classifyImage.predict_image (   self,
  inRaster,
  outRaster,
  model,
  inMask = None,
  NODATA = -10000,
  SCALE = None 
)

The function classify the whole raster image, using per block image analysis.

The classifier is given in classifier and options in kwargs

Input :

inRaster : Filtered image name ('sample_filtered.tif',str) outRaster :Raster image name ('outputraster.tif',str) model : model file got from precedent step ('model', str) inMask : mask to NODATA : Default set to -10000 (int) SCALE : Default set to None

Output :

nothing but save a raster image

Definition at line 492 of file function_historical_map.py.

def HistoricalMap.function_historical_map.classifyImage.rasterMod (   self,
  rasterTemp,
  inClassForest 
)

Definition at line 364 of file function_historical_map.py.

def HistoricalMap.function_historical_map.classifyImage.scale (   self,
  x,
  M = None,
  m = None 
)

Function that standardize the data.

Input: x: the data M: the Max vector m: the Min vector Output: x: the standardize data M: the Max vector m: the Min vector

Definition at line 460 of file function_historical_map.py.

def HistoricalMap.function_historical_map.classifyImage.vectorMod (   self,
  rasterTemp,
  inMinSize,
  outShpFile 
)

Definition at line 406 of file function_historical_map.py.


The documentation for this class was generated from the following file: