computer vision
DESCRIPTION
OpenCV & iOSTRANSCRIPT
![Page 1: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/1.jpg)
1
Computer Vision and Apps
Antonio Radesca
Developer-Architect
MCPD
Fiore Rosalba
www.fiorerosalba.biz
![Page 2: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/2.jpg)
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
![Page 3: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/3.jpg)
04/12/2023 Confidential 3
Machine prospective
• A 2d Image of a 3d object.• No definite way to reconstruct the 3d
image.
![Page 4: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/4.jpg)
04/12/2023 Confidential 4
Machine prospective
• Images are corrupted by noise and distortions.
• (weather, lighting, reflections, movements)
![Page 5: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/5.jpg)
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
![Page 6: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/6.jpg)
04/12/2023 Confidential 6
OpenCV
![Page 7: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/7.jpg)
04/12/2023 Confidential 7
OpenCV
![Page 8: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/8.jpg)
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
![Page 9: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/9.jpg)
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).
![Page 10: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/10.jpg)
04/12/2023 Confidential 10
Using OpenCV
• Use static libraries• Compile OpenCV • Download sample from GITHUB
![Page 11: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/11.jpg)
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;
![Page 12: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/12.jpg)
04/12/2023 Confidential 12
Some Code...
![Page 13: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/13.jpg)
04/12/2023 Confidential 13
Image inversion sample
![Page 14: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/14.jpg)
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.
![Page 15: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/15.jpg)
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.
![Page 16: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/16.jpg)
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.
![Page 17: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/17.jpg)
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.
![Page 18: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/18.jpg)
04/12/2023 Confidential 18
Edge Detection (Canny Algorithm)
![Page 19: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/19.jpg)
04/12/2023 Confidential 19
FaceDetection
![Page 20: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/20.jpg)
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++
![Page 21: Computer vision](https://reader034.vdocuments.us/reader034/viewer/2022042700/55583795d8b42ac6078b495e/html5/thumbnails/21.jpg)
21
• Questions?
Thanks