在Visual Studio 2010项目中使用OpenCV 2.4.0 [英] Using OpenCV 2.4.0 in a Visual studio 2010 project

查看:204
本文介绍了在Visual Studio 2010项目中使用OpenCV 2.4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在如何链接和使用OpenCV标题时提出了类似的问题? ,但没有运气到目前为止。所以我决定问一个新的,更具体的问题。

I have asked a similar question on How to link and use OpenCV headers?, but no luck so far. So I decided to ask a new, more specific question.

有人可以告诉我什么OpenCV特定的文件夹或文件,我需要包括在我的C + +项目 - 我可以包括他们?我已经在我的C:\驱动器上安装了OpenCV 2.4.0。我在openCV的网站上看过教程,但他们是一个较旧的版本(OpenCV 2.1),并引用现在的非索引文件像objdetect.hpp(例如)。

Can someone tell me what OpenCV-specific folders or files I need to include in my C++ project -- and how I might include them? I have installed OpenCV 2.4.0 on my C:\ drive. I've looked at the tutorials in openCV's website, but they are for an older version (OpenCV 2.1) and refer to now-nonexistant files like objdetect.hpp (for example).

请帮忙。感谢。

推荐答案

请参阅 http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how -to

将这些添加到您的stdafx.h

Add these to your stdafx.h

#include <opencv2/core/core.hpp>        // cv::Mat etc, always need this
#include <opencv2/imgproc/imgproc.hpp>  // all the image processing functions
#include <opencv2/highgui/highgui.hpp>  // Display and file I/O

假设你设置OPENCV_DIR到你放置opencv的地方。 OPENCV_DIR = c:\opencv2.4\opencv

Assuming you have set OPENCV_DIR to the place you put opencv eg. OPENCV_DIR=c:\opencv2.4\opencv

然后将项目设置中的VC ++目录设置为
包含 $(OPENCV_DIR)\include 和Library添加 $(OPENCV_DIR)\lib

Then set the VC++ directories in project settings to Include add $(OPENCV_DIR)\include and to Library add $(OPENCV_DIR)\lib

然后在链接器输入中添加opencv_core240.lib(用于调试的opencv_core240D.lib)opencv_imgproc240.lib和opencv_highgui240.lib等

Then in the "linker Input" add opencv_core240.lib (opencv_core240D.lib for debug) opencv_imgproc240.lib and opencv_highgui240.lib etc

这篇关于在Visual Studio 2010项目中使用OpenCV 2.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