The document discusses computer vision and the OpenCV library. It provides an overview of computer vision concepts like transforming camera data into decisions or representations. It then describes OpenCV as an open source library for computer vision algorithms that can be used across platforms. Finally, it gives examples of OpenCV functions for tasks like erosion, dilation, edge detection and face detection.
Boost Fertility New Invention Ups Success Rates.pdf
Computer vision
1. Computer Vision and Apps
Antonio Radesca
Developer-Architect
MCPD
antrad@libero.it
antonio@nextgenerationteam.com
Fiore Rosalba
www.fiorerosalba.biz
1
2. Computer Vision
• Transformation of data from a still or
video camera into either a decision or a
new representation.
• Data - > “the camera is mounted in a car”
or “laser range fi nder indicates an object
is 1 meter away”.
• Decision -> “there is a person in this
scene” or “there are 14 tumor cells on
this slide”
• New representation -> turning a color
image into a grayscale image
4/14/2013 Confidential 2
3. Machine prospective
• A 2d Image of a 3d object.
• No definite way to reconstruct the 3d
image.
4/14/2013 Confidential 3
4. Machine prospective
• Images are corrupted by noise and
distortions.
• (weather, lighting, reflections, move
ments)
4/14/2013 Confidential 4
5. OpenCV
• OpenCV (Open Source Computer
Vision)
• library of programming functions for real
time computer vision. (computer
efficiency)
• Written in optimized C and C++
• Runs in windows, Linux and MAC OS.
• Can develop in
C, C++, python, ruby, matlab,Java,.NET
4/14/2013 Confidential 5
8. Applications
• Human-Computer Interaction (HCI)
• Object Identification, Segmentation and
Recognition
• Face Recognition
• Motion Tracking, Ego Motion, Motion
Understanding
• Stereo and Multi-Camera Calibration and
Depth Computation
• Mobile Robotics
4/14/2013 Confidential 8
9. Who uses
• license for OpenCV has been structured
such that you can build a commercial
product using all or part of OpenCV.
• You are under no obligation to
opensource
• large user community that includes
people from major companies
(IBM, Microsoft
, Intel, SONY, Siemens, and Google, to
name only a few) and research centers
(such as
Stanford, MIT, CMU, Cambridge, and
4/14/2013 Confidential 9
INRIA).
10. Using OpenCV
• Use static libraries
• Compile OpenCV
• Download sample from GITHUB
4/14/2013 Confidential 10
11. Basic Struct
typedef struct _IplImage
{
int nSize;int ID;int nChannels;int alphaChannel;int depth;
char colorModel[4];
char channel
int dataOrder;
int origin;
int align;
int width;int height;
struct _IplROI *roi;
struct _IplImage *maskROI;
void *imageId;
struct _IplTileInfo *tileInf
int imageSize;
char *imageData;
int widthStep;
char *imageDataOrigin;
}
IplImage;
4/14/2013 Confidential 11
14. Erosion
• Characteristics of Erosion
• Erosion generally decreases the sizes of objects and removes
small anomalies by subtracting objects with a radius smaller
than the structuring element.
• With grayscale images, erosion reduces the brightness (and
therefore the size) of bright objects on a dark background by
taking the neighborhood minimum when passing the structuring
element over the image.
• With binary images, erosion completely removes objects smaller
than the structuring element and removes perimeter pixels from
larger image objects.
4/14/2013 Confidential 14
15. cvErode
• void cvErode( const CvArr* src, CvArr* dst, IplConvKernel*
element=NULL, int iterations=1 );
• If it is NULL, a 3×3 rectangular structuring element is used.
iterationsNumber of times erosion is applied. The function
cvErode erodes the source image using the specified structuring
element that determines the shape of a pixel neighborhood over
which the minimum is taken:
• dst=erode(src,element): dst(x,y)=min((x',y') in element))src(x+x',y+y')
The function supports the in-place mode. Erosion can be applied
several (iterations) times. In case of color image each channel is
processed independently.
4/14/2013 Confidential 15
16. Dilation
• Characteristics of Dilation
• Dilation generally increases the sizes of objects, filling in
holes and broken areas, and connecting areas that are
separated by spaces smaller than the size of the
structuring element.
• With grayscale images, dilation increases the brightness
of objects by taking the neighborhood maximum when
passing the structuring element over the image.
• With binary images, dilation connects areas that are
separated by spaces smaller than the structuring element
and adds pixels to the perimeter of each image object.
4/14/2013 Confidential 16
17. Dilate
• void cvDilate( const CvArr* src, CvArr* dst, IplConvKernel*
element=NULL, int iterations=1 );
• If it is NULL, a 3×3 rectangular structuring element is used.
iterationsNumber of times erosion is applied. The function
cvDilate dilates the source image using the specified structuring
element that determines the shape of a pixel neighborhood over
which the maximum is taken:
• dst=dilate(src,element): dst(x,y)=max((x',y') in element))src(x+x',y+y')
The function supports the in-place mode. Dilation can be applied
several (iterations) times. In case of color image each channel is
processed independently.
4/14/2013 Confidential 17