What does Mat::checkVector do in OpenCV?
The official OpenCV's doc says:
cv::Mat::checkVector()
returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
OpenCV considers some data types equivalent in case of some functions i.e. objectPoints
of cv::solvePnP()
can be:
- 1xN/Nx1 1-channel
cv::Mat
- 3xN/Nx3 3-channel
cv::Mat
std::vector<cv::Point3f>
With checkVector
you can make sure that you are passing the correct representation of your data.