Computer Vision: 4. Filtering. By I-Chen Lin Dept. of CS, National Chiao Tung University

Similar documents
convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Scaled representations

CPSC 425: Computer Vision

I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University. Computer Vision: 6. Texture

Computer Vision and Graphics (ee2031) Digital Image Processing I

Applications of Image Filters

CS 534: Computer Vision Texture

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Computer Vision. I-Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

CS 534: Computer Vision Texture

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Why is computer vision difficult?

Edge Detection Lecture 03 Computer Vision

EECS 556 Image Processing W 09. Image enhancement. Smoothing and noise removal Sharpening filters

Texture Representation + Image Pyramids

Review of Filtering. Filtering in frequency domain

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Texture. Texture. 2) Synthesis. Objectives: 1) Discrimination/Analysis

Lecture 2: 2D Fourier transforms and applications

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Image gradients and edges

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Texture and Other Uses of Filters

Templates, Image Pyramids, and Filter Banks

Frequency analysis, pyramids, texture analysis, applications (face detection, category recognition)

Filters (cont.) CS 554 Computer Vision Pinar Duygulu Bilkent University

EEM 561 Machine Vision. Week 3: Fourier Transform and Image Pyramids

2D Image Processing INFORMATIK. Kaiserlautern University. DFKI Deutsches Forschungszentrum für Künstliche Intelligenz

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Straight Lines and Hough

Lecture 6: Edge Detection

Lecture 4: Spatial Domain Transformations

To Do. Advanced Computer Graphics. Discrete Convolution. Outline. Outline. Implementing Discrete Convolution

CPSC 425: Computer Vision

Lecture 5: Frequency Domain Transformations

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Digital Image Processing. Lecture 6

FOURIER TRANSFORM GABOR FILTERS. and some textons

Digital Image Processing. Image Enhancement - Filtering

Thinking in Frequency

Digital Image Processing (CS/ECE 545) Lecture 5: Edge Detection (Part 2) & Corner Detection

Texture. Outline. Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation

CPSC 425: Computer Vision

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

Edge and local feature detection - 2. Importance of edge detection in computer vision

Digital Image Processing. Image Enhancement in the Frequency Domain

Edge and corner detection

Filters and Pyramids. CSC320: Introduction to Visual Computing Michael Guerzhoy. Many slides from Steve Marschner, Alexei Efros

Filtering, scale, orientation, localization, and texture. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

Image Filtering, Warping and Sampling

Biomedical Image Analysis. Spatial Filtering

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Other Linear Filters CS 211A

Chapter 3: Intensity Transformations and Spatial Filtering

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Fourier analysis and sampling theory

Sampling and Reconstruction. Most slides from Steve Marschner

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Segmentation and Grouping

NAME: Sample Final Exam (based on previous CSE 455 exams by Profs. Seitz and Shapiro)

Image Pyramids and Applications

Reading. 2. Fourier analysis and sampling theory. Required: Watt, Section 14.1 Recommended:

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

Anno accademico 2006/2007. Davide Migliore

Schedule for Rest of Semester

Classification of image operations. Image enhancement (GW-Ch. 3) Point operations. Neighbourhood operation

Lecture 4: Image Processing

CS1114 Section 8: The Fourier Transform March 13th, 2013

Introduction to Computer Vision

Does everyone have an override code?

Separable Kernels and Edge Detection

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

Broad field that includes low-level operations as well as complex high-level algorithms

Texture. D. Forsythe and J. Ponce Computer Vision modern approach Chapter 9 (Slides D. Lowe, UBC)

Digital Image Processing COSC 6380/4393

Final Exam Schedule. Final exam has been scheduled. 12:30 pm 3:00 pm, May 7. Location: INNOVA It will cover all the topics discussed in class

Texture. D. Forsythe and J. Ponce Computer Vision modern approach Chapter 9 (Slides D. Lowe, UBC) Previously

