Improve the doc for cv::Mat::checkVector.

This commit is contained in:
Fangjun Kuang
2018-01-18 16:28:13 +01:00
parent ec353dbdda
commit 8efe7bafaa
2 changed files with 63 additions and 1 deletions
+21 -1
View File
@@ -1786,7 +1786,27 @@ public:
*/
size_t total(int startDim, int endDim=INT_MAX) const;
//! returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
/**
* @param elemChannels 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.
* @param depth The depth the matrix should have. Set it to -1 when any depth is fine.
* @param requireContinuous Set it to true to require the matrix to be continuous
* @return -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.
*
* The following code demonstrates its usage for a 2-d matrix:
* @snippet snippets/core_mat_checkVector.cpp example-2d
*
* The following code demonstrates its usage for a 3-d matrix:
* @snippet snippets/core_mat_checkVector.cpp example-3d
*/
int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const;
/** @brief Returns a pointer to the specified matrix row.