Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
(Open Source Computer Vision)
Outline
●

Overview and practical issues.

●

A selection of OpenCV functionality:
–
–

Object classification and tracking...
Overview: Capabilities
Overview: License
●

BSD Licensed (free and open source)

●

May be used in commercial software.

●

No requirement to pub...
Overview: Patents

●

Note: A couple of algorithms (SIFT and SURF)
that are implemented are patented.
–

You can't acciden...
Overview: Users

●

Stitching street-view images together,

●

Detecting intrusions in surveillance video in Israel

●

De...
Overview: Environment
Overview: Environment

Primary API
is C++

Leverages
ARM NEON
Overview: Installation
●

Ubuntu VM:
–

●

sudo apt-get install libopencv-dev

Windows:
–

Download latest version from ht...
Overview: Hello World
Makefile
CC=g++
CFLAGS+=-std=c++0x `pkg-config
opencv --cflags`
LDFLAGS+=`pkg-config opencv
--libs`
...
Overview: Hello World
Makefile
CC=g++
CFLAGS+=-std=c++0x `pkg-config
opencv --cflags`
LDFLAGS+=`pkg-config opencv
--libs`
...
Overview: Hello World
hello.cpp

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostrea...
Overview: Hello World
hello.cpp

#include
#include
#include
#include

<opencv2/core/core.hpp>
<opencv2/imgproc/imgproc.hpp...
Overview: Hello World
hello.cpp

#include
#include
#include
#include

