SlideShare a Scribd company logo
openCV
with Python
David Hsu
Installations - windows
• Python 2.7 or 3.5
https://www.python.org/downloads/
• Frequently used Libraries : Numpy, Matplotlib, Scipy
http://www.scipy.org/
• Or try Anaconda (Python + popular libraries)
https://www.continuum.io/downloads
• openCV 3.0.0
http://opencv.org/downloads.html
• Copy “cv2.pyd” from pathopencvbuildpython2.7x86(x64)
Paste “cv2.pyd” to pathAnacondaLibsite-packages
In python shell : import cv2
cv2.__version__ (two underscores)
‘3.0.0’
Installations - mac
• Python 2.7 or 3.5 or Anaconda
https://www.python.org/downloads/
https://www.continuum.io/downloads
• Frequently used Libraries : Numpy, Matplotlib, Scipy
in Terminals :
pip install –U numpy scipy matplotlib (for Python 2.X)
pip3 install –U numpy scipy matplotlib (for Python 3.X)
• Download openCV http://opencv.org/downloads.html
• Install Xcode https://developer.apple.com/xcode/
• Install Cmake https://cmake.org/download/
• Build openCV for Python
http://luigolas.com/blog/2014/09/15/install-opencv3-with-
python-3-mac-osx/
Ex1: read/show images
• Put the image (lena.bmp) and cv_ex1.py in the same folder
•
Ex1: read/show images
•
Ex2: open videos
• Put the video (test.mp4) and cv_ex2.py in the same folder
•
Ex2: open videos
•
Ex3: using webCam
• Very similar to video open, just change the argument to be 0
•
Ex4: edges detection
• Adopt “canny” method to achieve edges detection
•
Ex4: edges detection
•
Ex5: lines detection
• Lines detection using Hough Transform
 line equation using (r, thita)
