{"id":351,"date":"2013-12-05T16:24:27","date_gmt":"2013-12-05T21:24:27","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=351"},"modified":"2013-12-05T16:24:27","modified_gmt":"2013-12-05T21:24:27","slug":"installing-opencv-2-3-for-visual-studio-2008win7-option-2","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2013\/12\/05\/installing-opencv-2-3-for-visual-studio-2008win7-option-2\/","title":{"rendered":"Installing OpenCV 2.3 for Visual Studio 2008(win7)-Option 2"},"content":{"rendered":"<p>At first, go to below web site and download OpenCV-2.3.0-win-superpack.exe<\/p>\n<p><a href=\"http:\/\/sourceforge.net\/projects\/opencvlibrary\/files\/opencv-win\/2.3\/\">http:\/\/sourceforge.net\/projects\/opencvlibrary\/files\/opencv-win\/2.3\/<\/a><\/p>\n<div><a href=\"http:\/\/2.bp.blogspot.com\/-HlE7uMP2ox0\/UCCZOuQnaEI\/AAAAAAAAAAY\/U8l2USR4WuQ\/s1600\/111.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/2.bp.blogspot.com\/-HlE7uMP2ox0\/UCCZOuQnaEI\/AAAAAAAAAAY\/U8l2USR4WuQ\/s320\/111.png\" width=\"320\" height=\"249\" border=\"0\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<div><\/div>\n<p>Double click on the downloaded file to unzip OpenCV libraries.<br \/>\nMove the unzipped folder &#8220;OpenCV2.3&#8221; to &#8220;C:\\&#8221;.<br \/>\nIn my case, I located &#8220;OpenCV2.3&#8221; folder on &#8220;C:\\OpenCV2.3&#8221;.<br \/>\n(Actually, folder location is not important, but you must remember path of folder.)<\/p>\n<p>And then, Open the Visual Studio 2008 and make new empty project like below.<br \/>\nChoose Win32 Console Application as type. Enter its name and select the path where to create it. Then in the upcoming dialog make sure you create an empty project.<\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/1.bp.blogspot.com\/-R5c1XsPZKZA\/UCCcfbkx2cI\/AAAAAAAAAAo\/zc3yYwhU76k\/s320\/112.png\" width=\"320\" height=\"225\" border=\"0\" \/><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><a href=\"http:\/\/1.bp.blogspot.com\/-84KlNVDtiw0\/UCCdC37fFQI\/AAAAAAAAAAw\/luo_8Bf3_Uk\/s1600\/113.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/1.bp.blogspot.com\/-84KlNVDtiw0\/UCCdC37fFQI\/AAAAAAAAAAw\/luo_8Bf3_Uk\/s320\/113.png\" width=\"320\" height=\"270\" border=\"0\" \/><\/a><\/div>\n<p>Add New Item in Source files directory. Select C++ file(.cpp) as template.<\/p>\n<div><a href=\"http:\/\/2.bp.blogspot.com\/-MW1HowfJ4aQ\/UCCf77XMNxI\/AAAAAAAAABE\/pctk4X8y3j0\/s1600\/114.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/2.bp.blogspot.com\/-MW1HowfJ4aQ\/UCCf77XMNxI\/AAAAAAAAABE\/pctk4X8y3j0\/s320\/114.png\" width=\"320\" height=\"248\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<p>Now, let&#8217;s configure project&#8217;s properties, go to Projects -&gt; Properties&#8230;<br \/>\nThere are two configuration mode, a &#8216;Debug&#8217; and a &#8216;Release&#8217;, to configure for OpenCV2.3.<br \/>\nFirstly, select &#8216;Debug&#8217; on configuration tab.<\/p>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><a href=\"http:\/\/2.bp.blogspot.com\/-vCngzABhWzs\/UCCqG4e3SnI\/AAAAAAAAABk\/ffPkEQG6-bM\/s1600\/115.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/2.bp.blogspot.com\/-vCngzABhWzs\/UCCqG4e3SnI\/AAAAAAAAABk\/ffPkEQG6-bM\/s320\/115.png\" width=\"320\" height=\"186\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div>1. Configuration Properties-&gt;C\/C++ -&gt;General directory -&gt;Additional Include Directories<\/div>\n<div><\/div>\n<div>Add additional include directories as follows:<\/div>\n<div><\/div>\n<div>C:\\OpenCV2.3\\build\\include<\/div>\n<div><\/div>\n<div>C:\\OpenCV2.3\\build\\include\\opencv<\/div>\n<p>C:\\OpenCV2.3\\build\\include\\opencv2<\/p>\n<div><\/div>\n<div><a href=\"http:\/\/4.bp.blogspot.com\/-jP-9gIZQHcs\/UCCrhU11AgI\/AAAAAAAAABs\/8ldbsc4cTCM\/s1600\/116.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/4.bp.blogspot.com\/-jP-9gIZQHcs\/UCCrhU11AgI\/AAAAAAAAABs\/8ldbsc4cTCM\/s320\/116.png\" width=\"320\" height=\"304\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<p>2. Configuration Properties -&gt; Linker -&gt; General -&gt; Additional Library Directories<\/p>\n<p>Add additional library directories as follows:<\/p>\n<p>C:\\OpenCV2.3\\build\\x86\\vc9\\lib<\/p>\n<div><a href=\"http:\/\/4.bp.blogspot.com\/-V2M_tSaw_3c\/UCCs1PYWywI\/AAAAAAAAAB0\/fxuTGfVnqyQ\/s1600\/117.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/4.bp.blogspot.com\/-V2M_tSaw_3c\/UCCs1PYWywI\/AAAAAAAAAB0\/fxuTGfVnqyQ\/s320\/117.png\" width=\"320\" height=\"277\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<p>3. Configuration Properties -&gt; Linker -&gt; Input -&gt; Additional Dependencies edit<\/p>\n<p>Add libraries as follows:<\/p>\n<p>opencv_calib3d230d.lib<br \/>\nopencv_contrib230d.lib<br \/>\nopencv_core230d.lib<br \/>\nopencv_features2d230d.lib<br \/>\nopencv_flann230d.lib<br \/>\nopencv_gpu230d.lib<br \/>\nopencv_haartraining_engined.lib<br \/>\nopencv_highgui230d.lib<br \/>\nopencv_imgproc230d.lib<br \/>\nopencv_legacy230d.lib<br \/>\nopencv_ml230d.lib<br \/>\nopencv_objdetect230d.lib<br \/>\nopencv_video230d.lib<\/p>\n<div><a href=\"http:\/\/4.bp.blogspot.com\/-pP_jqbbIAsc\/UCCuXLZJMpI\/AAAAAAAAAB8\/lNLTS-ODU6M\/s1600\/118.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/4.bp.blogspot.com\/-pP_jqbbIAsc\/UCCuXLZJMpI\/AAAAAAAAAB8\/lNLTS-ODU6M\/s320\/118.png\" width=\"320\" height=\"277\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div>4. For &#8216;Release&#8217; mode<\/div>\n<div><\/div>\n<div>Do like &#8216;Debug&#8217; mode, but when you edit Additional \u00a0Dependencies, make sure you type libraries&#8217; names except &#8216;d'( ex) xxxx_xxx230.lib)<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<p>opencv_calib3d230.lib<br \/>\nopencv_contrib230.lib<br \/>\nopencv_core230.lib<br \/>\nopencv_features2d230.lib<br \/>\nopencv_flann230.lib<br \/>\nopencv_gpu230.lib<br \/>\nopencv_haartraining_engine.lib<br \/>\nopencv_highgui230.lib<br \/>\nopencv_imgproc230.lib<br \/>\nopencv_legacy230.lib<br \/>\nopencv_ml230.lib<br \/>\nopencv_objdetect230.lib<br \/>\nopencv_video230.lib<\/p>\n<p>5. Copy dll files onto System32 directory.<br \/>\nGo and copy files in &#8216;C:\\OpenCV2.3\\build\\x86\\vc9\\bin&#8217; and paste into &#8216;C:\\Windows\\System32&#8217;<\/p>\n<p>you did it!<\/p>\n<p>Let&#8217;s check it works well or not.<\/p>\n<p>#include &lt;cv.h&gt;<br \/>\n#include &lt;highgui.h&gt;<\/p>\n<p>using namespace cv;<\/p>\n<p>int main(void)<br \/>\n{<br \/>\nMat img;<br \/>\nimg = imread(&#8220;test.jpg&#8221;);<br \/>\nimshow(&#8220;test&#8221;,img);<br \/>\nwaitKey(0);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At first, go to below web site and download OpenCV-2.3.0-win-superpack.exe http:\/\/sourceforge.net\/projects\/opencvlibrary\/files\/opencv-win\/2.3\/ &nbsp; Double click on the downloaded file to unzip OpenCV libraries. Move the unzipped&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-image-processing"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}