Ask Your Question

Imread() is not taking any inputs

asked 2015-09-05 23:49:01 -0600

varsha19 gravatar image

updated 2015-09-06 11:55:17 -0600

pklab gravatar image

Hello all, I am trying to use OpenCV with Visual Studio 2012. I have followed every steps as mentioned in the documentation, and I have checked this question. But still I'm not able to read the image.

image description

It's not reading the image at all. I'm using OpenCV 2.4.8 and visual studio 2012(on 32 bit windows 7). Any suggestions?

edit retag flag offensive close merge delete


First suggestion: stop using an obsolete version of OpenCV and install latest version of the library (if you want to stick to version 2 and you're using precompiled libraries, then that's 2.4.11). Once you've updated, come back and tell us if you still have trouble.

LorenaGdL gravatar imageLorenaGdL ( 2015-09-06 05:47:48 -0600 )edit

@LorenaGdL Thank you for the suggestion. Can you suggest me where can I download the OpenCV 3.0 user manual. Because, every time I search, it says OpenCV 3.0 for visual studio 2012 , but the document will be of lower versions. As in OpenCV 3.0 i.e., C:\opencv\build\x86\vc12\lib contains 4 .lib files n rest are in staticlib folder(correct me if I'm wrong) please suggest me a manual so that I can use OpenCV easily.

varsha19 gravatar imagevarsha19 ( 2015-09-06 11:52:20 -0600 )edit

@varsha19 installation guidelines for previous versions also apply to OpenCV 3.0.0. However, just note that opencv_world contains all the other modules, and that's the reason of (apparently) having less .lib files than before. OpenCV 3.0.0 documentation is here (but you won't find an updated installation guide)

LorenaGdL gravatar imageLorenaGdL ( 2015-09-06 12:18:09 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2015-09-07 03:58:25 -0600

varsha19 gravatar image

@pklab I just updated my opencv to 2.4.11 and it just worked fine. Thank you so much for the suggestion

edit flag offensive delete link more


just mark the green hook, and we can move on ;)

berak gravatar imageberak ( 2015-09-07 04:37:39 -0600 )edit

answered 2015-09-06 11:50:09 -0600

pklab gravatar image

updated 2015-09-06 11:51:00 -0600

If you can, update your OpenCV to 2.4.11. If you can't:

  1. what about your jpeg file ? is it a standard jpg or something other like progressive jpeg (this is supported since 2.4.9) ?
  2. did you try another file ?
  3. what about setting the flag "Multi-threaded Debug (/MTd)" in your Visual Studio Project ?
  4. what about your OpenCV installation ... are you mixing up release and debug OpenCV ?
  5. what about using old C API IplImage* imgC = cvLoadImage(filename); than convert to Mat with Mat img = Mat(imgC); ?
edit flag offensive delete link more


i f 5. works, it's a clear indication, that the problem is with 3. or 4. (std::string and such not correctly linked wrt c-runtime)

berak gravatar imageberak ( 2015-09-07 00:58:19 -0600 )edit

Question Tools

1 follower


Asked: 2015-09-05 23:49:01 -0600

Seen: 838 times

Last updated: Sep 06 '15