imread returning empty matrix in debug, double-checked that I have the correct libs
I've seen several references to an issue in which imread fails silently when the wrong libs are used. It's working properly for me in release mode, but not in debug mode. I've triple-checked that my configuration is the same across the two with the exception of adding a "d" at the end of every lib's name, for "debug". So instead of including opencv_highgui248e.lib
, I include opencv_highgui248d.lib
. I'm using visual studio 2012, building for x64. My library path is C:\sdf3\opencv_2_4_8\build\x64\vc11\lib (though I've also tried vc12).
Any ideas what else I can try?
more a common sense thing : when starting the prog from the ide, make sure the startup path is correct (it just might not find the image)
Confirmed. The image is findable. Any other ideas?
Is it possible that you made a type here 'opencv_highgui248e.lib'? As far as I know the release libraries dont have an 'e' at the end. Also visual studio is quite stupid when it comes to locating sourcefiles. The place where your image of imread is located for release is NOT the same as for debug. Please try to use an absolute path, like C:/data/image.jpeg and see if the problem still exists?
I encountered the same issue. It turns out I should use the full path of the image file.