Table of Contents

Method SetFeatureExtractor

Namespace
OpenCvSharp.Tracking
Assembly
OpenCvSharp.dll

SetFeatureExtractor(FeatureExtractorCallback, bool)

Sets a custom feature extractor. Corresponds to cv::TrackerKCF::setFeatureExtractor.

public void SetFeatureExtractor(TrackerKCF.FeatureExtractorCallback extractor, bool pcaFunc = false)

Parameters

extractor TrackerKCF.FeatureExtractorCallback

Callback receiving the current frame, the region of interest, and the output feature matrix to fill in. Neither Mat passed to the callback is owned by the callee.

pcaFunc bool

Whether this extractor is used for the compressed (PCA) descriptors.

Remarks

cv::TrackerKCF::FeatureExtractorCallbackFN is a plain C function pointer with no per-instance user-data slot, so only one managed callback can be active process-wide at a time: calling this method on any TrackerKCF instance replaces the callback used by every other instance as well. To actually take effect, either DescPca or DescNpca (matching pcaFunc) must include Custom.