SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
OpenCV C++ Workshop
Lentin Joseph
Founder of Qbotics Labs
www.qboticslabs.com
About OpenCV
●
Open Source Computer 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
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
About OpenCV
●
Written in C++ 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
Applications of OpenCV
●
Gesture recognition
●
Human-computer interaction(HCI)
●
Mobile robotics
●
Segmentation and recognition
●
Motion tracking
●
Augmented reality
●
Machine learning
http://www.qboticslabs.com
Installing OpenCV
●
Installing from source code
●
Installing from Ubuntu packages
http://www.qboticslabs.com
Installing OpenCV from Ubuntu
packages
$ sudo apt-get update
$ sudo apt-get install
libopencv-dev
http://www.qboticslabs.com
Installing OpenCV from source
code
●
Install prerequisites packages
● [compiler] sudo apt-get install build-essential
● [required] sudo apt-get install cmake git
libgtk2.0-dev pkg-config libavcodec-dev
libavformat-dev libswscale-dev
● [optional] sudo apt-get install python-dev python-
numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev
libtiff-dev libjasper-dev libdc1394-22-dev
http://www.qboticslabs.com
Installing OpenCV from source
code
● cd ~/opencv
● git clone https://github.com/Itseez/opencv.git
● mkdir release
● cd release
● cmake -D CMAKE_BUILD_TYPE=RELEASE -D
CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D
BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D
INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D
BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
● make
http://www.qboticslabs.com
Installing OpenCV from source
code
● cd ~/opencv
● git clone https://github.com/Itseez/opencv.git
● mkdir release
● sudo apt-get install cmake-qt-gui
●
http://www.qboticslabs.com
Installing OpenCV from source
code
http://www.qboticslabs.com
Check OpenCV is installed !!!
● $ pkg-config opencv –cflags
$ pkg-config opencv --libs
Setting OpenCV in Eclipse
●
Install OpenJDK from Ubuntu Software
Check Ubuntu Version !!!
●
System settings -> Details -> Overview
Download Eclipse
●
http://www.eclipse.org/downloads/
Extract and Install Eclipse
● cd /opt/ && sudo tar -zxvf
~/Downloads/eclipse-*.tar.gz
●
Without using command
● $ gksudo nautilus
Adding Shortcut for Eclipse
● $ gksudo gedit /usr/share/applications/eclipse.desktop
●
Paste the following to this file
[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
Access eclipse via Unity Dash
Setting OpenCV in Eclipse
●
Setting Include path
– Properties -> C/C++ Build->Settings->Cross G++
Compiler->Includes
– $ pkg-config opencv --cflags
Setting OpenCV in Eclipse
●
Setting Lib path and libraries
– Properties -> C/C++ Build->Settings->Cross G++
Compiler->Libraries
– $ pkg-config opencv --libs
Running test code !!!
●
Reading an Image
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
Running test code !!!
●
Setting command line argument
– Project -> Run as-> Run Configurations
Output !!!
Compile code without Eclipse
●
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
OpenCV Modules
●
OpenCV has modular 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
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
About OpenCV API's
● All OpenCV classes are placed in cv
namespace
Let's start coding
Reading an Image
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● imread(file_name,flags)
● imshow(“window_title”,image_variable)
● namedWindow(“window_title”,flags)
● WaitKey(0)
● Refer
http://docs.opencv.org/modules/refman.html
Reading an Image
Output
Reading a Video
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● VideoCapture cap(argv[1])
● waitKey(30)
Reading from Camera
OpenCV Header Files Used
● #include <opencv2/highgui/highgui.hpp>
OpenCV API's used
● VideoCapture cap(argv[1])
● waitKey(30)
Reading Pixel from Image 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);
Working with Mat type
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);
Adjusting brightness and contrast
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
Image Smoothing demo
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● Blur
● GaussianBlur
● MedianBlur
● bilateralFilter
Segmentation: Thresholding
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● cvtColor( src, src_gray, CV_RGB2GRAY );
● threshold( src_gray, dst, threshold_value,
max_BINARY_value,threshold_type );
● createTrackbar( trackbar_value,
window_name,&threshold_value,
max_value, Threshold_Demo );
Edge Detection
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● Canny( detected_edges, detected_edges,
lowThreshold, lowThreshold*ratio,
kernel_size );
Laplace & Sobel
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● Sobel( src_gray, grad_x, ddepth, 1, 0, 3,
scale, delta, BORDER_DEFAULT );
● Laplacian( src_gray, dst, ddepth, kernel_size,
scale, delta, BORDER_DEFAULT );
Hough Transform(Circle & Line)
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● HoughCircles( src_gray, circles,
CV_HOUGH_GRADIENT, 1, src_gray.rows/8,
cannyThreshold, accumulatorThreshold, 0, 0 );
● HoughLines( edges, s_lines, 1, CV_PI/180,
min_threshold + s_trackbar, 0, 0 );
Contour Detection
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● findContours( canny_output, contours,
hierarchy, CV_RETR_TREE,
CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
Histogram
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist,
1, &histSize, &histRange, uniform,
accumulate );
Harris_Corner_Detection
OpenCV Header Files Used
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● cornerHarris( src_gray, dst, blockSize,
apertureSize, k, BORDER_DEFAULT );
Motion Detection, LK,FB,BS
OpenCV Header Files Used
● #include "opencv2/video/tracking.hpp"
● #include "opencv2/imgproc/imgproc.hpp"
● #include "opencv2/highgui/highgui.hpp"
OpenCV API's used
● calcOpticalFlowPyrLK(prevGray, gray, points[0],
points[1], status, err, winSize,
● calcOpticalFlowFarneback(prevgray, gray, flow,
0.5, 3, 15, 3, 5, 1.2, 0);
● cvCalcMotionGradient( mhi, mask, orient,
MAX_TIME_DELTA, MIN_TIME_DELTA, 3 );
Face Detection
OpenCV Header Files Used
● #include "opencv2/objdetect/objdetect.hpp"
● #include "opencv2/highgui/highgui.hpp"
● #include "opencv2/imgproc/imgproc.hpp"
OpenCV API's used
● cascade.detectMultiScale( smallImg, faces2,
1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30,
30) );
Conclusion
●
Discussed basics of Computer Vision
●
Discussed about OpenCV
●
Discussed OpenCV programming using C++
●
Discussed basic level examples to advanced
level
Questions !!!
Thanks !!!
Lentin Joseph
Founder of QboticsLabs
http://www.qboticslabs.com
http://www.lentinjoseph.com

