Method Train
- Namespace
- OpenCvSharp.OptFlow
- Assembly
- OpenCvSharp.dll
Train(GPCTrainingSamples, GPCTrainingParams?)
Trains the forest using one sample set for every tree. Consider using the overload taking image/ground-truth-flow triples instead for better quality.
public void Train(GPCTrainingSamples samples, GPCTrainingParams? trainingParams = null)
Parameters
samplesGPCTrainingSamplesTraining samples, e.g. obtained via Create(IEnumerable<Mat>, IEnumerable<Mat>, IEnumerable<Mat>, GPCDescType).
trainingParamsGPCTrainingParamsTraining parameters. Uses the native defaults when null.
Train(IEnumerable<Mat>, IEnumerable<Mat>, IEnumerable<Mat>, GPCTrainingParams?)
Trains the forest using individual samples extracted for each tree from the given image pairs and ground-truth flow. Generally produces better quality than the single-sample-set overload.
public void Train(IEnumerable<Mat> imagesFrom, IEnumerable<Mat> imagesTo, IEnumerable<Mat> gt, GPCTrainingParams? trainingParams = null)
Parameters
imagesFromIEnumerable<Mat>First images of the image pairs.
imagesToIEnumerable<Mat>Second images of the image pairs.
gtIEnumerable<Mat>Ground-truth flow for each image pair.
trainingParamsGPCTrainingParamsTraining parameters. Uses the native defaults when null.