Outline. Sampling and Reconstruction. Sampling and Reconstruction. Foundations of Computer Graphics (Fall 2012)

What will we learn? Neighborhood processing. Convolution and correlation. Neighborhood processing. Chapter 10 Neighborhood Processing

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

Fourier transforms and convolution

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Image Analysis. Edge Detection

Lecture Image Enhancement and Spatial Filtering

Prof. Feng Liu. Winter /15/2019

Theoretically Perfect Sensor

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Computer Vision Course Lecture 04. Template Matching Image Pyramids. Ceyhun Burak Akgül, PhD cba-research.com. Spring 2015 Last updated 11/03/2015

Local Image preprocessing (cont d)

Transcription:

Computer Vision: 4. Filtering By I-Chen Lin Dept. of CS, National Chiao Tung University

Outline Impulse response and convolution. Linear filter and image pyramid. Textbook: David A. Forsyth and Jean Ponce, Computer Vision: A Modern Approach, Prentice Hall, New Jersey, 23. Some contents are from the reference lecture notes: Prof. D. Lowe, Computer Vision, UBC, CA. Prof. D.A. Forsyth, Computer Vision, UIUC. Prof. J. Rehg, Computer Vision, Georgia Inst. of Tech. Prof. T. Darrell, Computer Vision and Applications, MIT.

What s linear filtering? Construct a new image whose pixels are a weighted sum of the original pixel values. Using the same set of weights at each point. Mainly based on neighborhood of the target pixels. For example, 6 5 3 4 6 3 2 7 Some function 5/4

Linear filtering The simplest and most useful case: Replace each pixel with a linear combination of its neighbors. The prescription for the linear combination is called the convolution kernel. Similar to correlation, but 6 5 3 4 6 3 * -/4 /2 -/4 = 5/4 2 7 kernel

Correlation I 9 9 2 9 9 9 9 99 9 9 F O X X X X X X X X X X X X X X X X X X X X /9 /9.(x + x + x + 9x + x + x + x + 9x + x) = /9.( 9) = Slides from Prof. D. Lowe, Computer Vision, UBC, CA. Credit: Christopher Rasmussen

Normalized correlation Zero mean image, -: scale Zero mean image, -max:max scale

Normalized correlation Zero mean image, -: scale Zero mean image, -max:max scale

Finding hands Figure from Computer Vision for Interactive Computer Graphics, W.Freeman et al, IEEE Computer Graphics and Applications, 998.

Convolution The same as correlation, but with reversed kernels. Represent the linear weights as an image, F, called the kernel. Convolution operation: Center origin of the kernel F at each pixel location Multiply weights by corresponding pixels Set resulting value for each pixel Image, R, resulting from convolution of F with image H, where u,v range over kernel pixels: R ij u,v H iu,jv F uv Warning: the textbook mixes up H and F