Mais conteúdo relacionado

Mais procurados

ELFの動的リンク
ELFの動的リンクELFの動的リンク
ELFの動的リンク7shi
 
JAMstackは眠らない
JAMstackは眠らないJAMstackは眠らない
JAMstackは眠らないKuniyoshi Tone
 
やはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているやはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているKoichi Tanaka
 
reduxのstate設計の話
reduxのstate設計の話reduxのstate設計の話
reduxのstate設計の話ayatas0623
 
Test Yourself - テストを書くと何がどう変わるか
Test Yourself - テストを書くと何がどう変わるかTest Yourself - テストを書くと何がどう変わるか
Test Yourself - テストを書くと何がどう変わるかTakuto Wada
 
Composer bin plugin / ツールの依存管理から解放される
Composer bin plugin / ツールの依存管理から解放されるComposer bin plugin / ツールの依存管理から解放される
Composer bin plugin / ツールの依存管理から解放されるKentarou Takeda
 
Java Application Servers Are Dead!
Java Application Servers Are Dead!Java Application Servers Are Dead!
Java Application Servers Are Dead!Eberhard Wolff
 
アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門Hori Tasuku
 
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~SEGADevTech
 
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのか
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのかJavaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのか
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのかYoshitaka Kawashima
 
Ansibleの最近の動向を追ってみた
Ansibleの最近の動向を追ってみたAnsibleの最近の動向を追ってみた
Ansibleの最近の動向を追ってみたKeijiUehata1
 
