Table of Contents

Class AlgorithmExtensions

Namespace
Emgu.CV
Assembly
Emgu.CV.dll

Extension methods to the IAlgorithm interface

public static class AlgorithmExtensions
Inheritance
AlgorithmExtensions
Inherited Members

Methods

Clear(IAlgorithm)

Clear the algorithm

public static void Clear(this IAlgorithm algorithm)

Parameters

algorithm IAlgorithm

The algorithm

GetDefaultName(IAlgorithm)

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

public static string GetDefaultName(this IAlgorithm algorithm)

Parameters

algorithm IAlgorithm

The algorithm

Returns

string

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

IsEmpty(IAlgorithm)

Returns true if the Algorithm is empty. e.g. in the very beginning or after unsuccessful read.

public static bool IsEmpty(this IAlgorithm algorithm)

Parameters

algorithm IAlgorithm

The algorithm

Returns

bool

Returns true if the Algorithm is empty. e.g. in the very beginning or after unsuccessful read.

Load(IAlgorithm, string, string, string)

Loads algorithm from the file

public static void Load(this IAlgorithm algorithm, string fileName, string objName = null, string encoding = null)

Parameters

algorithm IAlgorithm

The algorithm

fileName string

Name of the file to read.

objName string

The optional name of the node to read (if empty, the first top-level node will be used)

encoding string

Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it.

LoadFromString(IAlgorithm, string, string, string)

Loads algorithm from a String

public static void LoadFromString(this IAlgorithm algorithm, string strModel, string objName = null, string encoding = null)

Parameters

algorithm IAlgorithm

The algorithm

strModel string

The string variable containing the model you want to load.

objName string

The optional name of the node to read (if empty, the first top-level node will be used)

encoding string

Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it.

Read(IAlgorithm, FileNode)

Reads algorithm parameters from a file storage.

public static void Read(this IAlgorithm algorithm, FileNode node)

Parameters

algorithm IAlgorithm

The algorithm.

node FileNode

The node from file storage.

Save(IAlgorithm, string)

Save the algorithm to file

public static void Save(this IAlgorithm algorithm, string fileName)

Parameters

algorithm IAlgorithm

The algorithm

fileName string

The file name where this algorithm will be saved to

SaveToString(IAlgorithm, string)

Save the algorithm to a string

public static string SaveToString(this IAlgorithm algorithm, string format = ".xml")

Parameters

algorithm IAlgorithm

The algorithm

format string

file format, can be .xml or .yml

Returns

string

The algorithm as an yml string

Write(IAlgorithm, FileStorage)

Stores algorithm parameters in a file storage

public static void Write(this IAlgorithm algorithm, FileStorage storage)

Parameters

algorithm IAlgorithm

The algorithm.

storage FileStorage

The storage.

Write(IAlgorithm, FileStorage, string)

Stores algorithm parameters in a file storage

public static void Write(this IAlgorithm algorithm, FileStorage storage, string name)

Parameters

algorithm IAlgorithm

The algorithm.

storage FileStorage

The storage.

name string

The name of the node