openCV2.4.8 + VS2013

这篇博客主要记录一下装好openCV和VS2013后如何建立一个基于openCV的项目。

一、新建项目

新建一个空项目。如下图:

这里写图片描述

二、添加库

2.1 VC++ Directoriese

在项目 -> 项目属性里

这里写图片描述

2.2 General

在项目 -> 项目属性 -> 链接器(Linker)-> 常规(General)

这里写图片描述

2.3 input

在项目 -> 项目属性 -> 链接器(Linker)-> 输入(input)

这里写图片描述

添加如下的库:

opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_imgproc248d.lib
opencv_flann248d.lib
opencv_highgui248d.lib

这些基本够用了

三、测试代码

#include <opencv2/core/core.hpp>  
#include <opencv2/highgui/highgui.hpp>  
#include <iostream>  

using namespace cv;
using namespace std;

int main()
{
    Mat image;
    image = imread("C:/Users/chenguang/Desktop/a.pgn", IMREAD_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", WINDOW_AUTOSIZE); // Create a window for display.  
    imshow("Display window", image); // Show our image inside it.  

    waitKey(); // Wait for a keystroke in the window  
    return 0;
}

四、添加dll

进行如上步骤后,可能会爆出如下错误:

'testnew.exe' (Win32): Loaded 'C:\Users\chenguang\Desktop\stitching\testnew\Debug\testnew.exe'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'testnew.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'E:\soft\openCV\opencv\build\x86\vc12\bin\opencv_core248d.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'E:\soft\openCV\opencv\build\x86\vc12\bin\opencv_highgui248d.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'testnew.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
The thread 0x158 has exited with code -1073741510 (0xc000013a).
The thread 0x9cc has exited with code -1073741510 (0xc000013a).
The thread 0x2e90 has exited with code -1073741510 (0xc000013a).
The thread 0x7e8 has exited with code -1073741510 (0xc000013a).
The program '[14932] testnew.exe' has exited with code -1073741510 (0xc000013a).

解决方法:

1、点 调试
2、然后 选项和设置
3、右边勾上 启用源服务器支持
4、左边点 符号
5、把微软符号服务器勾
6、运行的时候等一下 莫慌!!
7、问题解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值