Skip to content

Instantly share code, notes, and snippets.

@JinhaiZ
JinhaiZ / opencv_cplus.md
Last active February 8, 2018 19:24
c++ opencv manipulation
  1. get the size of a multi-dimensional cv::Mat
std::cout << "cvMat.dims = " << cvMat.dims << "cvMat.size = [";
for(int i = 0; i < cvMat.dims; ++i) {
    if(i) std::cout << " X ";
    std::cout << cvMat.size[i];
}
std::cout << "] cvMat.channels = " << cvMat.channels() << std::endl;