Вы находитесь на странице: 1из 78

OpenCV

A short introduction to OpenCV libraries

Marco Moltisanti
Image Processing Lab
Dipartimento di Matematica e Informatica
Universit`
a degli Studi di Catania
moltisanti@dmi.unict.it

March 13, 2013

Intro

Resources

What?

OpenCV (Open Source Computer Vision) is a library of programming


functions containing all the standard algorithms for Computer Vision;

M. Moltisanti OpenCV

2/27

Intro

Resources

What?

OpenCV (Open Source Computer Vision) is a library of programming


functions containing all the standard algorithms for Computer Vision;
Currently, functions are implemented in C/C++, Python and Java;

M. Moltisanti OpenCV

2/27

Intro

Resources

What?

OpenCV (Open Source Computer Vision) is a library of programming


functions containing all the standard algorithms for Computer Vision;
Currently, functions are implemented in C/C++, Python and Java;
OpenCV libraries can run on Windows, Linux, Android and Mac
systems;

M. Moltisanti OpenCV

2/27

Intro

Resources

What?

OpenCV (Open Source Computer Vision) is a library of programming


functions containing all the standard algorithms for Computer Vision;
Currently, functions are implemented in C/C++, Python and Java;
OpenCV libraries can run on Windows, Linux, Android and Mac
systems;
Latest version is 2.4.4.

M. Moltisanti OpenCV

2/27

Intro

Resources

Where?

Download;

M. Moltisanti OpenCV

3/27

Intro

Resources

Where?

Download;
Documentation;

M. Moltisanti OpenCV

3/27

Intro

Resources

Where?

Download;
Documentation;
Tutorials.

M. Moltisanti OpenCV

3/27

Intro

Resources

Other Resources

Book: Learning OpenCV: Computer Vision with the OpenCV Library ;


Wiki;
C/C++ Cheatsheet (PDF);

M. Moltisanti OpenCV

4/27

Library structure

Main Packages

core Basic functionalities and data structures;

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;
calib3d Camera calibration and 3D Reconstruction;

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;
calib3d Camera calibration and 3D Reconstruction;
features2d Features detection and description;

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;
calib3d Camera calibration and 3D Reconstruction;
features2d Features detection and description;
objdetect Object detection;

M. Moltisanti OpenCV

5/27

Library structure

Main Packages

core Basic functionalities and data structures;


imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;
calib3d Camera calibration and 3D Reconstruction;
features2d Features detection and description;
objdetect Object detection;
ml Machine Learning and Pattern Recognition tools (e.g.
k-means, SVM, knn)

M. Moltisanti OpenCV

5/27

Library structure

Main Packages
core Basic functionalities and data structures;
imgproc Image processing functions (blurring, histograms,
registration, tracking, detection);
highgui High-level Graphical User Interface;
calib3d Camera calibration and 3D Reconstruction;
features2d Features detection and description;
objdetect Object detection;
ml Machine Learning and Pattern Recognition tools (e.g.
k-means, SVM, knn)
Data structures and functions belong to the namespace cv; therefore, to
access this functionality from your code, use the cv:: specifier or using
namespace cv; directive
M. Moltisanti OpenCV

5/27

Library structure

Include and libs

Directory structure
Let CVHOME be the folder where you have installed OpenCV.
CVHOME
bin
doc
include
opencv.....................old versions C/C++ header files
opencv2...................new versions C/C++ header files
lib
opencv {package name } {version }d.lib........Debug libs
opencv {package name } {version }.lib.......Release libs
Figure : OpenCV directory tree

M. Moltisanti OpenCV

6/27

Library structure

Include and libs

Example

Example
If you have installed OpenCV 2.4.2, the core functions and data
structures are declared in include/opencv2/core/core.hpp and can be
found in the library opencv core 242d.lib (Debug) and
opencv core 242.lib (Release)

M. Moltisanti OpenCV

7/27

Library structure

Compiling and running

Microsoft Visual Studio 2008/2010 - Standard

The Good old method


(1) Create a new, blank, C++ Project;
(2) Open Project Properties;
(3) Click on VC++ Directories;
(a) Add CVHOME/include directory to Additional Include Directories;

(4) Click on Linker ;


(a) Click on General, then add CVHOME/lib directory to Additional
Library Directories;
(b) Click on Input, then add the lib filenames you need to Additional
dependencies.

M. Moltisanti OpenCV

8/27

Library structure

Compiling and running

Microsoft Visual Studio 2008/2010 - Local Property Sheet

Local method
(1) Create a new, blank, C++ Project;
(2) Open the Property Manager ;
(3) Right click on Debug, then click on Add New Property Sheet;
(4) Apply the Good old method and save the property sheet;
(5) Do steps 2 and 3 for Release;
(6) Next time you want to create a new OpenCV-based project, just
click on Add Existing Property Sheet.

M. Moltisanti OpenCV

9/27

Library structure

Compiling and running

Microsoft Visual Studio 2008/2010 - Global Property Sheet


Global method
Visual Studio 2008
(1) Go to Tools Options Projects and Solutions;
(2) Apply the Good old method.

Visual Studio 2010


(1) Apply the local method to the Global Property Sheet (it should be
named Microsoft.Cpp.Win32.user).

Remember that OpenCV libraries for Debug and Release differs


only in the final d!
Be careful ;-)

M. Moltisanti OpenCV

10/27

Library structure

Basic classes

Geometric primitives - Points and Rectangles


Point Template class that represents a 2-column vector containing
the coordinates of a point in a plane;
Implemented classes:
Point, Point2i: integer coordinates;
Point2d: double coordinates;
Point2f: float coordinates.

M. Moltisanti OpenCV

11/27

Library structure

Basic classes

Geometric primitives - Points and Rectangles


Point Template class that represents a 2-column vector containing
the coordinates of a point in a plane;
Implemented classes:
Point, Point2i: integer coordinates;
Point2d: double coordinates;
Point2f: float coordinates.
Point3 Template class that represents a 3-column vector containing
the coordinates of a point in the space;
Point3, Point3i: integer coordinates;
Point3d: double coordinates;
Point3f: float coordinates.

M. Moltisanti OpenCV

11/27

Library structure

Basic classes

Geometric primitives - Points and Rectangles


Point Template class that represents a 2-column vector containing
the coordinates of a point in a plane;
Implemented classes:
Point, Point2i: integer coordinates;
Point2d: double coordinates;
Point2f: float coordinates.
Point3 Template class that represents a 3-column vector containing
the coordinates of a point in the space;
Point3, Point3i: integer coordinates;
Point3d: double coordinates;
Point3f: float coordinates.
Rect Template class that represents a rectangle, defined by the
upper-left corner coordinates, width and height.
M. Moltisanti OpenCV

11/27

Library structure

Basic classes

Geometric primitives - Points and Rectangles


Point Template class that represents a 2-column vector containing
the coordinates of a point in a plane;
Implemented classes:
Point, Point2i: integer coordinates;
Point2d: double coordinates;
Point2f: float coordinates.
Point3 Template class that represents a 3-column vector containing
the coordinates of a point in the space;
Point3, Point3i: integer coordinates;
Point3d: double coordinates;
Point3f: float coordinates.
Rect Template class that represents a rectangle, defined by the
upper-left corner coordinates, width and height.
M. Moltisanti OpenCV

11/27

Library structure

Basic classes

Geometric primitives - Example


1
2
3
4
5

...
P o i n t p1 ( 1 0 , 1 0 ) ;
P o i n t 2 i p2 ( 1 1 , 1 1 ) ;
P o i n t 2 d p3 ( 1 . 0 , 1 . 0 ) ;
P o i n t 2 f p4 ( 2 . 0 f , 2 . 0 f ) ;

6
7
8
9

P o i n t 3 i p5 ( 1 0 , 1 0 , 1 0 ) ;
P o i n t 3 d p6 ( 1 . 0 , 1 . 0 , 1 . 0 ) ;
P o i n t 3 f p7 ( 1 . 0 f , 1 . 0 f , 1 . 0 f ) ;

10
11
12
13
14

R e c t <i n t > r 1 ( 1 , 1 , 1 0 0 , 1 0 0 ) ;
R e c t <i n t > r 2 ( p1 , p2 ) ;
R e c t <d o u b l e > r 3 ( p3 , p3 1 0 . 0 ) ;
...

Listing 1: Ex01.cpp

M. Moltisanti OpenCV

12/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;
a filter;

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;
a filter;
an image;

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;
a filter;
an image;
a set of vectors (e.g. descriptors);

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;
a filter;
an image;
a set of vectors (e.g. descriptors);
etc.

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Class Mat
Mat is the fundamental class for doing everything in OpenCV. Mat can
represent:
a matrix;
a filter;
an image;
a set of vectors (e.g. descriptors);
etc.
A Mat object should always be released before exiting the program using
the Mat::release() function!

M. Moltisanti OpenCV

13/27

Library structure

Basic classes

Mat as an image

void loadImage () {

Mat img = i m r e a d ( l e n a . bmp ) ;


imshow ( Window , img ) ;
waitKey (0) ;
img . r e l e a s e ( ) ;

3
4
5
6
7

Listing 2: Ex02-Img.cpp

M. Moltisanti OpenCV

14/27

Library structure

Basic classes

Mat as a matrix
...
#i n c l u d e <o p e n c v 2 / i m g p r o c / i m g p r o c . hpp>
3 . . .
4 void rotationMatrix () {
5
Mat r o t ;
6
rot = getRotationMatrix2D ( Point2f (0.0 f , 0.0 f ) , 30.0 ,
1.0) ;
1
2

f o r ( i n t i =0; i < r o t . rows ; i ++) {


f o r ( i n t j =0; j < r o t . c o l s ; j ++)
c o u t << r o t . at<d o u b l e >( i , j ) << \ t ;
c o u t << e n d l ;
}

8
9
10
11
12
13
14

Listing 3: Ex02-Mat.cpp
M. Moltisanti OpenCV

15/27

Library structure

Basic classes

Mat as a filter
...
#i n c l u d e <o p e n c v 2 / i m g p r o c / i m g p r o c . hpp>
3 . . .
4 void
c r e a t e F i l t e r () {
1
2

Mat f l t ;
f l t = getGaussianKernel (5 , 2.0) ;

6
7
8

f o r ( i n t i =0; i < f l t . rows ; i ++) {


f o r ( i n t j =0; j < f l t . c o l s ; j ++)
c o u t << f l t . at<d o u b l e >( i , j ) << \ t ;
c o u t << e n d l ;
}

9
10
11
12
13
14

Listing 4: Ex02-Flt.cpp

M. Moltisanti OpenCV

16/27

Library structure

Basic classes

Mat as a set
1
2
3
4
5

void createObservationsSet () {
Mat d a t a ( 1 0 , 5 , CV 32S ) ;
f o r ( i n t i =0; i <10; i ++) {
f o r ( i n t j =0; j < 5 ; j ++)
d a t a . at<i n t >( i , j ) = r a n d ( ) 2 5 6 ;

7
8

f o r ( i n t i =0; i < d a t a . rows ; i ++) {


f o r ( i n t j =0; j < d a t a . c o l s ; j ++)
c o u t << d a t a . at<i n t >( i , j ) << \ t ;
c o u t << e n d l ;
}

9
10
11
12
13
14

Listing 5: Ex02-Set.cpp

M. Moltisanti OpenCV

17/27

Library structure

Basic classes

Notes on previous slides

As you probably noticed, we used two functions:


(1) getRotationMatrix2D;
(2) getGaussianKernel.
Both belong to imgproc subset, so we included the correspondent header
file (see source code for details).

M. Moltisanti OpenCV

18/27

Graphic User Interface

Loading, Showing and Writing an image

All graphical user interface (GUI) utilities are defined in highgui


library;
Include directive: opencv2\highgui\highgui.hpp;
imread(filename): reads the image from the filename passed as a
parameter. Returns a Mat;
imshow(windowname, image): show the image in a new window
titled windowname;
imwrite(filename, image, params): write the image in a new file
named filename using the format specific params. The format is
derived from the extension given in the filename.

M. Moltisanti OpenCV

19/27

Graphic User Interface

Loading, Showing and Writing an image

All graphical user interface (GUI) utilities are defined in highgui


library;
Include directive: opencv2\highgui\highgui.hpp;
imread(filename): reads the image from the filename passed as a
parameter. Returns a Mat;
imshow(windowname, image): show the image in a new window
titled windowname;
imwrite(filename, image, params): write the image in a new file
named filename using the format specific params. The format is
derived from the extension given in the filename.

M. Moltisanti OpenCV

19/27

Graphic User Interface

Loading, Showing and Writing an image

All graphical user interface (GUI) utilities are defined in highgui


library;
Include directive: opencv2\highgui\highgui.hpp;
imread(filename): reads the image from the filename passed as a
parameter. Returns a Mat;
imshow(windowname, image): show the image in a new window
titled windowname;
imwrite(filename, image, params): write the image in a new file
named filename using the format specific params. The format is
derived from the extension given in the filename.

M. Moltisanti OpenCV

19/27

Graphic User Interface

Loading, Showing and Writing an image

All graphical user interface (GUI) utilities are defined in highgui


library;
Include directive: opencv2\highgui\highgui.hpp;
imread(filename): reads the image from the filename passed as a
parameter. Returns a Mat;
imshow(windowname, image): show the image in a new window
titled windowname;
imwrite(filename, image, params): write the image in a new file
named filename using the format specific params. The format is
derived from the extension given in the filename.

M. Moltisanti OpenCV

19/27

Graphic User Interface

Loading, Showing and Writing an image

All graphical user interface (GUI) utilities are defined in highgui


library;
Include directive: opencv2\highgui\highgui.hpp;
imread(filename): reads the image from the filename passed as a
parameter. Returns a Mat;
imshow(windowname, image): show the image in a new window
titled windowname;
imwrite(filename, image, params): write the image in a new file
named filename using the format specific params. The format is
derived from the extension given in the filename.

M. Moltisanti OpenCV

19/27

Graphic User Interface

Loading, Showing and Writing an image


...
// Read t h e image
3 cv : : Mat l e n a = cv : : i m r e a d ( l e n a . bmp ) ;
1
2

//Show t h e image
cv : : imshow ( Lena , l e n a ) ;
7 cv : : w a i t K e y ( 0 ) ;
5
6

// S e t params
s t d : : v e c t o r <i n t > j p g p a r a m ;
11 j p g p a r a m . p u s h b a c k ( CV IMWRITE JPEG QUALITY ) ;
12 j p g p a r a m . p u s h b a c k ( 5 0 ) ;
9

10

13

// W r i t e t h e image
cv : : i m w r i t e ( l e n a . j p g , l e n a , j p g p a r a m ) ;
16 . . .
14
15

Listing 6: Ex03.cpp
M. Moltisanti OpenCV

19/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter

Include directive: opencv2\imgproc\imgproc.hpp;


Load the image;
Create the output image;
Create and apply the filter;
Show the image;
Save the image.

M. Moltisanti OpenCV

20/27

Image Processing

Apply a built-in filter


...
// Read t h e image
3 Mat l e n a = i m r e a d ( l e n a . bmp ) ;
1
2

4
5
6

//Show t h e o r i g i n a l image
imshow ( Lena o r i g i n a l , l e n a ) ;

7
8
9

// C r e a t e t h e o u t p u t image
Mat l e n a c a n n y = l e n a . c l o n e ( ) ;

10
11

...

12

// C r e a t e and a p p l y t h e f i l t e r
Canny ( l e n a , l e n a c a n n y , m[ 0 ] 0 . 6 6 , m[ 0 ] 1 . 3 3 ) ;
15 . . .
13
14

Listing 7: Ex04.cpp
M. Moltisanti OpenCV

20/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device

Video handling is included in highgui package;


Include directive: opencv2\highgui\highgui.hpp;
Declare a VideoCapture(id) object; id is the camera identification
number;
Enter a loop;
In each iteration:
Grab a frame using the >> operator and store it in a Mat object;
Check if the frame is empty;;
Show the frame;

M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from device


V i d e o C a p t u r e vc ( 0 ) ;
char res = 0 ;
3 int
f p s = vc . g e t ( CV CAP PROP FPS ) ;
4 Mat f r a m e ;
5 while (1) {
6
vc >> f r a m e ;
7
i f ( f r a m e . empty ( ) )
8
break ;
9
imshow ( V i d e o , f r a m e ) ;
10
r e s = ( char ) ( waitKey (0) ) ;
1
2

11
12
13
14
15

i f ( r e s == q )
break ;
}
vc . r e l e a s e ( ) ;

Listing 8: Ex05-In.cpp
M. Moltisanti OpenCV

21/27

Image Processing

Video Handling

Video from file

The difference between using a video from file and a video from a device is
only in the constructor. Instead of VideoCapture(id) function, we will
use the overloaded version VideoCapure(filename), where filename is
the path to a video file.

Example
VideoCapture vc(video.mp4)

M. Moltisanti OpenCV

22/27

Image Processing

Video Handling

Save a video

Declare a VideoWriter objectand set the properties for the new


video using the constructor;
Put the frames in the VideoWriter object using the << operator;
Release the VideoWriter object.

M. Moltisanti OpenCV

23/27

Image Processing

Video Handling

Save a video

Declare a VideoWriter objectand set the properties for the new


video using the constructor;
Put the frames in the VideoWriter object using the << operator;
Release the VideoWriter object.

M. Moltisanti OpenCV

23/27

Image Processing

Video Handling

Save a video

Declare a VideoWriter objectand set the properties for the new


video using the constructor;
Put the frames in the VideoWriter object using the << operator;
Release the VideoWriter object.

M. Moltisanti OpenCV

23/27

Image Processing

Video Handling

Save a video
1

S i z e s ( vc . g e t (CV CAP PROP FRAME WIDTH) , vc . g e t (


CV CAP PROP FRAME HEIGHT ) ) ;
V i d e o W r i t e r vw ( v i d e o O u t . a v i , vc . g e t ( CV CAP PROP FOURCC )
, vc . g e t ( CV CAP PROP FPS ) , s , t r u e ) ;

3
4

while (1) {

...
f l i p ( frame , newFrame , 1 ) ;
vw << newFrame ;
imshow ( I t s s o m e t h i n g ! , newFrame ) ;
r e s = ( char ) waitKey (1000/ f p s ) ;
...

6
7
8
9
10
11
12

Listing 9: Ex05-Out.cpp

M. Moltisanti OpenCV

23/27

Machine Learning

Available methods

Statistical Models;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;
Boosting;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;
Boosting;
Gradient Boosted Trees;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;
Boosting;
Gradient Boosted Trees;
Random Trees;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;
Boosting;
Gradient Boosted Trees;
Random Trees;
EM algorithm;

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Statistical Models;
Normal Bayes Classifier;
K-NN;
SVM;
Decision Trees;
Boosting;
Gradient Boosted Trees;
Random Trees;
EM algorithm;
Neural Networks.

M. Moltisanti OpenCV

24/27

Machine Learning

Available methods

Include Directive
Include path: <opencv2\ml\ml.hpp>
Documentation is fundamental using ml functions!

M. Moltisanti OpenCV

24/27

In conclusion...

Tips & Tricks


Tip #1
Documentation is your biggest friend while developing!
Tip #2
Community is your second biggest friend!
Google to find out how your colleagues all around the world solved their
problems!

Tip #3
Dont try to copy!

M. Moltisanti OpenCV

25/27

In conclusion...

If you have doubts dont hesitate to contact me at:


moltisanti@dmi.unict.it;
IPLab (room 146 - ground floor);
Room 31 - first floor in the classrooms area.
Slides available at
Course page
Personal page
Code available here - Personal page

M. Moltisanti OpenCV

26/27

In conclusion...

Question time!

M. Moltisanti OpenCV

27/27

Вам также может понравиться