[OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
来源:互联网 发布:淘宝号码没有信誉 编辑:程序博客网 时间:2024/05/17 02:43
[OpenCV under Visual Studio 2012 Ultimate]
[Tentative experimentation for x86]
There are really so few materials for installing the OpenCV(2.4.3) for Visual Studio 2012. Hence, I have read several blogs to do it, and fortunately I got it.
----------------------------------------------------------------------------------------------------------------------------
[Envrionment]:
[1] OpenCV 2.4.3
[2] Winodws Eight
[3] Visual Studio 2012 Ultimate
[Steps]:
[1]Based on that you have installed the visual studio 2012 under windows eight.
[2]Download the opencv2.4.3 fromhttp://opencv.org/, you may choose the windows vision.
And it will prompt the download page automatically.
[3]Double-Click the excutive file(.exe), which will help you unzip it, accurately not "installing".
And now, we assume the whole directory is -->H:\MySoftware\OpenCV\opencv\
[4]Thenceforth, you get a documentation folder named "opencv", which includes a lot of files
for current domainant platforms ie: Winodws, Mac, Linux/Unix, iOS, Android.
Make sure, you get the folder called "build", which is extreme significant for us.
[5]Add the items for your "Path" system variable. Carefully I push two directories into the "Path".
(1)H:\MySoftware\OpenCV\opencv\build\x86\vc10\bin\
(2)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\
Maybe, the second one is meaningless.
Step by step, complish it.
[6]Restart the Visual Studio 2012, if you have runned it.
[7]Now, we may create a new VC++ project under VS2012.
I founded the Win32 Console Application and chose the "Empty Project".
[8]Look up at your VS2012 File Bar, and manipulate follow under sequence:
View -- Other Windows -- Property Manager, so you get the little "Propert Manager Window".
[9]Concentrate the "tree", you get the one like this:
yourSolutionName:
@Debug|Win32
#Microsoft.Cpp.Win32.user
#Application
#Unicode Support
#Core Windows.Libraries
@Release|Win32
#Microsoft.Cpp.Win32.user
..... .....
[10]Right-Click the orange one called "Microsoft.Cpp.Win32.user", and tap the "Properties" item.
[11]Thereby, a simple window show you where you will work.
[12]Press the "VC++ Directories" the resident on the left tree.
[13]Focus on the right part. And click the "Include Directories" and edit it by pressing the down-arrow.
Add the three items into it.
(1)H:\MySoftware\OpenCV\opencv\build\include\
(2)H:\MySoftware\OpenCV\opencv\build\include\opencv\
(3)H:\MySoftware\OpenCV\opencv\build\include\opencv2\
Save it after you have done.
[14]Further more, tap the item "Library Directories" and edit it too.
Push one directory into it :H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\
And save it.
[Additionally]Press the "Linker" one the left tree, and choose "Input". Concentrate the right part,
and edit the "Additional Dependencies" by adding three items:
(1)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_core243d.lib
(2)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_highgui243d.lib
(3)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_imgproc243d.lib
And save it.
[15]Now, you can "cultivate" some opencv codes in your empty project.
[For example]:
#include "highgui.h";
int main(int argc , char** argv)
{
IplImage* img= cvLoadImage("./hello.jpg"); //Be sure you have a picture in the root dir
cvNamedWindow("Test One", CV_WINDOW_AUTOSIZE);
cvShowImage("Test One",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Test One");
return 0;
}
//Happily, you may find the visual studio 2012 can auto-complete the part of the function
//, which stands for the success of including the opencv header file.
//But if you attempt to run it, vs2012 will prompt error saying "Lacking MSVCP100D.dll".
//So Awful.
[16]So let's solve this problem and try to think about "WHY".
(Reason:)You may remember or not, we choose the folder which is named "vc10".
That stands for "Visual Studio 2010" not "2012", so maybe there is something
gone away from 2010 to 2012. To conquer it, we can find the nut called "MSVCP100D.dll"
, get it and put it into the right place.
[17]So "google" is a good buddy, get sufficient results of "MSVCP100D.dll" , and you can choose one
for downloading.
[18]Put this guy into the "Windows\System32\" folder, just it.
[19]Run your OpenCV Project again. What was worse, a "POP" again. This time it complain about
"NO MSVCR100D.dll". Look at it again: it is not "MSVCP100D.dll" but "MSVCR100D.dll".
[20]So, you may have got the method: google it --> download it -->put it into Windows\System32\.
[21]Now, come back to your cute Visual Studio 2012 andRUNyour OpenCV Project
(Whose codes you have done) again.
[22]HeHe, it works........................
[23]So, you get the OpenCV now, and it is the lastest one. Enjoy it.
----------------------------------------------------------------------------------------------------------------------------
[Notice]
The method above just show the [Debug Modle]. If you desire to get the [Release One], come back to the
[STEP NINE] and choose the GREEN ONE, and the setting for the "Linker" changing to :
(1)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_core243.lib
(2)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_highgui243.lib
(3)H:\MySoftware\OpenCV\opencv\build\x86\vc10\lib\opencv_imgproc243.lib
Remeber save it.
There is no "d", becuase the character "d" stands for "DEBUG" in this area.
----------------------------------------------------------------------------------------------------------------------------
[SO CUET THE OPENCV IS]
- [OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
- 转 [OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
- Visual Studio 2012 搭建 OpenCV2.4.3
- Visual studio 2010 上搭建opencv2.3.1
- Visual Studio 2010 搭建OpenCV2.48
- Visual studio 2013 community搭建 opencv2.4.10
- OpenCV学习点滴(一)OpenCV2.4.3+Visual Studio2010环境搭建
- Windows系统 为 Visual Studio软件 搭建 OpenCV2 开发环境
- Opencv环境搭建(Visual Studio+Windows)
- opencv+ Visual Studio 2013 环境搭建
- opencv入门学习之一:安装OpenCV 2.4.9和Visual Studio 2012开发环境的搭建
- OpenCV2 +Visual Studio 安装步骤
- OpenCV2.4.3 + Visual Studio 2008 配置方法详解
- win8.1 x64 Visual studio 2012 OpenCV2.4.6
- opencv2.4.10和Visual Studio 2012环境设置
- OpenCV在Visual Studio开发环境的搭建
- opencv在visual studio 2012的配置
- 安装visual studio 2012,并配置opencv
- 技巧_MFC_编辑框_换行
- 关于Hibernate的日志
- Java的身份证号码工具类
- Gate Level Modeling Part-I (of Verilog HDL)
- malloc分配内存-----一个有错
- [OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
- 一次优化记录
- 需要仔细研究的技术
- 同步和异步的区别
- 一个 Linux 上分析死锁的简单方法
- ubuntu12.04 “flash 设置” 无法点击
- VC调试
- android中listView下拉刷新
- JDBC连接各种数据库的字符串