Ask Your Question

Revision history [back]

Load image with default depth using the macro CV_LOAD_IMAGE_ANYDEPTH like,

  const cv::Mat src = cv::imread(filename, CV_LOAD_IMAGE_ANYDEPTH);

And check the channel like,

  std::cout<<src.channels();

Load image with default depth using the macro CV_LOAD_IMAGE_ANYDEPTH like,

  const cv::Mat src = cv::imread(filename, CV_LOAD_IMAGE_ANYDEPTH);

And check the number of channel using Mat::channels like,

  std::cout<<src.channels();