VC2013 configures OpenCV development environment

This article summarizes, VC2013 configures the OpenCV development environment. The specific operations are as follows:

Before configuration, this article has installed the OpenCV computer vision library file correctly by default, and configured the corresponding environment variables.

  1. Open the project configuration dialog (right click properties)

        

    The first include directory address here is configured as: OpenCV's include directory

        The second library directory is configured as: absolute address in the opencv\build\x64\vc12\lib directory (note here that the version of OpenCV installed in this article is version 2.4.10, and different OpenCV versions in the x64 directory of this version correspond to different vc version, so it deserves the reader's attention here!)

    2. Open the 'input' option under the linker, click on the additional dependencies and edit the content as follows.

        

The dependencies are as follows:

        opencv_core2410d.lib
        opencv_highgui2410d.lib
        opencv_imgproc2410d.lib
        opencv_video2410d.lib

        opencv_features2d2410d.lib

The contents of these packages are respectively in the lib directory of the vc12 directory, which contains the algorithm packages commonly used by OpenCV. The following d represents a special meaning. Interested readers can refer to relevant information.

    3. Configure the development platform as the X64-bit version

    

    

    

    4. The code test content and display effect are as follows

#include<iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{
    // Read in an image (original game image)
    Mat img = imread("E:/OpenCVSource/lena.jpg");
    // Create a window named "Original game painting"
    namedWindow("Original game painting");
    // Display the original game painting in the window
    imshow("Original game painting", img) ;
    // After waiting 6000 ms, the window is automatically closed
    waitKey(6000);
    return 0;
}

 

The effect is as follows:

        

--So far, the configuration of the OpenCV development environment in the VC2013 environment is successful. Readers can make relevant OpenCV-based development attempts according to their own research and application directions. For example: simple image processing, target detection, target tracking and a series of computer vision related research. I will update the learning process in time, record relevant learning and research details, and share some experiences in the growth process with everyone.

    Record life and share technology.

    Note: This article can be reproduced, but the source of the article must be indicated.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325426222&siteId=291194637