OpenCV GPU程序未运行

时间:2013-04-07 06:14:53

标签: visual-studio-2010 opencv cuda gpu

这是我的第一篇文章。所以,请原谅我,如果我不把它变成一个完美的。

我使用OpenCV大约2个月,现在我想开始GPU处理。因此,我将OpenCV 2.4.3的新副本解压缩到不同的位置,并使用CMake和CUDA支持来进行补充。我使用CUDA 4.2 Toolkit和SDK然后构建它。然后我以完美的方式设置环境变量和include,目录和二进制属性,如此处的许多其他帖子所述。

然而,当我向我的项目添加一个gpu代码时,例如stereo_match.cpp,我能够成功编译和构建它们,但是当我运行它们时,没有结果。我只是得到一个黑屏,上面写着:

“用法:stereo_match_gpu --left --right#必须纠正 - 方法#BB | BP | CSBP --ndisp#disparity levels of number”

然后程序退出。我尝试阅读代码但无法找到我应该在哪里提供输入图像。我是CUDA的总菜鸟。所以有人可以告诉我,如果我在这里做错了什么。我正在遵循的方法来构建和运行GPU代码吗?你能告诉我哪里出错吗?我在OpenCV 2.4.3中使用Visual Studio Ultimate 32位。 GPU是NVIDIA GeForce 525M。

附加信息:当我运行构建的代码时,我在控制台中获得以下内容:

'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\gpu\x86\vc10\bin\opencv_core243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\cudart32_42_9.dll', Binary was not built with debug information.
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\nvcuda.dll', Binary was not built with debug information.
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\user32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\lpk.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\usp10.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\sechost.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\ole32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\devobj.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\shell32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\npp32_42_9.dll', Binary was not built with debug information.
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msvcp100.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\gpu\x86\vc10\bin\opencv_gpu243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_imgproc243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_flann243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_features2d243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_calib3d243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_objdetect243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_highgui243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\avifil32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\winmm.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msacm32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msvfw32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\avicap32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\version.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_video243.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\nvcuvid.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\nvcuvenc.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\cufft32_42_9.dll', Binary was not built with debug information.
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\imm32.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\msctf.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\WINDOWS\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll', Cannot find or open the PDB file
'CV_Base.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll', Cannot find or open the PDB file
The program '[1568] CV_Base.exe: Native' has exited with code 1 (0x1).

1 个答案:

答案 0 :(得分:1)

我认为错误信息只是说你必须将一些参数传递给程序,告诉它在哪里找到图像。首先,您需要2个经过纠正的图像,例如left.jpgright.jpg。然后,您必须指示Visual Studio在启动时向程序传递正确的参数。有关传递参数的信息,请参阅here

您需要的参数可能类似于

--left left.jpg --right right.jpg --method BM --ndisp 32

请注意,我将<left-view><right-view>替换为实际图片名称,删除了解释每个参数(# comments start with hash)的注释,并为其他参数选择了一些明智的选项。

请注意,如果您只提供文件名,则文件必须与VS用于启动可执行文件的工作目录位于同一目录中。如果您愿意,您也可以提供相对路径或完整路径,或者可能告诉VS将图像文件夹用作工作目录。