c_cpp 检查图像是否不存在或无法使用OpenCV在C ++中打开。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 检查图像是否不存在或无法使用OpenCV在C ++中打开。相关的知识,希望对你有一定的参考价值。

  img_path = argv[1];
  std::cout << "img_path: " << img_path << std::endl;
  // load the image here.
  image = cv::imread(img_path);
  if (image.empty()) {
    std::cout << "Can not open the image! Please check the path of the input "
        "image." << std::endl;
    return -1;
  }

以上是关于c_cpp 检查图像是否不存在或无法使用OpenCV在C ++中打开。的主要内容,如果未能解决你的问题,请参考以下文章