Motion illusion, rotating snakes

Similar documents
02/02/10. Image Filtering. Computer Vision CS 543 / ECE 549 University of Illinois. Derek Hoiem

Fourier analysis of images

Motivation: Image denoising. How can we reduce noise in a photograph?

Motivation: Image denoising. How can we reduce noise in a photograph?

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Image Filtering in Spatial domain. Computer Vision Jia-Bin Huang, Virginia Tech

>>> from numpy import random as r >>> I = r.rand(256,256);

Prof. Feng Liu. Winter /10/2019

Sampling and Reconstruction

>>> from numpy import random as r >>> I = r.rand(256,256);

Image Filtering and Gaussian Pyramids

CSCI 1290: Comp Photo

CS 4501: Introduction to Computer Vision. Filtering and Edge Detection

Midterm is on Thursday!

Image filtering, image operations. Jana Kosecka

Images and Filters. EE/CSE 576 Linda Shapiro

Sampling and Reconstruction

Matlab (see Homework 1: Intro to Matlab) Linear Filters (Reading: 7.1, ) Correlation. Convolution. Linear Filtering (warm-up slide) R ij

Linear Filters Tues Sept 1 Kristen Grauman UT Austin. Announcements. Plan for today 8/31/2015. Image noise Linear filters. Convolution / correlation

Image Enhancement II: Neighborhood Operations

Thinking in Frequency

Templates and Image Pyramids

Templates and Image Pyramids

Digital Image Processing

Vision Review: Image Processing. Course web page:

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Robert Collins CSE486, Penn State. Lecture 3: Linear Operators

Last Lecture. photomatix.com

Computer Vision Lecture 3

CS6670: Computer Vision Noah Snavely. Administrivia. Administrivia. Reading. Last time: Convolution. Last time: Cross correlation 9/8/2009

Midterm Examination CS 534: Computational Photography

Sampling and reconstruction

Sampling and reconstruction

Circular averaging filter (pillbox) Approximates the two-dimensional Laplacian operator. Laplacian of Gaussian filter

Next Classes. Spatial frequency Fourier transform and frequency domain. Reminder: Textbook. Frequency view of filtering Hybrid images Sampling

Image Filtering. Median Filtering

Last Lecture. photomatix.com

Digital Image Processing

Practical Image and Video Processing Using MATLAB

CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

06: Thinking in Frequencies. CS 5840: Computer Vision Instructor: Jonathan Ventura

Digital Image Processing. Digital Image Fundamentals II 12 th June, 2017

Numerical Derivatives See also T&V, Appendix A.2 Gradient = vector of partial derivatives of image I(x,y) = [di(x,y)/dx, di(x,y)/dy]

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Sampling and Reconstruction

Chapter 3 Image Enhancement in the Spatial Domain. Chapter 3 Image Enhancement in the Spatial Domain

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

More image filtering , , Computational Photography Fall 2017, Lecture 4

Tonemapping and bilateral filtering

EE482: Digital Signal Processing Applications

Thinking in Frequency

Convolution Pyramids. Zeev Farbman, Raanan Fattal and Dani Lischinski SIGGRAPH Asia Conference (2011) Julian Steil. Prof. Dr.

Lecture 3: Linear Filters

Lec 05 - Linear Filtering & Edge Detection

Image Processing for feature extraction

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Image Manipulation: Filters and Convolutions

Computing for Engineers in Python

ELEC Dr Reji Mathew Electrical Engineering UNSW

Announcements. Image Processing. What s an image? Images as functions. Image processing. What s a digital image?

Sharpening Spatial Filters ( high pass)

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

Analysis and Synthesis of Texture

Image Processing by Bilateral Filtering Method

Sampling and reconstruction. CS 4620 Lecture 13

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Image Filtering. Reading Today s Lecture. Reading for Next Time. What would be the result? Some Questions from Last Lecture

Digital Image Processing

Table of contents. Vision industrielle 2002/2003. Local and semi-local smoothing. Linear noise filtering: example. Convolution: introduction

CSC 320 H1S CSC320 Exam Study Guide (Last updated: April 2, 2015) Winter 2015

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

Lec 04: Image Filtering and Edge Features

Filters. Materials from Prof. Klaus Mueller

