6.891 Vision Why study Computer Vision? Why study Computer ...
Computer vision
-
Upload
antonio-radesca -
Category
Technology
-
view
717 -
download
1
description
Transcript of Computer vision
1
Computer Vision and Apps
Antonio Radesca
Developer-Architect
MCPD
Fiore Rosalba
www.fiorerosalba.biz
04/12/2023 Confidential 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
04/12/2023 Confidential 3
Machine prospective
• A 2d Image of a 3d object.• No definite way to reconstruct the 3d
image.
04/12/2023 Confidential 4
Machine prospective
• Images are corrupted by noise and distortions.
• (weather, lighting, reflections, movements)
04/12/2023 Confidential 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
04/12/2023 Confidential 6
OpenCV
04/12/2023 Confidential 7
OpenCV
04/12/2023 Confidential 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
04/12/2023 Confidential 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 INRIA).
04/12/2023 Confidential 10
Using OpenCV
• Use static libraries• Compile OpenCV • Download sample from GITHUB
04/12/2023 Confidential 11
Basic Structtypedef 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;
04/12/2023 Confidential 12
Some Code...
04/12/2023 Confidential 13
Image inversion sample
04/12/2023 Confidential 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.
04/12/2023 Confidential 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.
04/12/2023 Confidential 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.
04/12/2023 Confidential 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.
04/12/2023 Confidential 18
Edge Detection (Canny Algorithm)
04/12/2023 Confidential 19
FaceDetection
04/12/2023 Confidential 20
Resources
• Download Open CV - http://sourceforge.net/projects/opencvlibrary/
• Install guide and tutorials - http://opencv.willowgarage.com/wiki/
• IDE – eclipse, .net , VC++
21
• Questions?
Thanks