•
Ex5: lines detection
•
Ex6: object tracking
using color filtering
• using color as features : quick and dirty
• Detecting something in blue
•
Ex6: object tracking
using color filtering
Ex7: contours classification
• blue objects detextion  shapes recognition
• Rectangle  shown in green
• multiple-sides-polygon (like circles)  shown in red
Ex7: contours classification
•
Lightening condition invariant?
• Color looks different with lightening issue.
Finding corners’ features
• Color invariant, Scale invariant
Finding corners’ features
• Color invariant, Scale invariant
Features matching
• features matching with two images
• Features method : ORB (Oriented FAST and Rotated BRIEF)
• Matching method : BruteForceMatcher
•
Ex8: object tracking
using corners’ features
•
Ex8: object tracking
using corners’ features
Ex9: Face recognition/tracking
• Download the training model (haarcascade_frontalface_default.xml')
and put it in the same folder with the code cv_ex9.py.
•
Ex9: Face recognition/tracking
•
References
• You can access the example from
https://github.com/ntudavid/CV_lab
• Reference : OpenCV – Python Tutorials
https://opencv-python-tutroals.readthedocs.org/en/latest/

More Related Content

PDF
Lecture 1: Deep Learning for Computer Vision
PDF
OpenCV Introduction
PDF
Introduction to OpenCV
PDF
Introduction to Computer Vision using OpenCV
PPTX
OpenCV presentation series- part 1
PDF
Python in Computer Vision
ODP
Image Processing with OpenCV
PDF
Image analysis using python
Lecture 1: Deep Learning for Computer Vision
OpenCV Introduction
Introduction to OpenCV
Introduction to Computer Vision using OpenCV
OpenCV presentation series- part 1
Python in Computer Vision
Image Processing with OpenCV
Image analysis using python

What's hot (20)

PPTX
Object detection presentation
PDF
Introduction to object detection
PPT
Heuristic Search Techniques {Artificial Intelligence}
PDF
Object tracking presentation
PDF
Introduction to TensorFlow 2.0
PPTX
Deep learning
PPT
Introduction to Python
PDF
AI and machine learning
 
PDF
General introduction to AI ML DL DS
PPTX
Python Open CV
PPTX
Transfer learning-presentation
PDF
Serving ML easily with FastAPI
PPTX
Deep learning presentation
PPT
Face Detection and Recognition System
PPTX
Image Segmentation: Approaches and Challenges
PDF
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
PPTX
Final year ppt
PPTX
AGE AND GENDER DETECTION.pptx
PDF
Machine Learning Pipelines
Object detection presentation
Introduction to object detection
Heuristic Search Techniques {Artificial Intelligence}
Object tracking presentation
Introduction to TensorFlow 2.0
Deep learning
Introduction to Python
AI and machine learning
 
General introduction to AI ML DL DS
Python Open CV
Transfer learning-presentation
Serving ML easily with FastAPI
Deep learning presentation
Face Detection and Recognition System
Image Segmentation: Approaches and Challenges
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Final year ppt
AGE AND GENDER DETECTION.pptx
Machine Learning Pipelines
Ad

Similar to openCV with python (20)

PPTX
Opencv
PPTX
Introduction_____to______ OpenCV___.pptx
PDF
OpenCV (Open source computer vision)
PPTX
502021435-12345678Minor-Project-Ppt.pptx
PDF
OpenCV Workshop
PDF
Introduction to TensorFlow and OpenCV libraries
PPTX
OpenCV with Python
PDF
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
PPTX
Open Computer Vision Based Image Processing
PPTX
Open CV library In Python_Vahid ebrahimian.pptx
PPTX
PYTHON-OOOOOOOOOOPPPPPPEEEEEEEEN-CV.pptx
PPTX
PYTHON-OPEEEEEEEEEEEEEEN-CV (1) kgjkg.pptx
DOCX
16 OpenCV Functions to Start your Computer Vision journey.docx
PDF
Implementation of Computer Vision Applications using OpenCV in C++
PDF
OpenCV.pdf
PPTX
Computer Vision Introduction
PDF
Image Detection and Count Using Open Computer Vision (Opencv)
PDF
Computer Vision Workshop
PPTX
Install, Compile, Setup, Setting OpenCV 3.2, Visual C++ 2015, Win 64bit,
PPTX
Real-Time Shape Detection Using OpenCV and Python for Geometric Object Classi...
Opencv
Introduction_____to______ OpenCV___.pptx
OpenCV (Open source computer vision)
502021435-12345678Minor-Project-Ppt.pptx
OpenCV Workshop
Introduction to TensorFlow and OpenCV libraries
OpenCV with Python
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
Open Computer Vision Based Image Processing
Open CV library In Python_Vahid ebrahimian.pptx
PYTHON-OOOOOOOOOOPPPPPPEEEEEEEEN-CV.pptx
PYTHON-OPEEEEEEEEEEEEEEN-CV (1) kgjkg.pptx
16 OpenCV Functions to Start your Computer Vision journey.docx
Implementation of Computer Vision Applications using OpenCV in C++
OpenCV.pdf
Computer Vision Introduction
Image Detection and Count Using Open Computer Vision (Opencv)
Computer Vision Workshop
Install, Compile, Setup, Setting OpenCV 3.2, Visual C++ 2015, Win 64bit,
Real-Time Shape Detection Using OpenCV and Python for Geometric Object Classi...
Ad

More from Wei-Wen Hsu (10)

PDF
Python for data science
PDF
Running openCV project on Mac OS
PDF
Installing Python on Mac
PPTX
Using openCV 3.2.0 with CodeBlocks
PDF
Using openCV 3.1.0 with vs2015
PDF
Using open cv 249 with vs2012
PDF
Using openCV 2.0 with Dev C++
PDF
Basic openCV Functions Using CPP
PDF
Concise Notes on Python
PDF
Installing Python on Windows OS
Python for data science
Running openCV project on Mac OS
Installing Python on Mac
Using openCV 3.2.0 with CodeBlocks
Using openCV 3.1.0 with vs2015
Using open cv 249 with vs2012
Using openCV 2.0 with Dev C++
Basic openCV Functions Using CPP
Concise Notes on Python
Installing Python on Windows OS

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
A Presentation on Artificial Intelligence
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
A Presentation on Artificial Intelligence
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Assigned Numbers - 2025 - Bluetooth® Document
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

openCV with python