Linear Filters and Edges Chapters 7 and 8

Slides:



Advertisements
Similar presentations
3-D Computational Vision CSc Image Processing II - Fourier Transform.
Advertisements

November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Spatial Filtering (Chapter 3)
Pyramids and Texture. Scaled representations Big bars and little bars are both interesting Spots and hands vs. stripes and hairs Inefficient to detect.
School of Computing Science Simon Fraser University
Computer Vision - A Modern Approach Set: Linear Filters Slides by D.A. Forsyth Differentiation and convolution Recall Now this is linear and shift invariant,
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
Computer Vision - A Modern Approach
Immagini e filtri lineari. Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Linear filters and edges. Linear Filters General process: Form new image whose pixels are a weighted sum of original pixel values, using the same set.
Introduction to Computer Vision CS / ECE 181B  Handout #4 : Available this afternoon  Midterm: May 6, 2004  HW #2 due tomorrow  Ack: Prof. Matthew.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth Scaled representations Big bars (resp. spots, hands, etc.) and little.
Computer Vision P. Schrater Spring 2003
Basic Image Processing January 26, 30 and February 1.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Filtering Course web page: vision.cis.udel.edu/cv March 5, 2003  Lecture 9.
CSC589 Introduction to Computer Vision Lecture 8
Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain.
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
Discrete Images (Chapter 7) Fourier Transform on discrete and bounded domains. Given an image: 1.Zero boundary condition 2.Periodic boundary condition.
EECS 274 Computer Vision Pyramid and Texture. Filter, pyramid and texture Frequency domain Fourier transform Gaussian pyramid Wavelets Texture Reading:
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image Processing Edge detection Filtering: Noise suppresion.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Computer Vision - A Modern Approach Set: Linear Filters Slides by D.A. Forsyth Gradients and edges Points of sharp change in an image are interesting:
Edges.
NASSP Masters 5003F - Computational Astronomy Lecture 12 Complex numbers – an alternate view The Fourier transform Convolution, correlation, filtering.
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Fourier Transform.
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
Linear filters. CS8690 Computer Vision University of Missouri at Columbia What is Image Filtering? Modify the pixels in an image based on some function.
Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
Linear Filters and Edges Chapters 7 and 8
- photometric aspects of image formation gray level images
… Sampling … … Filtering … … Reconstruction …
Linear Filtering – Part II
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Linear Filters and Edges Chapters 7 and 8
Department of Computer Engineering
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F() is the spectrum of the function.
Fourier Transform.
All about convolution.
Outline Linear Shift-invariant system Linear filters
Computer Vision Lecture 9: Edge Detection II
Computer Vision Lecture 16: Texture II
Digital Media Dr. Jim Rowan ITEC 2110.
Outline Linear Shift-invariant system Linear filters
CSCE 643 Computer Vision: Thinking in Frequency
Gaussian Pyramid and Texture
Phase and Amplitude in Fourier Transforms, Meaning of frequencies
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Basic Image Processing
Digital Image Processing Week IV
Most slides from Steve Seitz
Linear Filtering CS 678 Spring 2018.
Department of Computer Engineering
Edge Detection Today’s readings Cipolla and Gee Watt,
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Most slides from Steve Seitz
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

Linear Filters and Edges Chapters 7 and 8

Filters are templates Applying a filter at some point can be seen as taking a dot-product between the image and some vector Filtering the image is a set of dot products Insight filters look like the effects they are intended to find filters find effects they look like

Normalized correlation Think of filters of a dot product now measure the angle i.e normalized correlation output is filter output, divided by root sum of squares of values over which filter lies Tricks: ensure that filter has a zero response to a constant region (helps reduce response to irrelevant background) subtract image average when computing the normalizing constant (i.e. subtract the image mean in the neighborhood)

Positive responses Positive responses

The convolution at the given point is the dot product between two vectors. cos (theta) = v dot u, f both u and v are unit vectors

Orientation representations The gradient magnitude is affected by illumination changes but it’s direction isn’t We can describe image patches by the swing of the gradient orientation Important types: constant window small gradient mags edge window few large gradient mags in one direction flow window many large gradient mags in one direction corner window large gradient mags that swing

Representing Windows Types constant Edge Flow small eigenvalues Edge one medium, one small Flow one large, one small corner two large eigenvalues H is a symmetric matrix with non-negative eigenvalues

The shape of the contour x^t H x = 1 is determined by the relative magnitude of the two eigenvalues. Magnitudes are roughly the same -> circle Otherwise -> ellipse

