alia sing filters orientation hog
DESCRIPTION
matlabTRANSCRIPT
![Page 1: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/1.jpg)
Image features: Histograms, Aliasing,
Filters, Orientation and HOG
D.A. Forsyth
![Page 2: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/2.jpg)
Simple color features
• Histogram of image colors in a window• Opponent color representations• R-G• B-Y=B-(R+G)/2• Intensity=(R+G+B)/3
• Percentage of blue pixels• Blue pixel map
![Page 3: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/3.jpg)
Matlab slide
![Page 4: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/4.jpg)
Scaled representations
• Represent one image with many different resolutions• Why?
• find bigger, smaller swimming pools
![Page 5: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/5.jpg)
Carelessness causes aliasing
Obtained pyramid of images by subsampling
![Page 6: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/6.jpg)
Matlab slide: subsampling
![Page 7: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/7.jpg)
Aliasing and fast changing signals
![Page 8: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/8.jpg)
More aliasing examples
• Undersampled sine wave ->
• Color shimmering on striped shirts on TV• Wheels going backwards in movies• temporal aliasing
![Page 9: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/9.jpg)
Another aliasing example
• location of a sharp change is known poorly
0 50 100 150 200 250 300 350 4000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
![Page 10: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/10.jpg)
Fundamental facts
• A sine wave will alias if sampled less often than twice per period
![Page 11: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/11.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 12: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/12.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 13: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/13.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 14: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/14.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 15: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/15.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 16: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/16.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 17: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/17.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 18: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/18.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 19: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/19.jpg)
Fundamental facts
• Sample(A+B)=Sample(A)+Sample(B)• if a signal contains a high frequency sine wave, it will alias
![Page 20: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/20.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 21: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/21.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 22: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/22.jpg)
0 10 20 30 40 50 60 70 80 90 100
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
![Page 23: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/23.jpg)
Weapons against aliasing
• Filtering• or smoothing• take the signal, reduce the fast-changing/high-frequency content• can do this by weighted local averaging
![Page 24: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/24.jpg)
Prefiltering (Ideal case)
ContinuousImage
Sampling ContinuousImage
DiscreteSamples Reconstruction
p pReconstruction
Kernel
1 1
SamplingFunction
Filter
![Page 25: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/25.jpg)
Smoothing by Averaging
Nij =1N
ΣuvOi+u,j+v
where u, v, is a window of N pixels in total centered at 0, 0
![Page 26: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/26.jpg)
• A Gaussian gives a good model of a fuzzy blob
Smoothing with a Gaussian
• Notice “ringing” • apparently, a grid is
superimposed
• Smoothing with an average actually doesn’t compare at all well with a defocussed lens• what does a point of light
produce?
![Page 27: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/27.jpg)
Gaussian filter kernel
Kuv =�
12πσ2
�exp
�−
�u2 + v2
�
2σ2
�
We’re assuming the index can take negative values
![Page 28: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/28.jpg)
Nij =�
uv
Oi−u,j−vKuv Notice the curious looking form
Smoothing with a Gaussian
![Page 29: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/29.jpg)
Matlab slide: convolution in 2D
![Page 30: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/30.jpg)
Linear Filters
• Example: smoothing by averaging• form the average of pixels in a neighbourhood
• Example: smoothing with a Gaussian• form a weighted average of pixels in a neighbourhood
• Example: finding a derivative• form a weighted average of pixels in a neighbourhood
![Page 31: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/31.jpg)
Finding derivatives
Nij =1
∆x(Ii+1,j − Iij)
![Page 32: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/32.jpg)
• Each of these involves a weighted sum of image pixels• The set of weights is the same • we represent these weights as an image, H• H is usually called the kernel
• Operation is called convolution• it’s associative
• Any linear shift-invariant operation can be represented by convolution• linear: G(k f)=k G(f)• shift invariant: G(Shift(f))=Shift(G(f))• Examples: • smoothing, differentiation, camera with a reasonable, defocussed lens
system
Convolution
Nij =�
uv
HuvOi−u,j−v
![Page 33: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/33.jpg)
Filters are templates
• At one point• output of convolution is a (strange) dot-product
• Filtering the image involves a dot product at each point• Insight • filters look like the effects they are intended to find• filters find effects they look like
Nij =�
uv
HuvOi−u,j−v
![Page 34: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/34.jpg)
Smoothing reduces noise
• Generally expect pixels to “be like” their neighbours• surfaces turn slowly• relatively few reflectance changes
• Expect noise to be independent from pixel to pixel• Implies that smoothing suppresses noise, for appropriate noise models
• Scale• the parameter in the symmetric Gaussian• as this parameter goes up, more pixels are involved in the average• and the image gets more blurred• and noise is more effectively suppressed
Kuv =�
12πσ2
�exp
�−
�u2 + v2
�
2σ2
�
![Page 35: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/35.jpg)
![Page 36: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/36.jpg)
Representing image changes: Edges
• Idea:• points where image value change very sharply are important
• changes in surface reflectance• shadow boundaries• outlines
• Finding Edges:• Estimate gradient magnitude using appropriate smoothing• Mark points where gradient magnitude is
• Locally biggest and• big
![Page 37: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/37.jpg)
Matlab slide: gradients
![Page 38: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/38.jpg)
Matlab slide: smoothed gradients
![Page 39: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/39.jpg)
1 pixel 3 pixels 7 pixels
Scale affects derivatives
![Page 40: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/40.jpg)
Scale affects gradient magnitude
![Page 41: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/41.jpg)
Smoothing and Differentiation
• Issue: noise• smooth before differentiation• two convolutions to smooth, then differentiate?• actually, no - we can use a derivative of Gaussian filter
![Page 42: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/42.jpg)
Matlab slide: orientations and arrow plots
![Page 43: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/43.jpg)
![Page 44: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/44.jpg)
![Page 45: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/45.jpg)
Matlab slide: rose plots
![Page 46: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/46.jpg)
![Page 47: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/47.jpg)
Hog features
• Take a window• subdivide into boxes, each with multiple pixels• these might overlap
• for each box, build a histogram of gradient orientations• possibly weighting by distance from center• possibly normalizing by intensity over the box
• string these histograms together to a vector
• Extremely strong at spatial coding
![Page 48: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/48.jpg)
![Page 49: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/49.jpg)
Vlfeat pointer
![Page 50: Alia Sing Filters Orientation Hog](https://reader034.vdocuments.net/reader034/viewer/2022042602/55cf9975550346d0339d8395/html5/thumbnails/50.jpg)
Image HOG features Positive termsin linear classifier
Negative termsin linear classifier