Filip Malmberg 1TD396 fall 2018 Today s lecture

1.Discuss the frequency domain techniques of image enhancement in detail.

Image Enhancement in the Spatial Domain Low and High Pass Filtering

Image Enhancement using Histogram Equalization and Spatial Filtering

Filtering in the spatial domain (Spatial Filtering)

DIGITAL IMAGE DE-NOISING FILTERS A COMPREHENSIVE STUDY

Image features: Histograms, Aliasing, Filters, Orientation and HOG. D.A. Forsyth

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

ACM Fast Image Convolutions. by: Wojciech Jarosz

CS/ECE 545 (Digital Image Processing) Midterm Review

CS 111: Programing Assignment 2

Computer Graphics (Fall 2011) Outline. CS 184 Guest Lecture: Sampling and Reconstruction Ravi Ramamoorthi

Computer Vision, Lecture 3

Performance Evaluation of Edge Detection Techniques for Square Pixel and Hexagon Pixel images

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Image Enhancement. Image Enhancement

Study And Analysis Of Enhancement And Edge Detection Method For Human Bone Fracture X-Ray Image

Lecture 2: Color, Filtering & Edges. Slides: S. Lazebnik, S. Seitz, W. Freeman, F. Durand, D. Forsyth, D. Lowe, B. Wandell, S.Palmer, K.

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

Image Enhancement. DD2423 Image Analysis and Computer Vision. Computational Vision and Active Perception School of Computer Science and Communication

Digital Image Processing

Design of an Efficient Edge Enhanced Image Scalar for Image Processing Applications

CIS581: Computer Vision and Computational Photography Homework: Cameras and Convolution Due: Sept. 14, 2017 at 3:00 pm

CSE 564: Visualization. Image Operations. Motivation. Provide the user (scientist, t doctor, ) with some means to: Global operations:

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

IMAGE PROCESSING Vedat Tavşanoğlu

Transcription:

Motion illusion, rotating snakes

Image Filtering 9/4/2 Computer Vision James Hays, Brown Graphic: unsharp mask Many slides by Derek Hoiem

Next three classes: three views of filtering Image filters in spatial domain Filter is a mathematical operation of a grid of numbers Smoothing, sharpening, measuring texture Image filters in the frequency domain Filtering is a way to modify the frequencies of images Denoising, sampling, image compression Templates and Image Pyramids Filtering is a way to match a template to the image Detection, coarse-to-fine registration

Image filtering Image filtering: compute function of local neighborhood at each position Really important! Enhance images Denoise, resize, increase contrast, etc. Extract information from images Texture, edges, distinctive points, etc. Detect patterns Template matching

Example: box filter g[, ] Slide credit: David Lowe (UBC)

Image filtering g[, ] f [.,.] h[.,.] 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 3 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 3 3 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 3 3 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9? 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 3 3 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9? 9 9 9 9 9 5 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Image filtering g[, ] f [.,.] h[.,.] 2 3 3 3 2 9 9 9 9 9 2 4 6 6 6 4 2 9 9 9 9 9 3 6 9 9 9 6 3 9 9 9 9 9 3 5 8 8 9 6 3 9 9 9 9 3 5 8 8 9 6 3 9 9 9 9 9 2 3 5 5 6 4 2 2 3 3 3 3 2 9 h[ m, n] g[ l] l f [ m n l] Credit: S. Seitz

Box Filter What does it do? g[, ] Replaces each pixel with an average of its neighborhood Achieve smoothing effect (remove sharp features) Slide credit: David Lowe (UBC)

Smoothing with box filter

Practice with linear filters? Original Source: D. Lowe

Practice with linear filters Original Filtered (no change) Source: D. Lowe

Practice with linear filters? Original Source: D. Lowe

Practice with linear filters Original Shifted left By pixel Source: D. Lowe

Practice with linear filters 2 -? Original (Note that filter sums to ) Source: D. Lowe

Practice with linear filters 2 - Original Sharpening filter - Accentuates differences with local average Source: D. Lowe

Sharpening Source: D. Lowe

Other filters 2 Sobel - -2 - Vertical Edge (absolute value)

Other filters - 2-2 Sobel - Horizontal Edge (absolute value)

