Opencv configuration and running opencv program on a computer Not Installed

Source: Internet
Author: User

I. installation and configuration

Opencv1.0 is suitable for VC ++ 6.0. Http://www.opencv.org.cn/index.php/Download can be downloaded from this

Note: Add environment variables during installation (by default ).

1. Add warehouse receiving files, including files and resource files

Tools-options-Directories

Set IIb: Only one, c: \ Program Files \ opencv \ Lib

Set include: multiple, commonly used add (note that there are otherlibs)

Set SRC: multiple, commonly used add

2. Use opencv in projects

In Project-settings-all deployments (Project-Option-set all), select link and add the static library CVD. lib to the object/Library module.
Highguid. Lib cvauxd. Lib cxcored. Lib cvcam. Lib

(It seems that the default setting is for Win32 debug? In the Project Settings dialog box, see the upper left corner)


Ii. Setting of running opencv program on a computer without opencv installed

1. Add a folder under the Program folder (which can be named cv) that contains all common. H files and. Lib files.

2. Add the required. h and. Lib code to the stdafx. h header file.

// Add the header file. Note the difference between <> and "".
# Include "CV/cv. H"
# Include "CV/cxcore. H"
# Include "CV/highgui. H"
// Add the Lib file. If you do not need to add the DLL file, the system automatically searches for the link.
# Pragma comment (Lib, "CV/cvcam. lib ")
# Pragma comment (Lib, "CV/cxcore. lib ")
# Pragma comment (Lib, "CV/cv. lib ")
# Pragma comment (Lib, "CV/cvaux. lib ")
# Pragma comment (Lib, "CV/highgui. lib ")

The code for adding. Lib above is equivalent to adding the. Lib static library in project settings during the first configuration in this article.

3. Add the. dll dynamic library under the Program folder or the debug folder.

Then, the program can run on any machine without opencv installed.

Related Article

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.