visual-studio-2010 - 我无法使用 VS2010 运行 openCV2.3.1

我无法使用 VS2010 运行 openCV。我下载了 OpenCV-2.3.1-win-superpack 并在 C:\opencv 中提取 openCV2.3.1 并将 CMake buide 项目用于 C:\opencv\vs2010。接下来,我设置包含所有模块和库到 C:\opencv\build\x86\vc10\lib 并将附加依赖项设置为

opencv_core231d.lib opencv_highgui231d.lib opencv_imgproc231d.lib opencv_features2d231d.lib opencv_calib3d231d.lib

之后,我从 C:\opencv\build\x86\vc10\bin 复制到项目中的 Debug 文件夹。

我构建此代码没有任何错误。

include "stdafx.h"

include "opencv2/core/core.hpp"
include "opencv2/highgui/highgui.hpp"

int main(){
    cv::Mat image = cv::imread("Desert.jpg");
    cv::namedWindow("My Image");
    cv::imshow("My Image", image);
    cv::waitKey(5000);

    return 1;
}

但是当我运行此代码时,它会显示此错误警报。

OpenCV_Helloworld.exe 中 0x0f6d49a6 处的未处理异常:0xC0000005:访问冲突读取位置 0x00000018。

当我点击打破它显示

无可用来源
没有为任何调用堆栈帧加载符号。无法显示源代码。
调用堆栈位置:
KernelBase.dll!75289617()


在 openCV 教程中使用旧版本进行 openCV 安装。所以我在谷歌中找到并按照它安装。我不确定我是否想念此代码或安装。

我像这样创建新项目和配置Setup OpenCV-2.3 for Visual Studio 2010并将所有 dll 复制到我的项目中的 Debug 文件夹。我没有构建错误,但是当我运行它时显示此错误。
'opencv_hello.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Users\PKRU\Documents\Visual Studio 2010\Projects\opencv_hello\Debug\opencv_core231d.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'opencv_hello.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'opencv_hello.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16385_none_ebf82fc36c758ad5\comctl32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file
The program '[5308] opencv_hello.exe: Native' has exited with code -1 (0xffffffff).

最佳答案

你检查过imread是否有效吗?

if ( image.data == NULL ) {
   // failed
}

https://stackoverflow.com/questions/7345481/

相关文章:

opencv - 无法使用 OpenCV 从 FireWire cam 捕获图像

python-3.x - 队列的等价arg 'durable'

android - 使用opencv在android中抓取连续帧

opencv - 保存IPL_DEPTH_IMAGE供以后处理

visual-c++ - OpenCV Connected Component标签颜色?

c# - Windows 7 x32下C#中dllimport的问题

opencv - 使用openCV GMM类进行对象建模

c# - 如何申请cvsobel + emgucv

c# - EmguCV - 运动检测不返回角度

colors - 识别opencv中检测到的圆圈的颜色