Visual tutorial on OpenCV configuration method in VS2015, vs2015opencv

Source: Internet
Author: User

Visual tutorial on OpenCV configuration method in VS2015, vs2015opencv

The examples in this article share with you the specific code of the Android jiugongge image for your reference. The specific content is as follows:

Replace the path name with the actual path name.

OpenCV Official Website: http://opencv.org/

GitHub: https://github.com/Itseez/opencv

Configuration process

Create a C ++ project.

Open project properties.

Change the platform.

Add the include directory in the VC ++ directory-include directory.

(Select inherit from parent or project settings by default)

D: \ OpenCV \ build \ include

D: \ OpenCV \ build \ include \ opencv

D: \ OpenCV \ build \ include \ opencv2

Add the library directory in the VC ++ directory-library directory.

(Select inherit from parent or project settings by default)

D: \ OpenCV \ build \ x64 \ vc14 \ lib

Add additional dependencies to the linker-input-additional dependencies.

(The newly added dependency is the. lib file in the library directory added in the previous step)

(Select inherit from parent or project settings by default)

opencv_world310.libopencv_world310d.lib

Add entries to the environment variable path.

(Here is the directory of the dynamic link library. dll file)

D: \ OpenCV \ build \ x64 \ vc14 \ bin

Add the test code and file.

(Program source online)

// # Include "stdafx. h "# include <opencv2/opencv. hpp> using namespace std; using namespace cv; int main (int argc, char * argv []) {const char * imagename = "lena.jpg "; // read the image Mat img = imread (imagename) from the file; // if the image fails to be read if (img. empty () {fprintf (stderr, "Can not load image % s \ n", imagename); return-1 ;}// display image imshow ("image ", img); // This function waits for the key. Press any key on the keyboard to return waitKey (); return 0 ;}

Project running result.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.