Win7 64bit VS2010 OpenCV 2.4.9 environment configuration

Source: Internet
Author: User

Author: Ching


Since the recent face recognition needs to use OPENCV, let me start the OPENCV study.

OpenCV 2.4.9:http://sourceforge.net/projects/opencvlibrary/



Click on the download in the image to download.

After downloading, get a 348M "Opencv-2.4.9.exe" file, double-click Run, it will ask you to extract where you can unzip directly on the E: disk. (I will directly unzip in the E: Packing directory).

This will get a OpenCV folder in the E: Packing directory.


The following describes the environment configuration issues:


The first step:

Right-click Computer, properties, advanced system settings, environment variables (lower-right corner position)

Then find the Path in the system variable (if it is not new), then ";    E:\opencv\build\x86\vc10\bin; "Copy in (the path inside the quotation marks, note the semicolon, restart)



Step Two:

Open VS2010, you can create a Win32 console Application (empty).

Then select item, "XXX" attribute (bottom), configuration Properties--Include directory (right position),->vc++ directory.

Copy this list: "E:\opencv\build\include; E:\OPENCV\BUILD\INCLUDE\OPENCV; E:\opencv\build\include\opencv2; ”

Of course, you can also add by clicking on your own.



Step Three:

Still on the page, the Library directory: "E:\OPENCV\BUILD\X86\VC10\LIB;" (copy in)


Fourth Step:

Click Add-on dependencies (right position), input, connector

Copy this bunch of lib: "Opencv_video249d.lib;opencv_ts249d.lib;opencv_objdetect249d.lib;opencv_ml249d.lib;opencv_ Legacy249d.lib;opencv_imgproc249d.lib;opencv_highgui249d.lib;opencv_gpu249d.lib;opencv_flann249d.lib;opencv_ Features2d249d.lib;opencv_core249d.lib;opencv_calib3d249d.lib;opencv_contrib249d.lib; ”

Note To copy all in, the blogger himself began to copy only one, always run errors.


Fifth step: Click on the top left corner and select release mode:

Setup is the same as debug mode ~ ~ ~


OK, the configuration is complete, here we test a piece of code:


Display a Picture: (1.png is placed under a directory with your. cpp)

#include "opencv\highgui.h" int main () {Iplimage *img = cvloadimage ("1.png"); Cvnamedwindow ("Baidu paste", cv_window_autosize) ; Cvshowimage ("Baidu Post Bar", IMG); cvwaitkey (0); Cvreleaseimage (&img); Cvdestroywindow ("Baidu post Bar"); return 0;}


Display effect:




Reference article: Peisyu's column, win7+opencv2.4.9+vs2010 configuration, http://blog.csdn.net/peisyu/article/details/24741587

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.