Table of Contents

Method CheckVector

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

CheckVector(int, int, bool)

public int CheckVector(int elemChannels, int depth = -1, bool requireContinuous = true)

Parameters

elemChannels int

Number of channels or number of columns the matrix should have. For a 2-D matrix, when the matrix has only 1 column, then it should have elemChannels channels; When the matrix has only 1 channel, then it should have elemChannels columns. For a 3-D matrix, it should have only one channel. Furthermore, if the number of planes is not one, then the number of rows within every plane has to be 1; if the number of rows within every plane is not 1, then the number of planes has to be 1.

depth int

The depth the matrix should have. Set it to -1 when any depth is fine.

requireContinuous bool

Set it to true to require the matrix to be continuous

Returns

int

-1 if the requirement is not satisfied. Otherwise, it returns the number of elements in the matrix. Note that an element may have multiple channels.