Ruby での外部コマンドの実行について
Ruby での外部コマンドの実行についてRuby での外部コマンドの実行について
Ruby での外部コマンドの実行についてTomoya Kawanishi
 
実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る GitYouhei Nitta
 
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能Yoshifumi Kawai
 
우린 같은 곳을 바라 보고 있나요?
우린 같은 곳을 바라 보고 있나요?우린 같은 곳을 바라 보고 있나요?
우린 같은 곳을 바라 보고 있나요?Arawn Park
 
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/Fall
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/FallZabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/Fall
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/FallAtsushi Tanaka
 
GUI アプリケーションにおける MVC
GUI アプリケーションにおける MVCGUI アプリケーションにおける MVC
GUI アプリケーションにおける MVCYu Nobuoka
 
USB3.0ドライバ開発の道
USB3.0ドライバ開発の道USB3.0ドライバ開発の道
USB3.0ドライバ開発の道uchan_nos
 
WASM(WebAssembly)入門 ペアリング演算やってみた
WASM(WebAssembly)入門 ペアリング演算やってみたWASM(WebAssembly)入門 ペアリング演算やってみた
WASM(WebAssembly)入門 ペアリング演算やってみたMITSUNARI Shigeo
 
TRICK 2022 Results
TRICK 2022 ResultsTRICK 2022 Results
TRICK 2022 Resultsmametter
 

Mais procurados (20)

ELFの動的リンク
ELFの動的リンクELFの動的リンク
ELFの動的リンク
 
JAMstackは眠らない
JAMstackは眠らないJAMstackは眠らない
JAMstackは眠らない
 
やはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているやはりお前らのMVCは間違っている
やはりお前らのMVCは間違っている
 
reduxのstate設計の話
reduxのstate設計の話reduxのstate設計の話
reduxのstate設計の話
 
Test Yourself - テストを書くと何がどう変わるか
Test Yourself - テストを書くと何がどう変わるかTest Yourself - テストを書くと何がどう変わるか
Test Yourself - テストを書くと何がどう変わるか
 
Composer bin plugin / ツールの依存管理から解放される
Composer bin plugin / ツールの依存管理から解放されるComposer bin plugin / ツールの依存管理から解放される
Composer bin plugin / ツールの依存管理から解放される
 
Java Application Servers Are Dead!
Java Application Servers Are Dead!Java Application Servers Are Dead!
Java Application Servers Are Dead!
 
アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門
 
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~
CEDEC2021 Android iOS 実機上での自動テストをより楽に有意義にする為に ~端末管理・イメージ転送・動画記録等の周辺情報のノウハウ共有~
 
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのか
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのかJavaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのか
Javaの進化にともなう運用性の向上はシステム設計にどういう変化をもたらすのか
 
Ansibleの最近の動向を追ってみた
Ansibleの最近の動向を追ってみたAnsibleの最近の動向を追ってみた
Ansibleの最近の動向を追ってみた
 
Ruby での外部コマンドの実行について
Ruby での外部コマンドの実行についてRuby での外部コマンドの実行について
Ruby での外部コマンドの実行について
 
実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git
 
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能
ライブラリ作成のすゝめ - 事例から見る個人OSS開発の効能
 
우린 같은 곳을 바라 보고 있나요?
우린 같은 곳을 바라 보고 있나요?우린 같은 곳을 바라 보고 있나요?
우린 같은 곳을 바라 보고 있나요?
 
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/Fall
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/FallZabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/Fall
Zabbix最新情報 ~Zabbix 6.0に向けて~ @OSC2021 Online/Fall
 
GUI アプリケーションにおける MVC
GUI アプリケーションにおける MVCGUI アプリケーションにおける MVC
GUI アプリケーションにおける MVC
 
USB3.0ドライバ開発の道
USB3.0ドライバ開発の道USB3.0ドライバ開発の道
USB3.0ドライバ開発の道
 
