SlideShare a Scribd company logo
1 of 59
Download to read offline
Introduction to Computer Vision
Anton Kasyanov
antonkasyanov.com
About me
• Long time Python enthusiast
• Graduated from RWTH Aachen, Germany
• Defended Computer Vision Bachelor and
Master theses
• Work in Ecoisme as Backend and
Algorithms Engineer
Visual Odometry(later)
Why CV?
Why CV
Why CV
Why CV
Outline
• Binary and grayscale processing
• Edges and lines detection
• Global and local descriptors
• Further topics
Binary images
• A matrix of 0’s and 1’s
• Simplest case
• Distinguish back- and foreground
Greyscale images
• More complicated
• Every pixel can be [0; 1] float
• Higher variance
• Often are better then color images
Thresholding
• Grayscale to binary
• Use domain knowledge to pick T
• Or calculate it via intra-class variance
minimisation (Otsu method)
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Thresholding
• Grayscale image Binary mask
• Different variants
One-sided
Two-sided
Set membership
B. Leibe
otherwise,0
,if,1
,
TjiF
jiFT
otherwise,0
,if,1
, 21 TjiFT
jiFT
otherwise,0
,if,1
,
ZjiF
jiFT
Image Source: http://homepages.inf.ed.ac.uk/rbf/HIPR2/
13
Thresholding
Grayscale image Binary mask
Different variants
One-sided
otherwise,0
,if,1
,
TjiF
jiFT
Thresholding
Niblack Threshold
Solution - use local window W with independent thresholds
Computing
Local Binarization [Niblack’86]
• Estimate a local threshold within a small neighborhood
window W
where k [-1,0] is a user-defined parameter.
W
Niblack Threshold
Canny edge detector
Intensity gradient
• Filter image with Gaussian derivatives approximation
G = G2
x + G2
y
Canny edge detector
• Filter with Gaussian derivative
• Use gradient magnitude
• Threshold
Canny edge detector
• Lines have different thickness
• Parts may not survive thresholding
• Use 2 thresholds, one (stronger) to
start edges, second (weaker) to
continue
Thin
Thin
Thick
Line fitting
• Many objects are characterised by straight lines
rceptualandSensoryAugmentedComputingomputerVisionWS14/15
Example: Line Fitting
• Why fit lines?
Many objects are characterized by presence of straight lines
• Wait, why aren’t we done just by running edge detection?
Why not to use edges?
• Noise
• Extra points
• Some parts can be missing
Hough Transform
• Voting technique
• What lines can be fit to point?
• Extract lines that have most votes
Hough space
To each line in image space corresponds a point in Hough space.
x
y
Image space
y = a0x + b0
Hough space
a0
b0
a
b
y = a1x + b1
a1
b1
Hough space
To each point in image space corresponds a line in Hough space.
x
y
Image space Hough space
a
b
x0
y0
x1
y1
b = -x0a + y0
b = -x1a + y1
Hough transform
• Due to numerical reasons, it is better to use polar representation:
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
infinite values, undefined for vertical lines.
• Point in image space
Sinusoid segment in
Hough space
dyx sincos
[0,0]
d
x
y
: perpendicular dist
from line to origin
: angle the perpend
makes with the x-axis
d
Slide adapted from Steve Seitz
Image Edges
Hough Lines
How to tell if images are similar?
How to tell if images are similar?
• Compare pixels
• Not robust to noise, lightning, position change
• Idea - capture color statistics via 3D color histograms
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Color Histograms
• Color statistics
Here: RGB as an example
Given: tristimulus R,G,B for each pixel
Compute 3D histogram
– H(R,G,B) = #(pixels with color (R,G,B))
23
[Swain & Ballard, 1991]B. Leibe
Color histogramsPerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Color Histograms
• Robust representation
26
Comparison
• Euclidian distance
• Mahalanobis Distance
• Chi-Square
• Earth Movers Distance
omp. Measures: Earth Movers Distance
Motivation: Moving Earth
≠
ProblemsrceptualandSensoryAugmentedComputingmputerVisionWS14/15
Challenges: Robustness
Illumination Object pose Clutter
ViewpointIntra-class
appearance
Occlusions
Image credit: Kristen Grauman
Problems
erceptualandSensoryAugmentedComputingomputerVisionWS14/15
Application: Image Matching
by Diva Sian
by swashford
Image credit: Flickr
Hard?ptualandSensoryAugmentedComputinguterVisionWS14/15 Harder Case
by Diva Sian by scgbt
Image credit: Flickr
Do you see the match?
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Harder Still?
18
NASA Mars Rover images
Do you see the match?
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Answer Below (Look for tiny colored squares)
19
B. Leibe
NASA Mars Rover images
with SIFT feature matches
(Figure by Noah Snavely)
Slide credit: Steve Seitz
Panorama stitching
ndSensoryAugmentedComputingsionWS14/15
Application: Image Stitching
• Procedure:
1. RepeatablePerceptualandSensoryAugmentedComputingComputerVisionWS14/15
• Problem 1:
Detect the same point independently in both images
25
B. Leibe
No chance to match!
We need a repeatable detector!
Slide credit: Darya Frolova, Denis Simakov
Different points, no change to match!
2. Distinctive
Should be easy to find correspondence!
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
• Problem 1:
Detect the same point independently in both images
• Problem 2:
For each point correctly recognize the corresponding one
26
B. Leibe
We need a reliable and distinctive descriptor!
?
Slide credit: Darya Frolova, Denis Simakov
Corners as keypoints
• Repeatable
• Distinctive
• Easy to find via image gradient filtering
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Corners as Distinctive Interest Points
• Design criteria
We should easily recognize the point by looking through a small
window (locality)
Shifting the window in any direction should give a large change
in intensity (good localization)
35
“edge”:
no change along
the edge direction
“corner”:
significant change
in all directions
“flat” region:
no change in all
directions
Hessian detector
SensoryAugmentedComputingnWS14/15
Hessian Detector [Beaudet78]
• Hessian determinant
yyxy
xyxx
II
II
IHessian )(
Ixx
IyyIxy
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
• Hessian determinant
2
))(det( xyyyxx IIIIHessian
2)^(. xyyyxx III
In Matlab:
yyxy
xyxx
II
II
IHessian )(
Ixx
IyyIxy
• Use 2nd derivatives over image
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15
Hessian Detector – Responses [Beaudet78]
5
Slide credit: Krystian Mikolajczyk
Descriptors
• Ok, now we know how to localise keypoints
• But how do we actually compare them?
rceptualandSensoryAugmentedComputingmputerVisionWS14/15
Local Descriptors
• We know how to detect points
• Next question:
How to describe them for matching?
?
Point descriptor should be:
1. Invariant
SIFT
• Scale Invariant Feature Transform
• A 16x16 neighbourhood around the keypoint is taken. It is divided into 16
sub-blocks of 4x4 size. For each sub-block, 8 bin orientation histogram is
created. So a total of 128 bin values are available. It is represented as a
vector to form keypoint descriptor.
SIFT
• Very robust to illumination changes
• Fast - real time capable
• Became very popular and wide-spread
SIFT
PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Can handle significant changes in illumination
– Sometimes even day vs. night (below)
Fast and efficient—can run in real time
Lots of code available
– http://people.csail.mit.edu/albert/ladypack/wiki/index.php/Known_implementations_of_SIFT
60
B. Leibe
Slide credit: Steve Seitz
Image credit: Steve Seitz
Ada Boost
• Machine learning classification method
• Have lots (hundreds) of weak classifiers
• Every week classifier is correct in > 50% cases
• Calculate weights for all of them
• Combine them into a one strong classifier
2-class classification problem
Given: training set X = {x1, …, xN}
with target values T = {t1, …, tN }, tn 2 {-1,1}.
Associated weights W={w1, …, wN} for each training point.
Basic steps
In each iteration, AdaBoost trains a new weak classifier hm(x)
based on the current weighting coefficients W(m).
We then adapt the weighting coefficients for each point
– Increase wn if xn was misclassified by hm(x).
– Decrease wn if xn was classified correctly by hm(x).
Make predictions using the final combined model
17
B. Leibe
H(x) = sign
à MX
m=1
®mhm(x)
!
{x1,…,xn}
Image credit: Kristen Grauman
Viola–Jones
• Use AdaBoost to detect objects (faces)
• Every week classifier is just a sum of
binary filters
Image credit: Adam Harvey
Further topics
• Classification via Deep Neural Nets
• Visual-inertial odometry
• Stereo vision
• Object tracking
Visual-inertial odometry
• Track position using 2 cameras and
IMU
• Useful when no GPS or similar
available
Keyframe-Based Visual-Inertial Online SLAM with Relocalization
https://arxiv.org/pdf/1702.02175.pdf
Python libraries
• scipy/numpy
• scikit-image
• OpenCV
OpenCV snippets
edges = cv2.Canny(img,100,200)
lines = cv2.HoughLines(edges,1,np.pi/180,200)
sift = cv2.xfeatures2d.SIFT_create()
kp, des = sift.detectAndCompute(img, None)
Questions?
Thank you!
slides: antonkasyanov.com

More Related Content

Similar to Introduction to Computer Vision (uapycon 2017)

151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
Junho Cho
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern Presentation
Daniel Cahall
 
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
ANISH_and_DR.DANIEL_VRINCEANU_PresentationANISH_and_DR.DANIEL_VRINCEANU_Presentation
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
Anish Patel
 

Similar to Introduction to Computer Vision (uapycon 2017) (20)

151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
151106 Sketch-based 3D Shape Retrievals using Convolutional Neural Networks
 
AlexNet
AlexNetAlexNet
AlexNet
 
Computer vision old problems new solutions
Computer vision   old problems new solutionsComputer vision   old problems new solutions
Computer vision old problems new solutions
 
16 17 bag_words
16 17 bag_words16 17 bag_words
16 17 bag_words
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern Presentation
 
The Search for a New Visual Search Beyond Language - StampedeCon AI Summit 2017
The Search for a New Visual Search Beyond Language - StampedeCon AI Summit 2017The Search for a New Visual Search Beyond Language - StampedeCon AI Summit 2017
The Search for a New Visual Search Beyond Language - StampedeCon AI Summit 2017
 
Part2
Part2Part2
Part2
 
Intro_OpenCV.ppt
Intro_OpenCV.pptIntro_OpenCV.ppt
Intro_OpenCV.ppt
 
Machine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University ChhattisgarhMachine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University Chhattisgarh
 
Lecture 2.B: Computer Vision Applications - Full Stack Deep Learning - Spring...
Lecture 2.B: Computer Vision Applications - Full Stack Deep Learning - Spring...Lecture 2.B: Computer Vision Applications - Full Stack Deep Learning - Spring...
Lecture 2.B: Computer Vision Applications - Full Stack Deep Learning - Spring...
 
Machine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional ManagersMachine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional Managers
 
Computer vision - photometric
Computer vision - photometricComputer vision - photometric
Computer vision - photometric
 
FinalPoster
FinalPosterFinalPoster
FinalPoster
 
Introduction talk to Computer Vision
Introduction talk to Computer Vision Introduction talk to Computer Vision
Introduction talk to Computer Vision
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
 
november29.ppt
november29.pptnovember29.ppt
november29.ppt
 
Introduction to computer vision with Convoluted Neural Networks
Introduction to computer vision with Convoluted Neural NetworksIntroduction to computer vision with Convoluted Neural Networks
Introduction to computer vision with Convoluted Neural Networks
 
IMAGE PROCESSING
IMAGE PROCESSINGIMAGE PROCESSING
IMAGE PROCESSING
 
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
ANISH_and_DR.DANIEL_VRINCEANU_PresentationANISH_and_DR.DANIEL_VRINCEANU_Presentation
ANISH_and_DR.DANIEL_VRINCEANU_Presentation
 
6 large-scale-learning.pptx
6 large-scale-learning.pptx6 large-scale-learning.pptx
6 large-scale-learning.pptx
 

More from Anton Kasyanov

Anton Kasyanov, Introduction to Python, Lecture5
Anton Kasyanov, Introduction to Python, Lecture5Anton Kasyanov, Introduction to Python, Lecture5
Anton Kasyanov, Introduction to Python, Lecture5
Anton Kasyanov
 
Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov
 
Anton Kasyanov, Introduction to Python, Lecture2
Anton Kasyanov, Introduction to Python, Lecture2Anton Kasyanov, Introduction to Python, Lecture2
Anton Kasyanov, Introduction to Python, Lecture2
Anton Kasyanov
 
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov
 
Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov
 

More from Anton Kasyanov (7)

spaCy lightning talk for KyivPy #21
spaCy lightning talk for KyivPy #21spaCy lightning talk for KyivPy #21
spaCy lightning talk for KyivPy #21
 
aiohttp intro
aiohttp introaiohttp intro
aiohttp intro
 
Anton Kasyanov, Introduction to Python, Lecture5
Anton Kasyanov, Introduction to Python, Lecture5Anton Kasyanov, Introduction to Python, Lecture5
Anton Kasyanov, Introduction to Python, Lecture5
 
Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3
 
Anton Kasyanov, Introduction to Python, Lecture2
Anton Kasyanov, Introduction to Python, Lecture2Anton Kasyanov, Introduction to Python, Lecture2
Anton Kasyanov, Introduction to Python, Lecture2
 
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1
 
Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4Anton Kasyanov, Introduction to Python, Lecture4
Anton Kasyanov, Introduction to Python, Lecture4
 

Recently uploaded

Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 

Recently uploaded (20)

Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 

Introduction to Computer Vision (uapycon 2017)

  • 1. Introduction to Computer Vision Anton Kasyanov antonkasyanov.com
  • 2. About me • Long time Python enthusiast • Graduated from RWTH Aachen, Germany • Defended Computer Vision Bachelor and Master theses • Work in Ecoisme as Backend and Algorithms Engineer Visual Odometry(later)
  • 7. Outline • Binary and grayscale processing • Edges and lines detection • Global and local descriptors • Further topics
  • 8. Binary images • A matrix of 0’s and 1’s • Simplest case • Distinguish back- and foreground
  • 9. Greyscale images • More complicated • Every pixel can be [0; 1] float • Higher variance • Often are better then color images
  • 10. Thresholding • Grayscale to binary • Use domain knowledge to pick T • Or calculate it via intra-class variance minimisation (Otsu method) PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Thresholding • Grayscale image Binary mask • Different variants One-sided Two-sided Set membership B. Leibe otherwise,0 ,if,1 , TjiF jiFT otherwise,0 ,if,1 , 21 TjiFT jiFT otherwise,0 ,if,1 , ZjiF jiFT Image Source: http://homepages.inf.ed.ac.uk/rbf/HIPR2/ 13 Thresholding Grayscale image Binary mask Different variants One-sided otherwise,0 ,if,1 , TjiF jiFT
  • 12. Niblack Threshold Solution - use local window W with independent thresholds Computing Local Binarization [Niblack’86] • Estimate a local threshold within a small neighborhood window W where k [-1,0] is a user-defined parameter. W
  • 15. Intensity gradient • Filter image with Gaussian derivatives approximation G = G2 x + G2 y
  • 16. Canny edge detector • Filter with Gaussian derivative • Use gradient magnitude • Threshold
  • 17. Canny edge detector • Lines have different thickness • Parts may not survive thresholding • Use 2 thresholds, one (stronger) to start edges, second (weaker) to continue Thin Thin Thick
  • 18.
  • 19.
  • 20. Line fitting • Many objects are characterised by straight lines rceptualandSensoryAugmentedComputingomputerVisionWS14/15 Example: Line Fitting • Why fit lines? Many objects are characterized by presence of straight lines • Wait, why aren’t we done just by running edge detection?
  • 21. Why not to use edges? • Noise • Extra points • Some parts can be missing
  • 22. Hough Transform • Voting technique • What lines can be fit to point? • Extract lines that have most votes
  • 23. Hough space To each line in image space corresponds a point in Hough space. x y Image space y = a0x + b0 Hough space a0 b0 a b y = a1x + b1 a1 b1
  • 24.
  • 25. Hough space To each point in image space corresponds a line in Hough space. x y Image space Hough space a b x0 y0 x1 y1 b = -x0a + y0 b = -x1a + y1
  • 26. Hough transform • Due to numerical reasons, it is better to use polar representation: PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 infinite values, undefined for vertical lines. • Point in image space Sinusoid segment in Hough space dyx sincos [0,0] d x y : perpendicular dist from line to origin : angle the perpend makes with the x-axis d Slide adapted from Steve Seitz
  • 28. How to tell if images are similar?
  • 29. How to tell if images are similar? • Compare pixels • Not robust to noise, lightning, position change • Idea - capture color statistics via 3D color histograms PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Color Histograms • Color statistics Here: RGB as an example Given: tristimulus R,G,B for each pixel Compute 3D histogram – H(R,G,B) = #(pixels with color (R,G,B)) 23 [Swain & Ballard, 1991]B. Leibe
  • 31. Comparison • Euclidian distance • Mahalanobis Distance • Chi-Square • Earth Movers Distance omp. Measures: Earth Movers Distance Motivation: Moving Earth ≠
  • 32. ProblemsrceptualandSensoryAugmentedComputingmputerVisionWS14/15 Challenges: Robustness Illumination Object pose Clutter ViewpointIntra-class appearance Occlusions Image credit: Kristen Grauman
  • 35. Do you see the match? PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Harder Still? 18 NASA Mars Rover images
  • 36. Do you see the match? PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Answer Below (Look for tiny colored squares) 19 B. Leibe NASA Mars Rover images with SIFT feature matches (Figure by Noah Snavely) Slide credit: Steve Seitz
  • 38. 1. RepeatablePerceptualandSensoryAugmentedComputingComputerVisionWS14/15 • Problem 1: Detect the same point independently in both images 25 B. Leibe No chance to match! We need a repeatable detector! Slide credit: Darya Frolova, Denis Simakov Different points, no change to match!
  • 39. 2. Distinctive Should be easy to find correspondence! PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 • Problem 1: Detect the same point independently in both images • Problem 2: For each point correctly recognize the corresponding one 26 B. Leibe We need a reliable and distinctive descriptor! ? Slide credit: Darya Frolova, Denis Simakov
  • 40. Corners as keypoints • Repeatable • Distinctive • Easy to find via image gradient filtering PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Corners as Distinctive Interest Points • Design criteria We should easily recognize the point by looking through a small window (locality) Shifting the window in any direction should give a large change in intensity (good localization) 35 “edge”: no change along the edge direction “corner”: significant change in all directions “flat” region: no change in all directions
  • 41. Hessian detector SensoryAugmentedComputingnWS14/15 Hessian Detector [Beaudet78] • Hessian determinant yyxy xyxx II II IHessian )( Ixx IyyIxy PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 • Hessian determinant 2 ))(det( xyyyxx IIIIHessian 2)^(. xyyyxx III In Matlab: yyxy xyxx II II IHessian )( Ixx IyyIxy • Use 2nd derivatives over image PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Hessian Detector – Responses [Beaudet78] 5 Slide credit: Krystian Mikolajczyk
  • 42. Descriptors • Ok, now we know how to localise keypoints • But how do we actually compare them? rceptualandSensoryAugmentedComputingmputerVisionWS14/15 Local Descriptors • We know how to detect points • Next question: How to describe them for matching? ? Point descriptor should be: 1. Invariant
  • 43. SIFT • Scale Invariant Feature Transform • A 16x16 neighbourhood around the keypoint is taken. It is divided into 16 sub-blocks of 4x4 size. For each sub-block, 8 bin orientation histogram is created. So a total of 128 bin values are available. It is represented as a vector to form keypoint descriptor.
  • 44. SIFT • Very robust to illumination changes • Fast - real time capable • Became very popular and wide-spread
  • 45. SIFT PerceptualandSensoryAugmentedComputingComputerVisionWS14/15 Can handle significant changes in illumination – Sometimes even day vs. night (below) Fast and efficient—can run in real time Lots of code available – http://people.csail.mit.edu/albert/ladypack/wiki/index.php/Known_implementations_of_SIFT 60 B. Leibe Slide credit: Steve Seitz Image credit: Steve Seitz
  • 46. Ada Boost • Machine learning classification method • Have lots (hundreds) of weak classifiers • Every week classifier is correct in > 50% cases • Calculate weights for all of them • Combine them into a one strong classifier 2-class classification problem Given: training set X = {x1, …, xN} with target values T = {t1, …, tN }, tn 2 {-1,1}. Associated weights W={w1, …, wN} for each training point. Basic steps In each iteration, AdaBoost trains a new weak classifier hm(x) based on the current weighting coefficients W(m). We then adapt the weighting coefficients for each point – Increase wn if xn was misclassified by hm(x). – Decrease wn if xn was classified correctly by hm(x). Make predictions using the final combined model 17 B. Leibe H(x) = sign à MX m=1 ®mhm(x) ! {x1,…,xn} Image credit: Kristen Grauman
  • 47. Viola–Jones • Use AdaBoost to detect objects (faces) • Every week classifier is just a sum of binary filters
  • 49.
  • 50. Further topics • Classification via Deep Neural Nets • Visual-inertial odometry • Stereo vision • Object tracking
  • 51. Visual-inertial odometry • Track position using 2 cameras and IMU • Useful when no GPS or similar available
  • 52.
  • 53.
  • 54.
  • 55. Keyframe-Based Visual-Inertial Online SLAM with Relocalization https://arxiv.org/pdf/1702.02175.pdf
  • 56. Python libraries • scipy/numpy • scikit-image • OpenCV
  • 57. OpenCV snippets edges = cv2.Canny(img,100,200) lines = cv2.HoughLines(edges,1,np.pi/180,200) sift = cv2.xfeatures2d.SIFT_create() kp, des = sift.detectAndCompute(img, None)