Image Processing – I Correlation

CSE 468/568: Robotics Algorithms
Image Processing – I
Correlation
Karthik Dantu
[email protected]
Some slides adopted from robotics courses at Utah, MIT, ETH, CMU, DIT, USC, and others
Introduction
•  Field of signal processing where input signal is an image
•  Output is image or set of parameters associated with the
image
•  Filtering, Image enhancing, edge detection
•  Image restoration and reconstruction
•  Wavelets and multiresolution processing
•  Image compression
•  Euclidean geometry transformations such as enlargement,
reduction, rotation
•  Color correlations
•  Image registration
•  Image recognition
•  Image segmentation
Image Filtering
•  Filter à Accept/reject certain frequency components in
the frequency domain
•  Filtering can be done in both frequency and spatial
domains
•  Spatial domain: Filter == mask/kernel
Simple Frequency Filter
•  Low-pass filter = Pass the
low frequency components
•  Main effect is reducing
noise
•  Blurs resultant image
•  High-pass filter = Pass high
frequency components
•  Edge detection
Spatial Filters
•  Sxy à pixels surrounding point (x,y) in image
•  Spatial filter operates on Sxy to generate a new value for
the corresponding pixel in output image J
e.g., Averaging filter
Linear, Shift-Invariant Filters
•  Linear: each pixel is a linear combination of its neighbors
•  Shift-Invariant: Same operation is performed on every
point on the image
•  Useful Operations
•  Correlation
•  Convolution
•  For simplicity, lets look at 1-D images
Correlation
•  Averaging filter
•  Boundary conditions?
•  Ignore filtered values at the boundaries
•  Pad with zeros
•  Pad with first/last image values
Correlation - II
•  Correlation:
•  Smoothing filter:
•  Other examples?
Filters Using Continuous Functions
•  Common practice: Use a
Gaussian
•  Closer pixels have larger
influence than farther ones
•  Sigma controls the amount
of smoothing
Derivatives With Correlation
•  Derivative of an image
•  Quantify how quickly intensity changes
•  Approximate derivative operator
Template Matching
•  Find locations in image similar to a template
•  Let template =
Template Matching - II
•  First part is based only on the filter: same for all pixels
•  Second part is only based on the pixel values that overlap
the filter
•  Third part is twice the negative value of correlation
•  High correlation = good template match
Template Matching Caveat
Normalized Cross Correlation
•  Correlation: Affected by magnitude of intensities
•  Solution: Normalize
Correlation in 2D
•  Example: 2D averaging
filter
•  Size = (2N+1)2
•  Number of multiplications
(2N+1)2
•  Number of additions
(2N+1)2 -1
Separatable Filters
2-D Gaussian Smoothing