WASM(WebAssembly)入門 ペアリング演算やってみた
WASM(WebAssembly)入門 ペアリング演算やってみたWASM(WebAssembly)入門 ペアリング演算やってみた
WASM(WebAssembly)入門 ペアリング演算やってみた
 
TRICK 2022 Results
TRICK 2022 ResultsTRICK 2022 Results
TRICK 2022 Results
 

Semelhante a OpenCV Workshop

"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.orgEdge AI and Vision Alliance
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
OpenCV (Open source computer vision)
OpenCV (Open source computer vision)OpenCV (Open source computer vision)
OpenCV (Open source computer vision)Chetan Allapur
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Annie Huang
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Peter Bittner
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang W. Doh
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
oSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdfoSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdfAdrianSchrter1
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Microsoft
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
Introduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunIntroduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunSaiyam Pathak
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
 

Semelhante a OpenCV Workshop (20)

"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
OpenCV Introduction
OpenCV IntroductionOpenCV Introduction
OpenCV Introduction
 
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org
“OpenCV: Past, Present and Future,” a Presentation from OpenCV.org
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
OpenCV (Open source computer vision)
OpenCV (Open source computer vision)OpenCV (Open source computer vision)
OpenCV (Open source computer vision)
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
oSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdfoSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdf
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Introduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunIntroduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud Run
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
Nodejs
NodejsNodejs
Nodejs
 

Último

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 

