Computer_vision_part2
Computer_vision_part2
Sources:
http://www.cs.cmu.edu/~16385/
http://cs231n.stanford.edu/2018/syllabus.html
http://www.cse.psu.edu/~rtc12/CSE486/
Announcement
• Algorithmic discrimination
• CV (basics)
• Due: November 28
!2
CV Pipeline
!3
Image transformations
!4
Recall: filtering
!5
Convolution
!6
Convolution
!7
Convolution
!8
Convolution
• Convolution is the process of adding each element of the image to its local neighbors,
weighted by the kernel.
!9
Convolution for 2D discrete signals
!10
Convolution for 2D discrete signals
The box filter kernel we saw earlier is the 3x3 matrix representation of
.
!11
Convolution Examples
!12
Convolution Examples
• A sharpening filter can be broken down into two steps: It takes a smoothed
image, subtracts it from the original image to obtain the "details" of the
image, and adds the "details" to the original image.
!13
Convolution Examples
• A sharpening filter can be broken down into two steps: It takes a smoothed
image, subtracts it from the original image to obtain the "details" of the
image, and adds the "details" to the original image.
!14
Convolution Examples
!15
Convolution vs Correlation
Definition of discrete 2D
convolution: notice the flip
• Most of the time won’t matter, because our kernels will be symmetric.
!16
Convolution vs correlation
!17
Correlation application
• Correlation tells you how similar the signal is to the filter at any point. This is
used for image alignment, template matching and simple image matching.
Template
Original image
!18
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
!19
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
!20
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
If the image has M x M pixels and the filter kernel has size N x N:
!21
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
If the image has M x M pixels and the filter kernel has size N x N:
!22
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
If the image has M x M pixels and the filter kernel has size N x N:
!23
Separable filters
A 2D filter is separable if it can be written as the product of a “column” and a
“row”.
1 1 1 1 1 1 1
example:
box filter 1 1 1 = 1 * row
1 1 1 1
column
If the image has M x M pixels and the filter kernel has size N x N:
!24
Examples of separable filters
!25
CV Pipeline
!26
Edge detection
• Edges are the points in an image where the image brightness changes sharply
or has discontinuities. Such discontinuities generally correspond to:
• Discontinuities in depth
• 1) Most semantic and shape information can be deduced from them, so we can
perform object recognition and analyze perspectives and geometry of an image.
!27
Edge detection
!28
Characterizing edges
• We can pinpoint where edges occur from an image's intensity profile along a
row or column of the image. Wherever there is a rapid change in the intensity
function indicates an edge, as seen where the function's first derivative has a
local extrema.
!29
Partial derivatives with Convolution
!30
Partial derivatives of an image
-1 0 1 0
-1
!31
Image Gradient
!32
Intensity profile
!33
Effect of noise
!34
Effect of noise
!35
Solution: Smoothing
!36
Edge detection via Convolution
!37
Derivative of Gaussian filter
!38
Derivatives of Gaussian filter
!39
Edge detectors
!40
Canny Edge detection
!41
Corner/blob detectors
• Edges are useful as local features, but corners and small areas (blobs) are
generally more helpful in computer vision tasks. Blob detectors can be built
by extending the basic edge detector idea that we just discussed.
!42
Scale Invariant Feature Transform
(SIFT)
• Keypoints are basically the points of interest in an image. Keypoints are
analogous to the features of a given image.
• They are locations that define what is interesting in the image. Keypoints are
important, because no matter how the image is modified (rotation, shrinking,
expanding, distortion), we will always find the same keypoints for the image.
Lowe, David G. "Distinctive image features from scale-invariant keypoints." International journal of computer vision 60.2 (2004): 91-110.
!43
SIFT
!44
Speeded-Up Robust Features (SURF)
Bay, Herbert, Tinne Tuytelaars, and Luc Van Gool. "Surf: Speeded up robust features." European conference on computer vision. Springer, Berlin, Heidelberg, 2006.
!45
SURF
!46
Bag of Words
Dictionary Learning:
Learn Visual Words using clustering
Encode:
build Bags-of-Words (BOW) vectors
for each image
Classify:
Train and test data using BOWs
!47
Which object do these parts belong
to?
!48
Some local feature are
very informative
An object as
!49
BOW
!50
Image Features
!51
Image Features: Motivation
!52
Image Features: Motivation
!53
Image Features
!54
Image Features
!55
Image features vs ConvNets
!56
!57
ImageNet
!58
!59
AlexNet
!60
Convolution Neural Networks
!61
Conferences focusing on CV
!62