0% found this document useful (0 votes)
42 views61 pages

Invicta-2020 Day12

The document summarizes topics from an image processing and computer vision workshop. It discusses concepts like computer vision, image processing, color models, video formats, OpenCV functions, geometric transformations, contours, edge detection using Canny and Harris corner detection, Shi-Tomasi corner detection, applications of image processing including face detection and color detection, and an introduction to deep learning including types of neural networks like convolutional neural networks and recurrent neural networks.

Uploaded by

Ragini Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views61 pages

Invicta-2020 Day12

The document summarizes topics from an image processing and computer vision workshop. It discusses concepts like computer vision, image processing, color models, video formats, OpenCV functions, geometric transformations, contours, edge detection using Canny and Harris corner detection, Shi-Tomasi corner detection, applications of image processing including face detection and color detection, and an introduction to deep learning including types of neural networks like convolutional neural networks and recurrent neural networks.

Uploaded by

Ragini Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

INVICTA 2020

Image Processing and Computer Vision Workshop

ROBOTICS CLUB
IIT GUWAHATI
Topics, we are going to cover:










What is Computer Vision?
What is Computer Vision?
01 FACE RECOGNITION 02 OBJECT RECOGNITION

03 POSE ESTIMATION 03 GESTURE RECOGNITION


What is Image Processing then?
Seems
Daunting?
WHAT IS AN IMAGE?

Mostly used types of images:

1. Grayscale images

2. RGB images
A Grayscale Image
A Grayscale Image
Color Image
RGB Color Model
RGB Color Model
HSV Color Model
HSV Color Model
What is a video consists of ?

Frame Rate :

Normal used frame rates:


Getting
Started with
Images
What is OpenCV


Important Functions
Important Functions
Important Functions
Important Functions
Getting
Started with
Videos
Important Functions

● cv2.VideoCapture(‘car.mp4’)

● cv2.VideoCapture(0)

● cv2.VideoCapture(1)
Important Functions
Geometric
Transformation
of Image
SCALING


❏ Syntax - interpolation

❏ Src -
❏ dsize -

❏ fx -
SCALING

❏ fy -

❏ Interpolation -
❏ cv.INTER_AREA cv.INTER_CUBIC
cv.INTER_LINEAR

TRANSLATION




ROTATION



Drawing on Image

Drawing a line:-

Syntax:

Drawing a rectangle:-

Syntax:
Drawing on Image

Drawing a circle:-

Syntax:

Try to draw a polygon!!


Adding texts to Images

org:

font:

lineType:

bottomLeftOrigin:
Blurring and
Filtering
BLURRING
BLURRING
Contours

cv2.findContours(), cv2.drawContours()


Contours
image, contours, hierarchy =
cv2.findContours(gray_img,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)


Contours

img = cv2.drawContours(img, contours, -1, (0,255,0), 3)


Contours-Features

Moments, Contour Area, Contour Perimeter, Contour Approximation





CANNY EDGE DETECTION

Input Image Output Image

❏ Edges provide boundaries between different regions in the image.


❏ These object boundaries are the first step in many of computer vision algorithms like edge based
face recognition, edge based obstacle detection, edge based target recognition, image
compression etc.
❏ Canny edge detector uses a multi-stage algorithm to detect a wide range of edges in images.
CANNY EDGE DETECTION

Grayscale Gaussian Gradient


Conversion Blur Magnitude

Cleaning Up

Non-Max
Edge Double
Suppression
Tracking Thresholding
CANNY EDGE DETECTION


CANNY EDGE DETECTION

edges= cv2.Canny(image, th1, th2)

Parameters
❏ image:
❏ th1:
❏ th2:
CANNY EDGE DETECTION

APPLICATIONS

❏ The present and near future main application areas


of edge detection(ED) are robotics vision (e.g. in
self-driving vehicles).

❏ At present Fingerprint recognition has been used


widely such as in mobile phones.
❏ Edge detection techniques enhance the quality of
image and cause the improvement in the image
recognition.
HARRIS CORNER DETECTION
Intuition:-


“flat” region: no “edge”: no change along “corner”: significant


change in all directions the edge direction change in all directions
HARRIS CORNER DETECTION

Window function Shifted intensity Intensity


HARRIS CORNER DETECTION

R=det(M)-k(trace(M))2



HARRIS CORNER DETECTION

corners= cv2.cornerHarris(image, block size, k size, k )

Parameters

❏ Image -
❏ blockSize
❏ ksize
❏ k
Shi-Tomasi Corner Detection

❏ Similar to Harris Corner detector,


apart from the way the score (R) is
calculated.
❏ Here, R = min(λ1,λ2)
❏ If R is greater than a threshold, its
classified as a corner.
❏ OpenCV has a function,
cv2.goodFeaturesToTrack(). It finds N
strongest corners in the image by
Shi-Tomasi method.
Good Features to Track

corners = cv2.goodFeaturesToTrack(img_gray,N,Q,d)

Parameters

❏ Img_gray -
❏ N
❏ Q-
❏ d-
Good Features to Track
corners = cv2.goodFeaturesToTrack(img_gray,N,0.01,10)

❏ It finds N strongest corners in the image .


❏ All corners below quality level are rejected.
Then it sorts the remaining corners based
on quality in the descending order.
❏ Then function takes first strongest corner,
throws away all the nearby corners in the
range of minimum distance and returns N
strongest corners.
APPLICATIONS OF IMAGE PROCESSING

Face Detection using Haar Cascades

Object Detection using Haar feature-based cascade classifiers is an effective object detection method. It is a
machine learning based approach where a cascade function is trained from a lot of positive and negative images. It
is then used to detect objects in other images.
cv2.CascadeClassifier()
It is use to load cascade file from parent directory. It takes XML classifier file as parameter
for the function.

detectMultiScale(image, scaleFactor, minNeighbors)


Image: Input image in grayscale format.
scaleFactor: Parameter specifying how much the image size is reduced at each image scale.

minNeighbors: Parameter specifying how many neighbors each candidate rectangle should
have to retain it
APPLICATIONS OF IMAGE PROCESSING

Color Detection using mask segmentation

Detection of any specific color using lower and upper HSV range for that color

mask= cv2.inRange(hsv_image,lower_range,upper_range)

We are creating a mask that comprises of an object of specified color according to given range.
Introduction To Deep Learning


Which came first ??
What is Deep Learning and Why we need it ??


Types Of Neural Network
● Convolutional Neural Networks :
○ Convolutional Neural Network is basically an artificial neural network that is most widely used in the
field of Computer Vision for analyzing and classifying images.
○ It is a deep learning algorithm that takes the input image and assigns weights/biases to various aspects
or objects in the image, so that it can differentiate one from the other.
○ The hidden layers of a CNN typically consist of convolutional layers, pooling layers, fully connected
layers, and normalization layers.
● Recurrent Neural Networks :

● Recursive Neural Networks :


THANKS
ROBOTICS CLUB
IIT GUWAHATI

You might also like