<opencv2/core/core.hpp>
<opencv2/imgproc/imgproc.hpp...
Python: Display an image file
import cv2
image = cv2.imread("lena.bmp");
if image.empty():
print "Could not load image"
ex...
Video from IP camera w/ RTSP!
#include <opencv/cxcore.h>
#include <opencv/highgui.h>
int main(int argc, char* argv[])
{
cv...
A Selection of Functionality
●

Image enhancement
–

●

Noise reduction, local contrast enhancement

Object classification...
Image Enhancement
Many many algorithms. Here are a few:
●

●

●

Deconvolution – used to reduce focus blur or
motion blur ...
Image Enhancement: Demo!
●

Deconvolution – Reducing motion blur below
where the motion is known.
Image Enhancement: Demo!
●

Deconvolution – Can also be used for poor
camera focus, but the parameters of the blur
must be...
Image Enhancement: Demo!
●

Deconvolution – Can also be used for poor
camera focus, but the parameters of the blur
must be...
Image Enhancement
●

Histogram equalization: equalizeHist(img,

out)
Image Enhancement
●

Histogram equalization: equalizeHist(img,

Increases the
range of intensities
in an image, thereby
in...
Object detection and tracking
●

Foreground/background segmentation –
identify objects moving in a scene.
–

●

Histogram ...
Face Detection and Recognition
Face detection and recognition
●

Detection:
–
–

●

Haar cascade – detect faces by identifying
adjacent light and dark re...
Face detection: C++
cv::CascadeClassifier profileFaceCascade;
profileFaceCascade.load("haarcascade_profileface.xml");
std:...
Face detection: C++
cv::CascadeClassifier profileFaceCascade;
profileFaceCascade.load("haarcascade_profileface.xml");
std:...
Face detection
●

Can be defeated with makeup...
Face detection
●

... or with special glasses containing IR LEDs.
Conclusion
●

●
●

●

OpenCV is for image/video processing and
computer vision.
Free and open source (BSD licensed)
Cross-...
More Information
●

Official Page: http://opencv.org

●

Tutorials: http://docs.opencv.org/doc/tutorials/tutorials.html

●...
Upcoming SlideShare
Loading in …5
×
Upcoming SlideShare
Image Processing with OpenCV
Next
Download to read offline and view in fullscreen.

16

Share

Download to read offline

OpenCV Introduction

Download to read offline

Very brief introduction to OpenCV.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

OpenCV Introduction

  1. 1. (Open Source Computer Vision)
  2. 2. Outline ● Overview and practical issues. ● A selection of OpenCV functionality: – – Object classification and tracking – ● Image enhancement Face detection and recognition Conclusion and further resources.
  3. 3. Overview: Capabilities
  4. 4. Overview: License ● BSD Licensed (free and open source) ● May be used in commercial software. ● No requirement to publish the source! ● Must acknowledge OpenCV was used in the documentation by including its copyright notice. Note: There is a C#/.NET wrapper for OpenCV called “Emgu CV” that may be commercially licensed.
  5. 5. Overview: Patents ● Note: A couple of algorithms (SIFT and SURF) that are implemented are patented. – You can't accidentally use them because they are in a separate module called “nonfree”.
  6. 6. Overview: Users ● Stitching street-view images together, ● Detecting intrusions in surveillance video in Israel ● Detection of swimming pool drowning accidents in Europe
  7. 7. Overview: Environment
  8. 8. Overview: Environment Primary API is C++ Leverages ARM NEON
  9. 9. Overview: Installation ● Ubuntu VM: – ● sudo apt-get install libopencv-dev Windows: – Download latest version from http://opencv.org/ For Python: ● ● ● Also install Python from http://www.python.org/ Install numpy module Copy the “cv2” module from OpenCV to C:Python27Libsite-packages
  10. 10. Overview: Hello World Makefile CC=g++ CFLAGS+=-std=c++0x `pkg-config opencv --cflags` LDFLAGS+=`pkg-config opencv --libs` PROG=hello OBJS=$(PROG).o .PHONY: all clean $(PROG): $(OBJS) $(CC) -o $(PROG).out $ (OBJS) $(LDFLAGS) hello.cpp #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> int main() { cv::Mat image = cv::imread("lena.bmp"); if (image.empty()) { std::cerr << "Could not load image"; return 1; } %.o: %.cpp $(CC) -c $(CFLAGS) $< all: $(PROG) clean: rm -f $(OBJS) $(PROG) } cv::namedWindow("Image"); cv::imshow("Image", image); cv::waitKey(); return 0;
  11. 11. Overview: Hello World Makefile CC=g++ CFLAGS+=-std=c++0x `pkg-config opencv --cflags` LDFLAGS+=`pkg-config opencv --libs` PROG=hello OBJS=$(PROG).o .PHONY: all clean $(PROG): $(OBJS) $(CC) -o $(PROG).out $ (OBJS) $(LDFLAGS) hello.cpp #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> int main() { cv::Mat image = cv::imread("lena.bmp"); if (image.empty()) { std::cerr << "Could not load image"; return 1; } %.o: %.cpp $(CC) -c $(CFLAGS) $< all: $(PROG) clean: rm -f $(OBJS) $(PROG) } cv::namedWindow("Image"); cv::imshow("Image", image); cv::waitKey(); return 0;
  12. 12. Overview: Hello World hello.cpp #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> int main() { cv::Mat image = cv::imread("lena.bmp"); if (image.empty()) { std::cerr << "Could not load image"; return 1; } } cv::namedWindow("Image"); cv::imshow("Image", image); cv::waitKey(); return 0;
  13. 13. Overview: Hello World hello.cpp #include #include #include #include <opencv2/core/core.hpp> <opencv2/imgproc/imgproc.hpp> <opencv2/highgui/highgui.hpp> <iostream> int main() { cv::Mat image = cv::imread("lena.bmp"); if (image.empty()) { std::cerr << "Could not load image"; return 1; } cv::blur(image, image, cv::Size(10, 10)); } cv::namedWindow("Image"); cv::imshow("Image", image); cv::waitKey(); return 0; Add a filter to blur the image before displaying it.
  14. 14. Overview: Hello World hello.cpp #include #include #include #include <opencv2/core/core.hpp> <opencv2/imgproc/imgproc.hpp> <opencv2/highgui/highgui.hpp> <iostream> int main() { cv::Mat image = cv::imread("lena.bmp"); if (image.empty()) { std::cerr << "Could not load image"; return 1; } cv::blur(image, image, cv::Size(10, 10)); } cv::namedWindow("Image"); cv::imshow("Image", image); cv::waitKey(); return 0;
  15. 15. Python: Display an image file import cv2 image = cv2.imread("lena.bmp"); if image.empty(): print "Could not load image" exit(1) cv2.namedWindow("Image") cv2.imshow("Image", image) cv2.waitKey() Similar structure and naming as C++ version means Python is good for prototyping.
  16. 16. Video from IP camera w/ RTSP! #include <opencv/cxcore.h> #include <opencv/highgui.h> int main(int argc, char* argv[]) { cv::Ptr<CvCapture> capture = cvCaptureFromFile( "rtsp://admin:admin@10.10.32.33/video"); cv::namedWindow("Frame"); for (;;) { cv::Mat frame = cvQueryFrame(capture); cv::imshow("Frame", frame); if (cv::waitKey(1) >= 0) break; } return 0; } Network comm., RTSP protocol, etc. is all handled for you so all you have to do is process each frame as an image (a cv::Mat object).
  17. 17. A Selection of Functionality ● Image enhancement – ● Noise reduction, local contrast enhancement Object classification and tracking – – ● Track the paths that objects take in a scene Differentiating between cars and trucks Face detection and recognition – Identify faces seen in images or video.
  18. 18. Image Enhancement Many many algorithms. Here are a few: ● ● ● Deconvolution – used to reduce focus blur or motion blur where the motion is known. Unsharp masking – increases sharpness and local contrast (like WDR) Histogram equalization – stretches contrast and somewhat corrects for over- or underexposure.
  19. 19. Image Enhancement: Demo! ● Deconvolution – Reducing motion blur below where the motion is known.
  20. 20. Image Enhancement: Demo! ● Deconvolution – Can also be used for poor camera focus, but the parameters of the blur must be estimated in advance.
  21. 21. Image Enhancement: Demo! ● Deconvolution – Can also be used for poor camera focus, but the parameters of the blur must be estimated in advance. Generated using OpenCV example: /opencv/samples/python2/deconvolution.py
  22. 22. Image Enhancement ● Histogram equalization: equalizeHist(img, out)
  23. 23. Image Enhancement ● Histogram equalization: equalizeHist(img, Increases the range of intensities in an image, thereby increasing contrast. out)
  24. 24. Object detection and tracking ● Foreground/background segmentation – identify objects moving in a scene. – ● Histogram backprojection – identify objects by their colour (even if they're not moving). – ● cv::BackgroundSubtractorMOG2 cv::calcBackProject() Camshift tracking – track objects by their colour. – cv::CamShift
  25. 25. Face Detection and Recognition
  26. 26. Face detection and recognition ● Detection: – – ● Haar cascade – detect faces by identifying adjacent light and dark regions. cv::CascadeClassifier Recognition: – Eigenfaces classifier – for facial recognition – cv::FaceRecognizer
  27. 27. Face detection: C++ cv::CascadeClassifier profileFaceCascade; profileFaceCascade.load("haarcascade_profileface.xml"); std::vector<cv::Rect> faceRects; profileFaceCascade.detectMultiScale(image, faceRects); cv::Mat foundFacesImage = image.clone(); for (std::vector<cv::Rect>::const_iterator rect = faceRects.begin(); rect != faceRects.end(); ++ rect) { cv::rectangle(foundFacesImage, *rect, cv::Scalar(0, 0, 255), 3); } cv::namedWindow("Faces"); cv::imshow("Faces", foundFacesImage); cv::waitKey();
  28. 28. Face detection: C++ cv::CascadeClassifier profileFaceCascade; profileFaceCascade.load("haarcascade_profileface.xml"); std::vector<cv::Rect> faceRects; profileFaceCascade.detectMultiScale(image, faceRects); with OpenCV comes other classifier XML cv::Mat foundFacesImage = image.clone(); files for detecting other for (std::vector<cv::Rect>::const_iterator rect (e.g eyes, things = faceRects.begin(); rect != faceRects.end(); ++ rect) glasses, profile faces) { } cv::rectangle(foundFacesImage, *rect, cv::Scalar(0, 0, 255), 3); cv::namedWindow("Faces"); cv::imshow("Faces", foundFacesImage); cv::waitKey();
  29. 29. Face detection ● Can be defeated with makeup...
  30. 30. Face detection ● ... or with special glasses containing IR LEDs.
  31. 31. Conclusion ● ● ● ● OpenCV is for image/video processing and computer vision. Free and open source (BSD licensed) Cross-platform and actively developed (also downloaded over 3 million times)! This presentation covered just a few of the over 2,000 algorithms available in OpenCV.
  32. 32. More Information ● Official Page: http://opencv.org ● Tutorials: http://docs.opencv.org/doc/tutorials/tutorials.html ● Books:
  • KomalBorkar3

    May. 25, 2021
  • RanaTag

    Jul. 27, 2020
  • yuwanthanethsara

    Jul. 1, 2020
  • ssuser6430bc

    May. 25, 2020
  • royalesruthi

    May. 28, 2018
  • nisnabudas

    Jul. 6, 2017
  • Mohamed_Shoman

    Jun. 28, 2017
  • OlomijeEzekiel

    Jun. 18, 2017
  • SmithaRaghav

    Apr. 3, 2017
  • danielagudelo6

    Feb. 12, 2017
  • sakthiinfotec

    Jan. 26, 2017
  • nanabababurkajan

    Nov. 19, 2016
  • reddypdl

    Sep. 12, 2015
  • RonLeeLee

    Jun. 10, 2015
  • goushoshiyaha

    May. 15, 2014
  • prashantdawar

    Jan. 15, 2014

Very brief introduction to OpenCV.

Views

Total views

17,456

On Slideshare

0

From embeds

0

Number of embeds

13

Actions

Downloads

1,120

Shares

0

Comments

0

Likes

16

×