[OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
[OpenCV under Visual Studio 2012 Ultimate] [Tentative experimentation for x86] Thereare really sofew materials for installing the OpenCV(2.4.3) for Visual Studio 2012. Hence, I have read several blogs to do it, and fortunately Igot it. ---
[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
-
解决Visual Studio 2012 Update 4 RC启动调试失败的方案
-
OpenCV2.4.9 搭载 Visual Studio 2013 安装教程、配置环境以及测试代码
-
openCV visual studio 2019配置
-
不安装Visual Studio,只用Windows SDK搭建VC环境 博客分类: c++tools c++tools
-
关于visual studio 2012 update 2中的新功能介绍
-
关于visual studio 2012 update 2中的新功能介绍
-
使用Visual Studio+OpenCV进行的Susan算子边缘检测及数米粒图像处理实验
-
Visual Studio 2012 Ultimate旗舰版下载地址与序列号
-
学习OpenCV--如何在Visual Studio中使用OpenCV