Problems in reading images in Open CV 2.4.7

0

I recently started to work with OpenCV in Microsoft Visual Studio 2013. I wrote a simple code to open an image located on the project folder and I'm getting an error. This is the debug output:

'OpenCV_Test.exe' (Win32): Loaded 'C:\Users\Lucas\Documents\Visual Studio 2013\Projects\OpenCV_Test\Debug\OpenCV_Test.exe'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_core247d.dll'. Cannot find or open the PDB file. 'OpenCV_Test.exe' (Win32): Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_highgui247d.dll'. Cannot find or open the PDB file. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp100d.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr100d.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9200.16658_none_bf1359a245f1cd12\comctl32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avifil32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvfw32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avicap32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Symbols loaded. 'OpenCV_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded. First-chance exception at 0x757E4B32 in OpenCV_Test.exe: Microsoft C++ exception: cv::Exception at memory location 0x00E5FA28.

Unhandled exception at 0x757E4B32 in OpenCV_Test.exe: Microsoft C++ exception: cv::Exception at memory location 0x00E5FA28.

First-chance exception at 0x757E4B32 in OpenCV_Test.exe: Microsoft C++ exception: cv::Exception at memory location 0x00E5EB10.

Unhandled exception at 0x757E4B32 in OpenCV_Test.exe: Microsoft C++ exception: cv::Exception at memory location 0x00E5EB10.

First-chance exception at 0x0F202BD6 (opencv_highgui247d.dll) in OpenCV_Test.exe: 0xC0000005: Access violation reading location 0x00000018.

Unhandled exception at 0x0F202BD6 (opencv_highgui247d.dll) in OpenCV_Test.exe: 0xC0000005: Access violation reading location 0x00000018.

First-chance exception at 0x0F202BD6 (opencv_highgui247d.dll) in OpenCV_Test.exe: 0xC0000005: Access violation reading location 0x00000018.

Unhandled exception at 0x0F202BD6 (opencv_highgui247d.dll) in OpenCV_Test.exe: 0xC0000005: Access violation reading location 0x00000018.

Can anybody help me with that? Here is the code:

#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>

using namespace cv;

int main()
{
    Mat image = imread("img.jpeg");
    namedWindow("Image Sample");
    imshow("Image Sample", image);
    waitKey(5000);
    return 1;
}
c++
opencv
computer-vision
asked on Stack Overflow Dec 26, 2013 by user3100319 • edited Dec 26, 2013 by user3100319

1 Answer

0

Even though lots of things could be the problem, the most likely issue is that the image could not be found.

You can make sure by giving the complete path to img.jpeg instead of the relative path you have now.

answered on Stack Overflow Dec 26, 2013 by Hannes Ovrén

User contributions licensed under CC BY-SA 3.0