Table of Contents

Class Detector

Namespace
Emgu.CV.Linemod
Assembly
Emgu.CV.dll

Object detector using the LINE template matching algorithm with any set of modalities.

public abstract class Detector : SharedPtrObject, IDisposable
Inheritance
Detector
Implements
Derived
Inherited Members

Constructors

Detector()

protected Detector()

Properties

ClassIds

Get class ids

public string[] ClassIds { get; }

Property Value

string[]

Modalities

Get the modalities used by this detector. You are not permitted to add/remove modalities, but you may cast them to tweak parameters.

public Modality[] Modalities { get; }

Property Value

Modality[]

NumClasses

Get number of classes.

public int NumClasses { get; }

Property Value

int

NumTemplates

Get number of templates.

public int NumTemplates { get; }

Property Value

int

PyramidLevels

Get number of pyramid levels used by this detector.

public int PyramidLevels { get; }

Property Value

int

Methods

AddTemplate(VectorOfMat, string, Mat, ref Rectangle)

Add new object template.

public int AddTemplate(VectorOfMat sources, string classId, Mat objectMask, ref Rectangle boundingBox)

Parameters

sources VectorOfMat

Source images, one for each modality.

classId string

Object class ID.

objectMask Mat

Mask separating object from background.

boundingBox Rectangle

Return bounding box of the extracted features.

Returns

int

Template ID, or -1 if failed to extract a valid template.

DisposeObject()

Release the unmanaged memory associated with this object

protected override void DisposeObject()

GetT(int)

Get sampling step T at pyramidLevel.

public int GetT(int pyramidLevel)

Parameters

pyramidLevel int

The pyramid level

Returns

int

Sampling step T

Match(VectorOfMat, float, VectorOfLinemodMatch, VectorOfCvString, IOutputArrayOfArrays, VectorOfMat)

Detect objects by template matching. Matches globally at the lowest pyramid level, then refines locally stepping up the pyramid.

public void Match(VectorOfMat sources, float threshold, VectorOfLinemodMatch matches, VectorOfCvString classIds = null, IOutputArrayOfArrays quantizedImages = null, VectorOfMat masks = null)

Parameters

sources VectorOfMat

Source images, one for each modality.

threshold float

Similarity threshold, a percentage between 0 and 100.

matches VectorOfLinemodMatch

Template matches, sorted by similarity score.

classIds VectorOfCvString

If non-empty, only search for the desired object classes.

quantizedImages IOutputArrayOfArrays

Optionally return vector<Mat> of quantized images.

masks VectorOfMat

The masks for consideration during matching. The masks should be CV_8UC1 where 255 represents a valid pixel. If non-empty, the vector must be the same size as sources. Each element must be empty or the same size as its corresponding source.

Read(FileNode)

Read the detector from file node

public void Read(FileNode fn)

Parameters

fn FileNode

The file node to read the detector from

Write(FileStorage)

Write the detector to file storage

public void Write(FileStorage fs)

Parameters

fs FileStorage

The file storage to write the detector into.