我的代码构建正常,但是当我调试时,这就是我得到的:
'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Documents\Visual Studio 2008\Projects\Proj_OpenCV\Debug\Proj_OpenCV.exe', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Downloads\OpenCV2.3\build\x86\vc9\bin\opencv_core230.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll'
'Proj_OpenCV.exe': Loaded 'C:\Users\Saher\Downloads\OpenCV2.3\build\x86\vc9\bin\opencv_highgui230.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\version.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll', Symbols loaded.
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'Proj_OpenCV.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll'
'Proj_OpenCV.exe': Loaded 'C:\Program Files (x86)\McAfee\SiteAdvisor\sahook.dll'
The program '[5748] Proj_OpenCV.exe: Native' has exited with code -1 (0xffffffff).
我的代码如下OpenCV tutorial page
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
对此错误以及如何解决此问题的任何帮助将不胜感激。
答案 0 :(得分:2)
display_image.exe test.jpg
或者,如果从Visual Studio执行它,请确保将图像文件名设置为:
Project Properties > Configuration Properties > Debugging > Command Arguments