SAGA-GIS Tool Library Documentation (v8.2.1)

Tool K-Nearest Neighbours Classification (OpenCV)

Integration of the OpenCV Machine Learning library for K-Nearest Neighbours classification of gridded features.


References


Parameters

 NameTypeIdentifierDescriptionConstraints
InputFeaturesGrid list, inputFEATURES--
Training AreasShapes, inputTRAIN_AREAS--
OutputClassificationGrid, outputCLASSES--
Look-up Table (*)Table, output, optionalCLASSES_LUTA reference list of the grid values that have been assigned to the training classes.-
OptionsGrid SystemGrid systemPARAMETERS_GRID_SYSTEM--
NormalizeBooleanNORMALIZE-Default: 0
Update Colors from FeaturesBoolean, GUIRGB_COLORSUse the first three features in list to obtain blue, green, red components for class colour in look-up table.Default: 0
Load ModelFile pathMODEL_LOADUse a model previously stored to file.-
Class IdentifierTable fieldTRAIN_CLASS--
Buffer SizeFloating pointTRAIN_BUFFERFor non-polygon type training areas, creates a buffer with a diameter of specified size.Minimum: 0.000000
Default: 1.000000
Save ModelFile pathMODEL_SAVEStores model to file to be used for subsequent classifications instead of training areas.-
Default Number of NeighboursIntegerNEIGHBOURS-Minimum: 1
Default: 3
Training MethodChoiceTRAINING-Available Choices:
[0] classification
[1] regression model
Default: 0
Algorithm TypeChoiceALGORITHM-Available Choices:
[0] brute force
[1] KD Tree
Default: 0
Parameter for KD Tree implementationIntegerEMAX-Minimum: 1
Default: 1000
(*) optional

Command-line

Usage: saga_cmd imagery_opencv 6 [-FEATURES <str>] [-NORMALIZE <str>] [-CLASSES <str>] [-CLASSES_LUT <str>] [-MODEL_LOAD <str>] [-TRAIN_AREAS <str>] [-TRAIN_CLASS <str>] [-TRAIN_BUFFER <double>] [-MODEL_SAVE <str>] [-NEIGHBOURS <num>] [-TRAINING <str>] [-ALGORITHM <str>] [-EMAX <num>]
  -FEATURES:<str>       	Features
	Grid list, input
  -NORMALIZE:<str>      	Normalize
	Boolean
	Default: 0
  -CLASSES:<str>        	Classification
	Grid, output
  -CLASSES_LUT:<str>    	Look-up Table
	Table, output, optional
  -MODEL_LOAD:<str>     	Load Model
	File path
  -TRAIN_AREAS:<str>    	Training Areas
	Shapes, input
  -TRAIN_CLASS:<str>    	Class Identifier
	Table field
  -TRAIN_BUFFER:<double>	Buffer Size
	Floating point
	Minimum: 0.000000
	Default: 1.000000
  -MODEL_SAVE:<str>     	Save Model
	File path
  -NEIGHBOURS:<num>     	Default Number of Neighbours
	Integer
	Minimum: 1
	Default: 3
  -TRAINING:<str>       	Training Method
	Choice
	Available Choices:
	[0] classification
	[1] regression model
	Default: 0
  -ALGORITHM:<str>      	Algorithm Type
	Choice
	Available Choices:
	[0] brute force
	[1] KD Tree
	Default: 0
  -EMAX:<num>           	Parameter for KD Tree implementation
	Integer
	Minimum: 1
	Default: 1000