Último (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

OpenCV Workshop

  • 1. OpenCV C++ Workshop Lentin Joseph Founder of Qbotics Labs www.qboticslabs.com
  • 2. About OpenCV ● Open Source Computer 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 in C++ 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 ● Gesture recognition ● Human-computer interaction(HCI) ● Mobile robotics ● Segmentation and recognition ● Motion tracking ● Augmented reality ● Machine learning http://www.qboticslabs.com
  • 6. Installing OpenCV ● Installing from source code ● Installing from Ubuntu packages http://www.qboticslabs.com
  • 7. Installing OpenCV from Ubuntu packages $ sudo apt-get update $ sudo apt-get install libopencv-dev http://www.qboticslabs.com
  • 8. Installing OpenCV from source code ● Install prerequisites packages ● [compiler] sudo apt-get install build-essential ● [required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev ● [optional] sudo apt-get install python-dev python- numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev http://www.qboticslabs.com
  • 9. Installing OpenCV from source code ● cd ~/opencv ● git clone https://github.com/Itseez/opencv.git ● mkdir release ● cd release ● cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON .. ● make http://www.qboticslabs.com
  • 10. Installing OpenCV from source code ● cd ~/opencv ● git clone https://github.com/Itseez/opencv.git ● mkdir release ● sudo apt-get install cmake-qt-gui ● http://www.qboticslabs.com
  • 11. Installing OpenCV from source code http://www.qboticslabs.com
  • 12. Check OpenCV is installed !!! ● $ pkg-config opencv –cflags $ pkg-config opencv --libs
  • 13. Setting OpenCV in Eclipse ● Install OpenJDK from Ubuntu Software
  • 14. Check Ubuntu Version !!! ● System settings -> Details -> Overview
  • 16. Extract and Install Eclipse ● cd /opt/ && sudo tar -zxvf ~/Downloads/eclipse-*.tar.gz ● Without using command ● $ gksudo nautilus
  • 17. Adding Shortcut for Eclipse ● $ gksudo gedit /usr/share/applications/eclipse.desktop ● Paste the following to this file [Desktop Entry] Name=Eclipse 4 Type=Application Exec=/opt/eclipse/eclipse Terminal=false Icon=/opt/eclipse/icon.xpm Comment=Integrated Development Environment NoDisplay=false Categories=Development;IDE; Name[en]=Eclipse
  • 18. Access eclipse via Unity Dash
  • 19. Setting OpenCV in Eclipse ● Setting Include path – Properties -> C/C++ Build->Settings->Cross G++ Compiler->Includes – $ pkg-config opencv --cflags
  • 20. Setting OpenCV in Eclipse ● Setting Lib path and libraries – Properties -> C/C++ Build->Settings->Cross G++ Compiler->Libraries – $ pkg-config opencv --libs
  • 21. Running test code !!! ● Reading an Image #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main( int argc, char** argv ) { if( argc != 2) { cout <<" Usage: display_image ImageToLoadAndDisplay" << endl; return -1; } Mat image; image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file if(! image.data ) // Check for invalid input { cout << "Could not open or find the image" << std::endl ; return -1; } namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display. imshow( "Display window", image ); // Show our image inside it. waitKey(0); // Wait for a keystroke in the window return 0; }
  • 22. Running test code !!! ● Setting command line argument – Project -> Run as-> Run Configurations
  • 24. Compile code without Eclipse ● 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 has modular 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
  • 27. About OpenCV API's ● All OpenCV classes are placed in cv namespace
  • 29. Reading an Image OpenCV Header Files Used ● #include <opencv2/highgui/highgui.hpp> OpenCV API's used ● imread(file_name,flags) ● imshow(“window_title”,image_variable) ● namedWindow(“window_title”,flags) ● WaitKey(0) ● Refer http://docs.opencv.org/modules/refman.html
  • 31. Reading a Video OpenCV Header Files Used ● #include <opencv2/highgui/highgui.hpp> OpenCV API's used ● VideoCapture cap(argv[1]) ● waitKey(30)
  • 32. Reading from Camera OpenCV Header Files Used ● #include <opencv2/highgui/highgui.hpp> OpenCV API's used ● VideoCapture cap(argv[1]) ● waitKey(30)
  • 33. Reading Pixel from Image 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 Mat type 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 and contrast 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
  • 36. Image Smoothing demo OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● Blur ● GaussianBlur ● MedianBlur ● bilateralFilter
  • 37. Segmentation: Thresholding OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● cvtColor( src, src_gray, CV_RGB2GRAY ); ● threshold( src_gray, dst, threshold_value, max_BINARY_value,threshold_type ); ● createTrackbar( trackbar_value, window_name,&threshold_value, max_value, Threshold_Demo );
  • 38. Edge Detection OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size );
  • 39. Laplace & Sobel OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT ); ● Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT );
  • 40. Hough Transform(Circle & Line) OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● HoughCircles( src_gray, circles, CV_HOUGH_GRADIENT, 1, src_gray.rows/8, cannyThreshold, accumulatorThreshold, 0, 0 ); ● HoughLines( edges, s_lines, 1, CV_PI/180, min_threshold + s_trackbar, 0, 0 );
  • 41. Contour Detection OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● findContours( canny_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
  • 42. Histogram OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
  • 43. Harris_Corner_Detection OpenCV Header Files Used ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● cornerHarris( src_gray, dst, blockSize, apertureSize, k, BORDER_DEFAULT );
  • 44. Motion Detection, LK,FB,BS OpenCV Header Files Used ● #include "opencv2/video/tracking.hpp" ● #include "opencv2/imgproc/imgproc.hpp" ● #include "opencv2/highgui/highgui.hpp" OpenCV API's used ● calcOpticalFlowPyrLK(prevGray, gray, points[0], points[1], status, err, winSize, ● calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0); ● cvCalcMotionGradient( mhi, mask, orient, MAX_TIME_DELTA, MIN_TIME_DELTA, 3 );
  • 45. Face Detection OpenCV Header Files Used ● #include "opencv2/objdetect/objdetect.hpp" ● #include "opencv2/highgui/highgui.hpp" ● #include "opencv2/imgproc/imgproc.hpp" OpenCV API's used ● cascade.detectMultiScale( smallImg, faces2, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );
  • 46. Conclusion ● Discussed basics of Computer Vision ● Discussed about OpenCV ● Discussed OpenCV programming using C++ ● Discussed basic level examples to advanced level
  • 48. Thanks !!! Lentin Joseph Founder of QboticsLabs http://www.qboticslabs.com http://www.lentinjoseph.com