Problem : Couldn't find or open the image

asked 2015-02-05 14:47:31 -0600

Evoxz gravatar image

updated 2015-02-05 15:42:52 -0600

Hi all :) To begin with, I wanted to say you that i'm not a native speaker and I'm only 16, so please be tolerant with my English :p Moreover, I begin with OpenCV by myself, so I know almost nothing about it... HEre is my question : In fact, I was in one of the first tutorial (http://docs.opencv.org/doc/tutorials/...) and I tried to display an image. But I can't do it... I've tried to execute the exe file with CMD, with "release interface" in Visual Studio ultimate 2012 with arguments,... (I've also tried to put the image file (I've tried with bmp and jpg formats) into C:, my project's folder, the release's folder where I can find the .exe,...) Whatever I do, the image doesn't appear and I can just read "Could not open or find the image" (the text who appear when !image.data is true) Have one of you the answer? Best regards, Evoxz

PS : The code I use can be found on the tutorial I linked, I haven't changed anything

NB : I use OpenCV 2.4.10, the latest final version

edit retag flag offensive close merge delete

Comments

Welcome, and do not worry about your difficulties with the language. Now related to your problem, from the command line are you running the following:

DisplayImage.exe HappyFish.jpg

that should be ok. Moreover, if you want to run the tutorial through the visual studio ide and considering that you have set up everything correctly, just change the following line in the code:

image = imread(argv[1], CV_LOAD_IMAGE_COLOR);

with:

image = imread("absolute_path_to_the_image_file", CV_LOAD_IMAGE_COLOR);

and do not forget to keep the quotes.

theodore gravatar imagetheodore ( 2015-02-05 17:39:04 -0600 )edit

I've already tried it... with CMD i ran "Sat-Turn OpenCV.exe 7.jpg"... It didn't work. I've also tried with the absolute path but it doesn't work too. Have you got another idea?

Evoxz gravatar imageEvoxz ( 2015-02-06 01:14:16 -0600 )edit