Correlation Convolution Correlation compared to convolution k k j k k i j y i x I j i F y x O ), ( ), ( ), ( k k j k k i j y i x I j i F y x O ), ( ), ( ), ( k k j k k i j y i x I j i F ), ( ), ( If F(i, j) == F(-i, -j), then convolution is equivalent to correlation.

Convolution and impulse response Convolution can be viewed as a sequence of impulse responses. k O ( x) h( i) I( x i) ik Figures from cnx.org/content/m539/latest/

Examples Original Filtered (no change) Original Shifted right By pixel

Examples (cont.) Original Blur (with a box filter) 2 - Original Sharpening filter

Sharpening Sharpening filter Accentuates differences with local average

Examples: Smoothing with a box filter

Smoothing with a Gaussian Averaging does not model defocussed lens well Impulse response should be fuzzy blob, but a box filter would give a little square. Gaussian gives a better model of a fuzzy blob.

Gaussian kernel Weight contributions of neighboring pixels by nearness. For efficiency, usually use integers as weights, e.g.:.25 * Don t forget normalizing the weight sum to. 4.3.3.22.3.3.3.59.97.59.3.22.97.59.97.22.3.59.97.59.3.3.3.22.3.3

Smoothing with a Gaussian

Additive Gaussian noise σ = σ = 6

Noise and smoothing Smoothing reduces pixel noise: Each row shows smoothing with Gaussians of different width Each column shows different amounts of Gaussian noise.

Noise and smoothing Filtered noise is sometimes useful E.g. in textures synthesis.

Noise and smoothing Figures from lecture notes D.A. Forsyth, Computer Vision, UIUC.

Both the box filter and the Gaussian filter are separable into two D convolutions: First convolve each row with a D filter Then convolve each column with a D filter. A 2D Gaussian can be expressed as the product of Gaussian of X and Y. Efficient implementation 2 2 2 2 2 2 ), ( y x e y x G 2 2 2 2 2 2 2 2 y x e e

Differentiation Recall, for 2D function, f(x, y): f x lim fx, y fx,y This is linear and shift invariant, so must be the result of a convolution. We could approximate this as symmetric finite difference: h x h i h, j i, j 2 Issue: noise Smooth before differentiation Two convolutions to smooth, then differentiate? H 2

Differentiation Because differentiation is convolution, and convolution is associative. ((f**g)**h)=(f**(g**h)) We can use a derivative of Gaussian filter.

Scale affects derivatives pixel 3 pixel 7 pixel

Aliasing Can t shrink an image by taking every second pixel If we do so, characteristic errors appear Typically, small phenomena look bigger; fast phenomena can look slower Common phenomenon Wagon wheels rolling the wrong way in movies Checkerboards misrepresented in ray tracing Striped shirts look funny on color television

Re-sampling Resample the checkerboard by taking one sample at each circle.

Simple sampling, but

Smoothing as low-pass filtering High frequencies lead to trouble with sampling. Suppress high frequencies before sampling! Truncate high frequencies in FT or convolve with a low-pass filter.

The Gaussian pyramid Create each level from previous one: smooth and sample Smooth with Gaussians, in part because a Gaussian*Gaussian = another Gaussian G(x) * G(y) = G(sqrt(x 2 + y 2 )) Gaussians are low pass filters, so the representation is redundant once smoothing has been performed

The Gaussian pyramid

D Fourier Transform Represent functions on a new basis. Think of functions as vectors, with many components. www.science.org.au/nova/29/29img/wave.gif

2D 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 Basis elements have the form i2 uxvy e e i cos i sin Fg f x,y u,v gx, y f R 2 e i2 uxvy dxdy

Discrete Fourier Transform -2i 2i m= n= Figures modified from lecture notes of Prof. T. Darrell, Computer Vision and Applications, MIT.

Real part of basis element The magnitude of the vector (u, v) gives a frequency Its direction gives an orientation

2D Fourier pairs

Phase and magnitude f(x,y) is the image and is REAL F(u,v) (abbreviate as F) is in general, COMPLEX. Fourier transform is complex and difficult for visualization. Instead, think of phase and magnitude Magnitude = magnitude of complex transform = sqrt( REAL(F) 2 +IMAGINARY(F) 2 ) Phase = phase of the complex transform = atan ( IMAGINARY(F)/REAL(F) )

Phase and magnitude Image f(x,y) Magnitude of F(u,v) Phase of F(u,v)

Phase and magnitude Figure from Lee and Chen, A New Method for Coarse Classification of Textures and Class Weight Estimation for Texture Retrieval, Pattern Recognition and Image Analysis, Vol. 2, No. 4, 22, pp. 4 4.

Phase and magnitude Reconstruct with one s phase, and magnitude of the other. Reconstruct with zebra phase, cheetah magnitude Reconstruct with cheetah phase, zebra magnitude

The process and application of FFT FFT IFFT Edit Source: www.mediacy.com/apps/fft.htm, Image Pro Plus FFT Example. Slides from Earl F. Glynn, Fourier Analysis and Image Processing