Table of Contents

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

samples GPCTrainingSamples

Training samples, e.g. obtained via Create(IEnumerable<Mat>, IEnumerable<Mat>, IEnumerable<Mat>, GPCDescType).

trainingParams GPCTrainingParams

Training 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

imagesFrom IEnumerable<Mat>

First images of the image pairs.

imagesTo IEnumerable<Mat>

Second images of the image pairs.

gt IEnumerable<Mat>

Ground-truth flow for each image pair.

trainingParams GPCTrainingParams

Training parameters. Uses the native defaults when null.