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

Similar documents
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]

Practical Image and Video Processing Using MATLAB

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

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

Digital Image Processing

Motion illusion, rotating snakes

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

Vision Review: Image Processing. Course web page:

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

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

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

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

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

Digital Image Processing

Lecture #10. EECS490: Digital Image Processing

2D Discrete Fourier Transform

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

Midterm is on Thursday!

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

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

Sharpening Spatial Filters ( high pass)

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

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

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

CSCI 1290: Comp Photo

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

Prof. Feng Liu. Winter /10/2019

Digital Image Processing. Lecture 5 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

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

Image Processing for feature extraction

Image Enhancement II: Neighborhood Operations

Images and Filters. EE/CSE 576 Linda Shapiro

Image filtering, image operations. Jana Kosecka

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

Filip Malmberg 1TD396 fall 2018 Today s lecture

Sampling and Reconstruction

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

Image Filtering. Median Filtering

Lecture 3: Linear Filters

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

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

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

Computer Vision Lecture 3

Midterm Examination CS 534: Computational Photography

Image Enhancement in the Spatial Domain Low and High Pass Filtering

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

Fourier analysis of images

Color Space 1: RGB Color Space. Color Space 2: HSV. RGB Cube Easy for devices But not perceptual Where do the grays live? Where is hue and saturation?

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

Image Filtering and Gaussian Pyramids

Computer Vision, Lecture 3

Image restoration and color image processing

EE482: Digital Signal Processing Applications

Midterm Review. Image Processing CSE 166 Lecture 10

Fourier Transforms and the Frequency Domain

Lec 05 - Linear Filtering & Edge Detection

CPSC 340: Machine Learning and Data Mining. Convolutional Neural Networks Fall 2018

MATLAB 6.5 Image Processing Toolbox Tutorial

ELEC Dr Reji Mathew Electrical Engineering UNSW

Image Pyramids. Sanja Fidler CSC420: Intro to Image Understanding 1 / 35

Study guide for Graduate Computer Vision

Experiments #6. Convolution and Linear Time Invariant Systems

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

Introduction to DSP ECE-S352 Fall Quarter 2000 Matlab Project 1

Image Deblurring. This chapter describes how to deblur an image using the toolbox deblurring functions.

CAP 5415 Computer Vision. Marshall Tappen Fall Lecture 1

Topic 4: Image Filtering Workshop Solutions

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

EFFECTS OF PHASE AND AMPLITUDE ERRORS ON QAM SYSTEMS WITH ERROR- CONTROL CODING AND SOFT DECISION DECODING

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

TDI2131 Digital Image Processing (Week 4) Tutorial 3

IMAGE PROCESSING (RRY025) THE CONTINUOUS 2D FOURIER TRANSFORM

Frequency Domain Enhancement

Demosaicing Algorithms

ACM Fast Image Convolutions. by: Wojciech Jarosz

Last Lecture. photomatix.com

An Introduction to Convolutional Neural Networks. Alessandro Giusti Dalle Molle Institute for Artificial Intelligence Lugano, Switzerland

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

Computer Vision for HCI. Noise Removal. Noise in Images

Chapter 2 Image Enhancement in the Spatial Domain

Convolutional neural networks

Transforms and Frequency Filtering

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

An efficient algorithm for Gaussian blur using finite-state machines

Chapter 17. Shape-Based Operations

Sampling and Reconstruction

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

Lec 04: Image Filtering and Edge Features

Multimedia Systems Giorgio Leonardi A.A Lectures 14-16: Raster images processing and filters

Continued. Introduction to Computer Vision CSE 252a Lecture 11

Filters. Materials from Prof. Klaus Mueller

IMAGE PROCESSING PROJECT REPORT NUCLEUS CLASIFICATION

DIGITAL IMAGE PROCESSING (COM-3371) Week 2 - January 14, 2002

Implementing Sobel & Canny Edge Detection Algorithms

Image Manipulation: Filters and Convolutions

Introduction. Computer Vision. CSc I6716 Fall Part I. Image Enhancement. Zhigang Zhu, City College of New York

