设为首页 收藏本站
查看: 616|回复: 0

[经验分享] [OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3

[复制链接]

尚未签到

发表于 2016-5-23 11:01:04 | 显示全部楼层 |阅读模式
  [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.
  ----------------------------------------------------------------------------------------------------------------------------
  [Envrionment]:
  [1] OpenCV 2.4.3
  [2] Winodws Eight
  [3] Visual Studio 2012 Ultimate
  [Steps]:
  [1]Based onthat 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 thewhole 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 theone like this:
  yourSolutionName:
   @Debug|Win32
  #Microsoft.Cpp.Win32.user
  #Application
   #Unicode Support
   #Core Windows.Libraries
  @Release|Win32
  #Microsoft.Cpp.Win32.user
  ..... .....
  [10]Right-Click theorange onecalled "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 theitem "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 Directories" 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 opencvheader 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 awayfrom 2010 to 2012. To conquer it, we can find the nut called "MSVCP100D.dll"
  , get it and put it into theright 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 yourOpenCVProjectagain. 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]
  
  
  
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-220670-1-1.html 上篇帖子: 最牛2012移动互联网预测调查报告 下篇帖子: 2012年最值得期待的11款科技产品
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表