caffe安裝問題26_error use of undeclared identifier CV_LOAD_IMAGE_COLOR

張欣-男發表於2020-09-25

問題

/Users/zhangxin/github/caffe/src/caffe/layers/window_data_layer.cpp:293:42: error: use of undeclared identifier 'CV_LOAD_IMAGE_COLOR'
        cv_img = cv::imread(image.first, CV_LOAD_IMAGE_COLOR);
                                         ^
1 error generated.
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/layers/window_data_layer.cpp.o] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

解決辦法

  1. 將所有的CV_LOAD_IMAGE_COLOR替換為cv::IMREAD_COLOR
  2. 將所有的CV_LOAD_IMAGE_GRAYSCALE替換為cv::IMREAD_GRAYSCALE

相關文章