Open CV Configuration Dr Wajahat Mahmood Qazi Assistant

  • Slides: 15
Download presentation
Open. CV Configuration Dr. Wajahat Mahmood Qazi Assistant Professor Department of Computer Science, GC

Open. CV Configuration Dr. Wajahat Mahmood Qazi Assistant Professor Department of Computer Science, GC University, Lahore Asma Kanwal Lecturer Department of Computer Science, GC University, Lahore

Step 1 Download and extract opencv file

Step 1 Download and extract opencv file

Step 2 Configure system environment variable Open Run using win+r key and type "sysdm.

Step 2 Configure system environment variable Open Run using win+r key and type "sysdm. cpl" hit enter. 2. It will open System Properties. Click on Advanced tab and in advanced tab again click on "Environment Variables“ 3. will open Environment Variable window. Here you will find two types if variables. Click on New button below System variables. 1.

Step 2 4. Now it will take to you in Edit System Variable where

Step 2 4. Now it will take to you in Edit System Variable where two fields are required to be field. Enter following values in those two fields. Variable name : OPENCV_INSTALL Variable value : C: opencvbuildx 86vc 10 Click on OK button 5. Now its time to set path for a binary files. So in a frame of System Variables there is one predefined variable named Path. Click on it and hit Edit button.

Step 2 6. Now again it will take to you in Edit System Variable.

Step 2 6. Now again it will take to you in Edit System Variable. Here do not write anything inside Variable name. In Variable value field you will find some pre-defined values, do not change them. Enter ; %OPENCV_INSTALL%bin. Final summary is. . . Variable name : Do not change anything Variable value : ; %OPENCV_INSTALL%bin Click on OK button. So we are done with configuring system variables. Now click on OK in Environment Variables window and then in System Properties windows click on Apply and then OK.

Step 3 Configuring with visual studio 2010 1. Create a new project in Microsoft

Step 3 Configuring with visual studio 2010 1. Create a new project in Microsoft Visual C++ with Win 32 Console Application. In Win 32 Application Wizard click on Finish. 2. Now click on Property Manager and insert New Property Sheet named Release_PS 3. Double click on Release_PS. Expand Common Properties and in it also expand C/C++. Now click on Genral and here edit Additional Include Directories with path C: opencvbuildincludeopencv 2 C: opencvbuildinclude

Step 3 4. Now expand Linker and select General. Now select "Additional Library Directories"

Step 3 4. Now expand Linker and select General. Now select "Additional Library Directories" and inside it write $(OPENCV_INSTALL)lib 5. Again inside Linker select Input. Here in Additional Dependencies you need to insert library files given in C: opencvbuildx 86vc 10lib and C: opencvbuildx 86vc 10staticlib.

Step 3 opencv_calib 3 d 243. lib opencv_contrib 243. lib opencv_core 243. lib opencv_features

Step 3 opencv_calib 3 d 243. lib opencv_contrib 243. lib opencv_core 243. lib opencv_features 2 d 243. lib opencv_flann 243. lib opencv_gpu 243. lib opencv_haartraining_engine. lib opencv_highgui 243. lib opencv_imgproc 243. lib opencv_legacy 243. lib opencv_ml 243. lib opencv_nonfree 243. lib opencv_objdetect 243. lib opencv_photo 243. lib opencv_stitching 243. lib opencv_ts 243. lib opencv_videostab 243. lib

Step 3 6. Now we are going to add one more property sheet. Follow

Step 3 6. Now we are going to add one more property sheet. Follow step 2 to 4 same as above with only difference is property sheet name would be DEBUG_PS 7. Again add library files in this new property sheet DEBUG_PS under Linker >> Input >> Additional Library Directories. Here add library files which end with latter 'd' from same path C: opencvbuildx 86vc 10lib and C: opencvbuildx 86vc 10staticlib.

Step 3 opencv_calib 3 d 243 d. lib opencv_contrib 243 d. lib opencv_core 243

Step 3 opencv_calib 3 d 243 d. lib opencv_contrib 243 d. lib opencv_core 243 d. lib opencv_features 2 d 243 d. lib opencv_flann 243 d. lib opencv_gpu 243 d. lib opencv_haartraining_engined. lib opencv_highgui 243 d. lib opencv_imgproc 243 d. lib opencv_legacy 243 d. lib opencv_ml 243 d. lib opencv_nonfree 243 d. lib opencv_objdetect 243 d. lib opencv_photo 243 d. lib opencv_stitching 243 d. lib opencv_ts 243 d. lib opencv_videostab 243 d. lib

Conversion of win 32 project in 64 1. 2. 3. 4. 5. 6. 7.

Conversion of win 32 project in 64 1. 2. 3. 4. 5. 6. 7. 8. 9. Right click on solution explorer project Go to properties Go to configuration properties Click on configuration manager Click of active platform drop down menu Click new option Choose x 64 as active platform Click ok Apply current setting and click ok

Open. Cv Structure

Open. Cv Structure

Opencv Data Types If white rectanglebetween (5, 10) and (20, 30); you could simply

Opencv Data Types If white rectanglebetween (5, 10) and (20, 30); you could simply call: cv. Rectangle( my. Img, cv. Point(5, 10), cv. Point(20, 30), cv. Scalar(255, 255) );

Image class

Image class

A Sample Code �#include <highgui. h> �Using namespace cv; �void main() �{ �} ▪

A Sample Code �#include <highgui. h> �Using namespace cv; �void main() �{ �} ▪ Ipl. Image* img = cv. Load. Image( "D: \abc. jpg" ); ▪ cv. Named. Window("Image Loader", CV_WINDOW_AUTOSIZE ); ▪ cv. Show. Image( "Image Loader", img ); ▪ cv. Wait. Key(0); ▪ cv. Release. Image( &img ); ▪ cv. Destroy. Window("Image Loader" );