OPENCV Installation and learning materials

Source: Internet
Author: User

The first time win7+vs2010+opencv3.0, the results are unsuccessful, the reason for the extraction of no VC10, may not be in the new version of the old VC support. So changed vs2013+opencv3.0, compared to the classic installation vs2010+opencv2.4.9, the new version has a lot of functions or address changes, 3.0 Sometimes the video screen may be wrong.

Here are the installation procedures for my vs2013+opencv3.0:

The following starts to describe how to configure, I use the system is win8.1 64-bit system, vs with the vs3013 Ultimate, first to download OpenCV I use the version is the latest version of 3.0 ALPHA, download down directly to execute can, actually is decompression, I extract to D:\ Program Files folder.

Configure environment variables, right-click My Computer Select Properties, select Advanced System settings on the left, the System Properties dialog box pops up,

Click on the environment variable, click on the new environment variable, variable name can be arbitrary, I am in this is OPENCV, set the value of the variable to Opencv/build path

Add path, click Edit Path, add in path ;%O Pencv%\x86\vc12\bin, where vc12 corresponds to vs2013,vc11 corresponding to is VS2012,VC10 corresponding is vs2010, according to their own version to choose

Create a new OpenCV project property sheet and create a new opencv300 in the OpenCV directory. Props, you can create a new TXT document, change the suffix name to. Props, here is my Property engineering table, 7th, 8 rows are 32-bit and 64-bit platform, if not defined system variables, the inside of the $ (OPENCV) can be replaced by absolute path, my is D:\Program Files\opencv\build, under VC12 There are 3 folders Bin,lib,staticlib, the Lib and Staticlib added to the LibraryPath, may be different version needs to be added, mainly to see which folders VC12 , and the folder contains a file name containing 300 of the Lib file added to the LibraryPath, 300 means that the version of OPENCV is OPENCV3.0.0,VC12 different from the VS version, the 12th and 15th lines start with the contained Lib file, where 12th begins with a Lib file with a file name containing 300 but not ending with D, where 15th begins with a file name containing 300 ending in D LIB file, you can modify it according to your OPENCV version.

1<?XML version= "1.0" encoding= "Utf-8"?>2<ProjectToolsVersion= "4.0"xmlns= "Http://schemas.microsoft.com/developer/msbuild/2003">3<ImportgroupLabel= "PropertySheets"/>4<PropertyGroupLabel= "Usermacros"/>5<PropertyGroup>6<Includepath>$ (OPENCV) \include;$ (Includepath)</Includepath>7<LibraryPathCondition= "' $ (Platform) ' = = ' Win32 '">$ (OPENCV) \x86\vc12\staticlib;$ (OPENCV) \x86\vc12\lib;$ (LibraryPath)</LibraryPath>8<LibraryPathCondition= "' $ (Platform) ' = = ' X64 '">$ (OPENCV) \x64\vc12\staticlib;$ (OPENCV) \x64\vc12\lib;$ (LibraryPath)</LibraryPath>9</PropertyGroup>10<ItemDefinitionGroup>11<LinkCondition= "' $ (Configuration) ' = = ' Debug '">12<Additionaldependencies>opencv_ts300.lib;opencv_world300.lib;opencv_calib3d300.lib;opencv_core300.lib;opencv_features2d300.lib;o Pencv_flann300.lib;opencv_highgui300.lib;opencv_imgcodecs300.lib;opencv_imgproc300.lib;opencv_ml300.lib;opencv _objdetect300.lib;opencv_photo300.lib;opencv_shape300.lib;opencv_stitching300.lib;opencv_superres300.lib;o pencv_ts300.lib;opencv_video300.lib;opencv_videoio300.lib;opencv_videostab300.lib;% ( Additionaldependencies)</Additionaldependencies>13</Link>14<LinkCondition= "' $ (Configuration) ' = = ' Release '">15<Additionaldependencies>opencv_ts300d.lib;opencv_world300d.lib;opencv_calib3d300d.lib;opencv_core300d.lib;opencv_ Features2d300d.lib;opencv_flann300d.lib;opencv_highgui300d.lib;opencv_imgcodecs300d.lib;opencv_imgproc300d.lib ; opencv_ml300d.lib;opencv_objdetect300d.lib;opencv_photo300d.lib;opencv_shape300d.lib;opencv_stitching300d.lib ; opencv_superres300d.lib;opencv_ts300d.lib;opencv_video300d.lib;opencv_videoio300d.lib;opencv_ videostab300d.lib;% ( Additionaldependencies)</additionaldependencies> </Link> </  ItemDefinitionGroup> <ItemGroup /> </Project> 

When you finish editing the Project property sheet, create a new empty project test in VS, open the Properties Manager, other Windows, view,

Add a well-written opencv300 in the property manager. Props the properties file, select Property Manager in the right sidebar, right-click Test, select Add Existing property sheet,

Find Opencv300.props to add it,

At this point the environment is well equipped, run an instance of the program, and to say that each new project needs to add Opencv300.props, to put the picture into the test file inside the project, is inside the test folder, that is, test\test under.

1 #include <opencv2/core/core.hpp>2 #include <opencv2/highgui/highgui.hpp>3 #include <iostream>45UsingNamespaceCv6UsingNamespaceStd78int main (int argc,char**argv9{1011Mat image;Image = Imread ("Opencv.jpg", Imread_color);//Read the file1314if (!image.data)//Check for Invalid input15{cout <<"Could not open or find the image"<<Std::endl;17Return-1;18}19Namedwindow ( "display window" Window_autosize); // Create a window for Display. "display window // Show our image inside It.23 Waitkey (0); // Wait for a keystroke in the Window24 return 0;25}                 

The picture that the knot shows is like this

The relevant learning materials can be found in the following:

Introduction to OpenCV3 Programming _ Mao-Electronic industry publishing ... _split_1.pdf

OPENCV Installation and learning materials

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.