270 likes | 544 Views
Introduction to OpenCV. Outline. What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV. Outline. What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV. What is OpenCV.
E N D
LNMIIT DIP Winter Workshop 2011. Manohar Kuse Introduction to OpenCV
Outline • What is OpenCV • Installing Ubuntu • Installing OpenCV • Coding with OpenCV • References for OpenCV LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline • What is OpenCV • Installing Ubuntu • Installing OpenCV • Coding with OpenCV • References for OpenCV LNMIIT DIP Winter Workshop 2011. Manohar Kuse
What is OpenCV • C++ Library for Image Processing and Computer Vision • Developed by Intel • Can take advantage of multiple processors • Developed for high performance • Support for Web-cam, Microsoft Connect and other specialized cameras LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Linux Vs. Windows • Recommended : Install on Linux • NOT Recommended : OpenCV on Windows LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline • What is OpenCV • Installing Ubuntu • Installing OpenCV • Coding with OpenCV • References for OpenCV LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux http://www.ubuntu.com/download/ubuntu/windows-installer LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux http://www.ubuntu.com/download/ubuntu/windows-installer LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux http://www.ubuntu.com/download/ubuntu/windows-installer LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux http://www.ubuntu.com/download/ubuntu/windows-installer LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux http://www.ubuntu.com/download/ubuntu/windows-installer LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline • What is OpenCV • Installing Ubuntu • Installing OpenCV • Coding with OpenCV • References for OpenCV LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation • Open Synaptic Package Manager LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation • Set Proxy LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation • Search & Install “opencv-dev” LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline • What is OpenCV • Installing Ubuntu • Installing OpenCV • Coding with OpenCV • References for OpenCV LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Sample Code • Header Files #include <stdlib.h> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> Sample code and compilation instructions : Opencv kit for download on “lnmiitdip.wordpress.com” LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Sample Code IplImage* img = 0; Declaration of opencv-image char * fileName = “file.png”; img=cvLoadImage(fileName); Load image as a struct LNMIIT DIP Winter Workshop 2011. Manohar Kuse
IplImage • Height : img->height • Width : img->width • Channels : img->nChannels • (Number of channels) • Data : img->imageData • (Array of size W x H x nC LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Sample Code • Iterate through the IplImage for(i=0;i<height;i++) { for(j=0;j<width;j++) { for(k=0;k<channels;k++) { data[i*step+j*channels+k]=255- data[i*step+j*channels+k]; } } } LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Sample Code cvNamedWindow("mainWin“,CV_WINDOW_AUTOSIZE); Create a display window cvShowImage("mainWin", img ); Show Image cvWaitKey(0); Give delay (Pause) LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Links OpenCV Introduction: http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html OpenCV E-Book: “Learning OpenCV” By Gary Bradski and Adrian Kaehler Official Site: http://opencv.willowgarage.com/wiki/ LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Download • Download “OpenCV Kit” – lnmiitdip.wordpress.com • Contains • Instruction for compilation • Sample code • Video dataset LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Thanks LNMIIT DIP Winter Workshop 2011. Manohar Kuse