Filtering vs. Convolution 2d filtering g=filter f=image h=filter2(g,f); or h=imfilter(f,g); h[ m, n] g[ l] l f [ m n l] 2d convolution h=conv2(g,f); h[ m, n] g[ l] l f [ m n l]

Key properties of linear filters Linearity: filter(f + f 2 ) = filter(f ) + filter(f 2 ) Shift invariance: same behavior regardless of pixel location filter(shift(f)) = shift(filter(f)) Any linear, shift-invariant operator can be represented as a convolution Source: S. Lazebnik

More properties Commutative: a * b = b * a Conceptually no difference between filter and signal Associative: a * (b * c) = (a * b) * c Often apply several filters one after another: (((a * b ) * b 2 ) * b 3 ) This is equivalent to applying one filter: a * (b * b 2 * b 3 ) Distributes over addition: a * (b + c) = (a * b) + (a * c) Scalars factor out: ka * b = a * kb = k (a * b) Identity: unit impulse e = [,,,, ], a * e = a Source: S. Lazebnik

Important filter: Gaussian Weight contributions of neighboring pixels by nearness.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 5 x 5, = Slide credit: Christopher Rasmussen

Smoothing with Gaussian filter

Smoothing with box filter

Gaussian filters Remove high-frequency components from the image (low-pass filter) Images become more smooth Convolution with self is another Gaussian So can smooth with small-width kernel, repeat, and get same result as larger-width kernel would have Convolving two times with Gaussian kernel of width σ is same as convolving once with kernel of width σ 2 Separable kernel Factors into product of two D Gaussians Source: K. Grauman

Separability of the Gaussian filter Source: D. Lowe

Separability example 2D convolution (center location only) The filter factors into a product of D filters: Perform convolution along rows: * = Followed by convolution along the remaining column: * = Source: K. Grauman

Separability Why is separability useful in practice?

Some practical matters

Practical matters How big should the filter be? Values at edges should be near zero Rule of thumb for Gaussian: set filter half-width to about 3 σ

Practical matters What about near the edge? the filter window falls off the edge of the image need to extrapolate methods: clip filter (black) wrap around copy edge reflect across edge Source: S. Marschner

Practical matters Q? methods (MATLAB): clip filter (black): imfilter(f, g, ) wrap around: imfilter(f, g, circular ) copy edge: imfilter(f, g, replicate ) reflect across edge: imfilter(f, g, symmetric ) Source: S. Marschner

g Practical matters What is the size of the output? MATLAB: filter2(g, f, shape) shape = full : output size is sum of sizes of f and g shape = same : output size is same as f shape = valid : output size is difference of sizes of f and g full same valid g g g g g f f f g g g g g g Source: S. Lazebnik

Project : Hybrid Images Gaussian Filter! A. Oliva, A. Torralba, P.G. Schyns, Hybrid Images, SIGGRAPH 26 Laplacian Filter! unit impulse Gaussian Laplacian of Gaussian

.92.93.94.97.62.37.85.97.93.92.99.95.89.82.89.56.3.75.92.8.95.9.89.72.5.55.5.42.57.4.49.9.92.96.95.88.94.56.46.9.87.9.97.95.7.8.8.87.57.37.8.88.89.79.85.49.62.6.58.5.6.58.5.6.45.33.86.84.74.58.5.39.73.92.9.49.74.96.67.54.85.48.37.88.9.94.82.93.69.49.56.66.43.42.77.73.7.9.99.79.73.9.67.33.6.69.79.73.93.97.9.94.89.49.4.78.78.77.89.99.93 Take-home messages Image is a matrix of numbers = Linear filtering is sum of dot product at each position Can smooth, sharpen, translate (among many other uses) Be aware of details for filter size, extrapolation, cropping

Practice questions. Write down a 3x3 filter that returns a positive value if the average value of the 4-adjacent neighbors is less than the center and a negative value otherwise 2. Write down a filter that will compute the gradient in the x-direction: gradx(y,x) = im(y,x+)-im(y,x) for each x, y

Practice questions 3. Fill in the blanks: a) _ = D * B b) A = _ * _ c) F = D * _ d) _ = D * D Filtering Operator A E B F G C H I D

Next class: Thinking in Frequency