CvKNearestTrain Method (CvMat, CvMat, CvMat, Boolean, Int32, Boolean) OpenCvSharp Class Library
Trains the model

Namespace:  OpenCvSharp.CPlusPlus
Assembly:  OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public virtual bool Train(
	CvMat trainData,
	CvMat responses,
	CvMat sampleIdx = null,
	bool isRegression = false,
	int maxK = 32,
	bool updateBase = false
)

Parameters

trainData
Type: OpenCvSharpCvMat
Known samples (m*n)
responses
Type: OpenCvSharpCvMat
Classes for known samples (m*1)
sampleIdx (Optional)
Type: OpenCvSharpCvMat

[Missing <param name="sampleIdx"/> documentation for "M:OpenCvSharp.CPlusPlus.CvKNearest.Train(OpenCvSharp.CvMat,OpenCvSharp.CvMat,OpenCvSharp.CvMat,System.Boolean,System.Int32,System.Boolean)"]

isRegression (Optional)
Type: SystemBoolean

[Missing <param name="isRegression"/> documentation for "M:OpenCvSharp.CPlusPlus.CvKNearest.Train(OpenCvSharp.CvMat,OpenCvSharp.CvMat,OpenCvSharp.CvMat,System.Boolean,System.Int32,System.Boolean)"]

maxK (Optional)
Type: SystemInt32
Maximum number of neighbors to return
updateBase (Optional)
Type: SystemBoolean
Adds known samples to model(true) or makes a new one(false)

Return Value

Type: Boolean

[Missing <returns> documentation for "M:OpenCvSharp.CPlusPlus.CvKNearest.Train(OpenCvSharp.CvMat,OpenCvSharp.CvMat,OpenCvSharp.CvMat,System.Boolean,System.Int32,System.Boolean)"]

See Also

Reference