1. 程式人生 > >opencv讀圖片錯誤,已解決

opencv讀圖片錯誤,已解決

eight row error virt 錯誤 window core depends virtual

could not loag image...
terminate called after throwing an instance of cv::Exception
  what():  OpenCV(4.0.0-pre) /home/w1/work/depends/opencv/modules/highgui/src/window.cpp:350: error: (-215:Assertion failed) size.width>0 && size.height>0 in function imshow

Aborted (core dumped)

把圖片的相對路徑修改為絕對路徑,就好啦。

Mat src = imread("/home/w1/work/virtualAD/ad.jpg");

OK

opencv讀圖片錯誤,已解決