Scaled representations Big bars (resp. spots, hands, etc.) and little bars are both interesting Stripes and hairs, say Inefficient to detect big bars with big filters And there is superfluous detail in the filter kernel Alternative: Apply filters of fixed size to images of different sizes Typically, a collection of images whose edge length changes by a factor of 2 (or root 2) This is a pyramid (or Gaussian pyramid) by visual analogy

A bar in the big images is a hair on the zebra’s nose; in smaller images, a stripe; in the smallest, the animal’s nose

Aliasing Can’t shrink an image by taking every second pixel If we do, characteristic errors appear Typically, small phenomena look bigger; fast phenomena can look slower Aliasing …. Different signals to become indistinguishable (or aliases of one another)

Resample the checkerboard by taking one sample at each circle Resample the checkerboard by taking one sample at each circle. In the case of the top left board, new representation is reasonable. Top right also yields a reasonable representation. Bottom left is all black (dubious) and bottom right has checks that are too big.

Constructing a pyramid by taking every second pixel leads to layers that badly misrepresent the top layer

Open questions What causes the tendency of differentiation to emphasize noise? In what precise respects are discrete images different from continuous images? How do we avoid aliasing? General thread: a language for fast changes The Fourier Transform

The Fourier Transform Represent function on a new basis Think of functions as vectors, with many components We now apply a linear transformation to transform the basis dot product with each basis element In the expression, u and v select the basis element, so a function of x and y becomes a function of u and v basis elements have the form

The inverse Fourier Transform

Various Fourier Transform Pairs Important facts The Fourier transform is linear (so is its inverse) if you scale the function’s argument, then the transform’s argument scales the other way. This makes sense --- if you multiply a function’s argument by a number that is larger than one, you are stretching the function, so that high frequencies go to low frequencies The FT of a Gaussian is a Gaussian. The convolution theorem The Fourier transform of the convolution of two functions is the product of their Fourier transforms The inverse Fourier transform of the product of two Fourier transforms is the convolution of the two inverse Fourier transforms There’s a table in the book.

To get some sense of what basis elements look like, we plot a basis element --- or rather, its real part --- as a function of x,y for some fixed u, v. We get a function that is constant when (ux+vy) is constant. The magnitude of the vector (u, v) gives a frequency, and its direction gives an orientation. The function is a sinusoid with this frequency along the direction, and constant perpendicular to the direction.

And larger still...

Phase and Magnitude Fourier transform of a real function is complex difficult to plot, visualize instead, we can think of the phase and magnitude of the transform Phase is the phase of the complex transform Magnitude is the magnitude of the complex transform Curious fact all natural images have about the same magnitude transform hence, phase seems to matter, but magnitude largely doesn’t Demonstration Take two pictures, swap the phase transforms, compute the inverse - what does the result look like?

This is the magnitude transform of the cheetah pic

This is the phase transform of the cheetah pic

This is the magnitude transform of the zebra pic

This is the phase transform of the zebra pic

Reconstruction with zebra phase, cheetah magnitude

Reconstruction with cheetah phase, zebra magnitude

Luis’ Idea …. Take a white image and compute the composite images White phase + Zebra magnitude White magnitude + Zebra phase This result because the FFT of the white image is nonzero only at (0, 0).

Take random noise (or white noise) Zebra Mag + White Phase Zebra Phase + White magnitude

Delete the x-axis (set the values = 0)

Sampling in 1D takes a continuous function and replaces it with a vector of values, consisting of the function’s values at a set of sample points. We’ll assume that these sample points are on a regular grid, and can place one at each integer for convenience.

Sampling in 2D does the same thing, only in 2D Sampling in 2D does the same thing, only in 2D. We’ll assume that these sample points are on a regular grid, and can place one at each integer point for convenience.

A continuous model for a sampled function We want to be able to approximate integrals sensibly Leads to the delta function model on right

The Fourier transform of a sampled signal What this means is that the Fourier transform of the discrete signal is the sum of the Fourier transform of the original signal shifted by integers (determined by the sampling frequency).

The original signal is band limited

Nyquist Sampling Theorem: For a band-limited continuous single (with band limit F), the sampling frequency needs to be at least 2F in order to reconstruct the original signal.

Properly Sampled Improperly Sampled

Smoothing as low-pass filtering The message of the FT is that high frequencies lead to trouble with sampling. Solution: suppress high frequencies before sampling multiply the FT of the signal with something that suppresses high frequencies or convolve with a low-pass filter A filter whose FT is a box is bad, because the filter kernel has infinite support Common solution: use a Gaussian multiplying FT by Gaussian is equivalent to convolving image with Gaussian.

The Gaussian pyramid Smooth with gaussians, because Synthesis Analysis a gaussian*gaussian=another gaussian Synthesis smooth and sample Analysis take the top image Gaussians are low pass filters, so representation is redundant

From Google Image

From Google Image