Download - Introduction to OpenCV
![Page 1: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/1.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
INTRODUCTION TO OPENCV
![Page 2: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/2.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline
What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV
![Page 3: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/3.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline
What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV
![Page 4: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/4.jpg)
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
![Page 5: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/5.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Linux Vs. Windows
Recommended : Install on Linux NOT Recommended : OpenCV on
Windows
![Page 6: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/6.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline
What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV
![Page 7: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/7.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux
http://www.ubuntu.com/download/ubuntu/windows-installer
![Page 8: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/8.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux
http://www.ubuntu.com/download/ubuntu/windows-installer
![Page 9: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/9.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux
http://www.ubuntu.com/download/ubuntu/windows-installer
![Page 10: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/10.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux
http://www.ubuntu.com/download/ubuntu/windows-installer
![Page 11: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/11.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Installing Linux
http://www.ubuntu.com/download/ubuntu/windows-installer
![Page 12: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/12.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline
What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV
![Page 13: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/13.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation Open Synaptic Package Manager
![Page 14: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/14.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation Set Proxy
![Page 15: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/15.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
OpenCV Installation Search & Install “opencv-dev”
![Page 16: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/16.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Outline
What is OpenCV Installing Ubuntu Installing OpenCV Coding with OpenCV References for OpenCV
![Page 17: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/17.jpg)
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”
![Page 18: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/18.jpg)
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
![Page 19: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/19.jpg)
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
![Page 20: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/20.jpg)
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]; } }}
![Page 21: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/21.jpg)
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)
![Page 22: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/22.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Links
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html
OpenCV Introduction:
OpenCV E-Book:
http://opencv.willowgarage.com/wiki/
Official Site:
“Learning OpenCV” By Gary Bradski and Adrian Kaehler
![Page 23: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/23.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Download
Download “OpenCV Kit” – lnmiitdip.wordpress.com
Contains Instruction for compilation Sample code Video dataset
![Page 24: Introduction to OpenCV](https://reader036.vdocuments.site/reader036/viewer/2022081503/568150a5550346895dbeae88/html5/thumbnails/24.jpg)
LNMIIT DIP Winter Workshop 2011. Manohar Kuse
Thanks