Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

OpenCV cannot load images

$
0
0
Hi, I'm using the code from "https://help.ubuntu.com/community/OpenCV" in the C++ section, and I'm having trouble with the following code: #include "opencv2/core/core_c.h" #include "opencv2/core/core.hpp" #include "opencv2/flann/miniflann.hpp" #include "opencv2/imgproc/imgproc_c.h" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/video/video.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/objdetect/objdetect.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/ml/ml.hpp" #include "opencv2/highgui/highgui_c.h" #include "opencv2/highgui/highgui.hpp" using namespace cv; int main() { Mat img = imread("/home/courtneym/Pictures/index.jpeg",CV_LOAD_IMAGE_COLOR); imshow("opencvtest",img); waitKey(0); return 0; } I keep getting this error when I try to run it: OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/courtneym/opencv/modules/highgui/src/window.cpp, line 276 terminate called after throwing an instance of 'cv::Exception' what(): /home/courtneym/opencv/modules/highgui/src/window.cpp:276: error: (-215) size.width>0 && size.height>0 in function imshow Aborted (core dumped)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>