load image with openCV Mat c++

前端 未结 5 797
梦谈多话
梦谈多话 2020-11-30 15:26

I want to load an image using Mat in openCV

My code is:

Mat I = imread(\"C:/images/apple.jpg\", 0);
namedWindow( \"Display window\", CV_WINDOW_AUTOSI         


        
5条回答
  •  臣服心动
    2020-11-30 15:45

    Have you checked that I exists after imread? Perhaps the file read failed

    After reading a file do if ( I.empty() ) to check if it failed

提交回复
热议问题