The document discusses an OpenCV C++ workshop presented by Lentin Joseph. It provides an overview of OpenCV, including that it is an open source computer vision library started in 1999. It then covers installing OpenCV from source or Ubuntu packages, setting it up in Eclipse, and various OpenCV modules and applications like gesture recognition, segmentation, and face detection. Examples are provided of OpenCV APIs for reading images and video, image processing techniques, and contour detection.
About OpenCV
●
Open SourceComputer Vision library
●
Real-time Computer vision library
●
Started by Intel Russia, launched in 1999
●
2000 : First alpha release
●
2006: First stable release
●
2009: Second major release
http://www.qboticslabs.com
3.
About OpenCV
●
2012 :opencv -> opencv.org
●
Current version : OpenCV 3.0 beta
●
Opensource BSD license
●
Cross platform
●
Now supporting by Willow Garage and Itseez
http://www.qboticslabs.com
4.
About OpenCV
●
Written inC++ and C
●
Full Interfaces for Python, Java, Matlab/
Octave
●
Wrappers in C#, Perl, Ruby
●
OS Support : Windows, Linux, Android, Maemo,
FreeBSD, IOS, OS X, BlackBerry 10
http://www.qboticslabs.com
5.
Applications of OpenCV
●
Gesturerecognition
●
Human-computer interaction(HCI)
●
Mobile robotics
●
Segmentation and recognition
●
Motion tracking
●
Augmented reality
●
Machine learning
http://www.qboticslabs.com
Compile code withoutEclipse
●
Save code as .cpp using an text editor
●
Compile using following command
● $ g++ <input_file.cpp> `pkg-config
opencv –cflags –libs` -o
<output_name>
● $ ./output_name
25.
OpenCV Modules
●
OpenCV hasmodular structure
●
OpenCV contain several shared/static libraries
● Core : Contain basic image data structure such as
Mat
● Imgproc : image processing module contain linear
and non linear filter, color space conversion,
histogram etc
● Video : Motion estimation, background substraction,
object tracking algorithms etc
26.
OpenCV Modules
● Calib3d: mainly for camera calibration
● Features2d : contain feature detectors,
descriptors and descriptor matchers
● Objdetect: contain object detection algorithms
● Highgui: contain UI functionality to handle video
and image
● Gpu : GPU-accelerated algorithms
Reading a Video
OpenCVHeader Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● VideoCapture cap(argv[1])
● waitKey(30)
32.
Reading from Camera
OpenCVHeader Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● VideoCapture cap(argv[1])
● waitKey(30)
33.
Reading Pixel fromImage and
Mouse Interaction
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● image.at<uchar>(y,x);
● image.at<Vec3b>(y,x)[0];
● setMouseCallback("Display window",
mouse_callback, NULL);
34.
Working with Mattype
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● Mat red(480,640,CV_8UC3,Scalar(0,0,255));
● imwrite("red.jpg",red);
35.
Adjusting brightness andcontrast
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*( image.at<Vec3b>(y
,x)[c] ) + beta );
● Alpha = contrast
● Beta = Brightness
● saturate_cast ensure value is valid or not