Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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();