CSC321 Lecture 11: Convolutional Networks

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

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

IMAGE PROCESSING Vedat Tavşanoğlu

Transcription:

Lecture : Linear Operators

Administrivia I have put some Matlab image tutorials on Angel. Please take a look if you are unfamiliar with Matlab or the image toolbox. I have posted Homework on Angel. It is due next Friday at beginning of class.

Recall: D Gradient Gradient = vector of partial derivatives of image I(x,y) = [di(x,y)/dx, di(x,y)/dy] Gradient vector field indicates the direction and slope of steepest ascent (when considering image pixel values as a surface / height map).

Numerical Derivatives See also T&V, Appendix A. Finite forward difference Finite backward difference Finite central difference More accurate

Example: Spatial Image Gradients Ix=dI(x,y)/dx I(x+,y) - I(x,y) I(x,y) Partial derivative wrt x I(x,y+) - I(x,y) Partial derivative wrt y Iy=dI(x,y)/dy

Example: Spatial Image Gradients Ix=dI(x,y)/dx I(x+,y) - I(x,y) I(x,y) Partial derivative wrt x I(x,y+) - I(x,y) Partial derivative wrt y Note: From now on we will drop the constant factor /. We can divide by it later. Iy=dI(x,y)/dy

More Specifically Image I I, I, I, I,4 I,5 + I, I, I, I,4 I,5 I, I, I, I,4 I,5 I4, I4, I4, I4,4 I4,5 I5, I5, I5, I5,4 I5,5 I, I, di/dx

More Specifically I,4 Image I I, I, I, I,4 I,5 + I, I, I, I,4 I,5 I, I, I, I,4 I,5 I4, I4, I4, I4,4 I4,5 I5, I5, I5, I5,4 I5,5 I, di/dx

More Specifically I,5 Image I I, I, I, I,4 I,5 + I, I, I, I,4 I,5 I, I, I, I,4 I,5 I4, I4, I4, I4,4 I4,5 I5, I5, I5, I5,4 I5,5 I, di/dx

More Specifically I, Image I I, I, I, I, I,4 I,5 I, I, I, I,4 I,5 + I, I, I, I,4 I,5 I4, I4, I4, I4,4 I4,5 I5, I5, I5, I5,4 I5,5 And so on di/dx

Linear Filters General process: Form new image whose pixels are a weighted sum of original pixel values, using the same set of weights at each point. form the average of pixels in a neighbourhood Properties Output is a linear function of the input Output is a shift-invariant function of the input (i.e. shift the input image two pixels to the left, the output is shifted two pixels to the left) Example: smoothing by averaging 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 Note: The Linear in Linear Filters means linear combination of neighboring pixel values.

Freeman, MIT Image Filtering

Linear Filtering think of this as a weighted sum (kernel specifies the weights): 0*0+5*0+*0+4*0+5*.5+*0+*0+*+7*.5 = 7 Freeman, MIT

Linear Filtering We don t want to only do this at a single pixel, of course, but want instead to run the kernel over the whole image. Freeman, MIT

Convolution (D) Given a kernel (template) f and image h, the convolution f*h is defined as ) Note strange indexing into neighborhood of h(x,y). As a result, f behaves as if rotated by 80 degrees before combining with h. ) That doesn t matter if f has 80 deg symmetry ) If it *does* matter, use cross correlation instead.

Convolution (p,q) 5 f(u,v) h(u,v) 4 (-p,-q) (x-p,y-q) h(-u,-v) h(x-u,y-v) Adapted from Rosenfeld and Kak, Digital Picture Processing f(u,v) h(x-u,y-v) Integral of red area is the convolution for this x and y

Convolution Example f h Rotate Apply adapted from C. Rasmussen, U. of Delaware f*h

Convolution Example f Rotate Apply f*h 5 *+*+()*+* = 5

Convolution Example f Rotate Apply f*h 5 4 *+*+()*+* = 5 *+*+***+*= 4

Convolution Example f 5 4 4 Rotate Apply f*h *+*+()*+* = 5 *+*+***+*= 4 *+*+***+*= 4

