comsatsbcs.files.wordpress.com€¦  · Web viewThen Open Linker and in general tab edit the...

5
OPENCV 3.4.1 Tutorial Setup Link: https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/ opencv-3.4.1-vc14_vc15.exe/download Installation Steps: 1. Install OpenCv in Local Disk C:\opencv\ Folder 2. Open Environmental Variables and then in the System Variables, click on New and then set Variable Name : OPENCV_DIR Variable Value: C:\opencv\opencv\build\x64\vc15\ 3. And click on Path and edit it, and create New Path and paste this %OPENCV_DIR%\bin 4. Then Open VS2017 Community and create a empty project (Just like you have done in FCP) and then create source file .cpp format. 5. (Optional) And then follow the step as given in screenshot mark the Solution Platforms.(if not visible) Prepared by Asad Haroon

Transcript of comsatsbcs.files.wordpress.com€¦  · Web viewThen Open Linker and in general tab edit the...

OPENCV 3.4.1 Tutorial

Setup Link: https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/opencv-3.4.1-vc14_vc15.exe/download

Installation Steps:

1. Install OpenCv in Local Disk C:\opencv\ Folder2. Open Environmental Variables and then in the System Variables, click on New and then set Variable

Name : OPENCV_DIRVariable Value: C:\opencv\opencv\build\x64\vc15\

3. And click on Path and edit it, and create New Path and paste this %OPENCV_DIR%\bin4. Then Open VS2017 Community and create a empty project (Just like you have done in FCP) and

then create source file .cpp format.5. (Optional) And then follow the step as given in screenshot mark the Solution Platforms.(if not

visible)

Prepared by Asad Haroon

6. Right click on project and open properties.

Prepared by Asad Haroon

7. Then Click on C\C++ and General edit this Additional Include Directories

Then Click on New Button and paste the following two paths individually as shown in SS.

8. Then Open Linker and in general tab edit the library directories and click on new and paste the following path C:\opencv\opencv\build\x64\vc15\lib then move to next step.

Prepared by Asad Haroon

9. Open Input Tab and edit this and paste opencv_world341d.lib in it.

10. Restart your VS2017 and open your project which you have created earlier for OpenCV.

Prepared by Asad Haroon

11. Put the following code in the source file to test the sample program.

#include<opencv2\opencv.hpp>#include<iostream>

using namespace std;using namespace cv;int main(){

Mat image = imread("D:\\opencv.png");if (image.empty()){

printf("No image");return -1;

}imshow("Output", image);waitKey(0);return 0;

}Note: You can choose your own Path in imread function.

Prepared by Asad Haroon