Convolution Example f 5 4 4 - Rotate Apply f*h *+*+()*+* = 5 *+*+***+*= 4 *+*+***+*= 4 *+*** = -

Convolution Example f f*h Rotate Apply 5 4 4-9 *+*+()*+* = 5 *+*+***+*= 4 *+*+***+*= 4 *+*** = - *+*+*+**+*= 9

Convolution Example f f*h Rotate Apply 5 4 4-9 6 *+*+()*+* = 5 *+*+***+*= 4 *+*+***+*= 4 *+*** = - *+*+*+**+*= 9 *+*+**+*+***+*= 6

Convolution Example and so on From C. Rasmussen, U. of Delaware

Practical Issue: Border Handling Problem: what do we do for border pixels where the kernel does not completely overlap the image for interior pixels where there is full overlap, we know what to do. but what values do we use for pixels that are off the image

Practical Issue: Border Handling Different border handling methods specify different ways of defining values for pixels that are off the image. One of the simplest methods is zero-padding, which we used by default in the earlier example. 0 0 0 0... 0 0 0 0

Practical Issue: Border Handling Other methods... Replication replace each off-image pixel with the value from the nearest pixel that IS in the image. Example: s 4 5 6 7 8 9 s 4 4 4 4 5 6 6 6 6 7 7 7 7 8 9 9 9 9 7s 7 8 9 7 8 9 7 8 9 9s

Practical Issue: Border Handling Other methods... Reflection reflect pixel values at the border (as if there was a little mirror there) 9 8 7 7 8 9 9 8 7 6 5 4 4 5 6 6 5 4 Example: 4 5 6 7 8 9 6 5 4 4 5 6 6 5 4 9 8 7 7 8 9 9 8 7 9 8 7 7 8 9 9 8 7 6 5 4 4 5 6 6 5 4

Practical Issue: Border Handling Other methods... Wraparound when going off the right border of the image, you wrap around to the left border. Similarly, when leaving the bottom of the image you reenter at the top. Basically, the image is a big donut (or torus). Example: 4 5 6 7 8 9 4 5 6 7 8 9 4 5 6 7 8 9 4 5 6 7 8 9 4 5 6 4 7 8 9 7 4 5 6 4 7 8 9 7 4 5 6 7 8 9 4 5 6 7 8 9 5 8 5 8 6 9 6 9

Convolution in Matlab Could use conv and conv, but newer versions use: Imfilter(image,template{,option,option, }) Boundary options: constant, symmetric, replicate, circular Output size options: same as image, or full size (includes partial values computed when mask is off the image). Corr or conv option: convolution rotates the template (as we have discussed). Correlation does not). Type help imfilter on command line for more details

Properties of Convolution Commutative: f * g = g * f Associative: (f * g) * g = f * (g * h) Distributive: (f + g) * h = f * h + g * h Linear: (a f + b g) * h = a f * h + b g * h Shift Invariant: f(x+t) * h = (f * h)(x+t) Differentiation rule: You will see some of these again!

Linear Filtering I O Filter F O NxM output image I NxM input image F (m+)x(m+) mask e.g. F= O(i, j ) h m a b c d e f g h i k m I (i h, j k ) F (h, k ) h m k m O.Camps, PSU for m=

Back to the Gradient () * I, + (0) * I, + (+) * I, Image I I, I, I, I,4 I,5 0 + I, I, I, I,4 I,5 I, I, I, I,4 I,5 I4, I4, I4, I4,4 I4,5 I5, I5, I5, I5,4 I5,5 I, I, di/dx

Finite Difference Filters Finite Differences computed using convolution kernels Vertical Edges: Convolve with: Horizontal Edges: Convolve with: 0 0 O.Camps, PSU Question for class: Is this correct

Example: Spatial Image Gradients Ix=dI(x,y)/dx I(x,y) Partial derivative wrt x Iy=dI(x,y)/dy Partial derivative wrt y Note that there is a difference between convolving with a xn row filter and an nx col filter.