Biomedical Image Analysis. Spatial Filtering

Similar documents
Chapter 3: Intensity Transformations and Spatial Filtering

3.4& Fundamentals& mechanics of spatial filtering(page 166) Spatial filter(mask) Filter coefficients Filter response

Biomedical Image Analysis. Point, Edge and Line Detection

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

Digital Image Processing

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

EE795: Computer Vision and Intelligent Systems

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

EEM 463 Introduction to Image Processing. Week 3: Intensity Transformations

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

Sharpening through spatial filtering

ECG782: Multidimensional Digital Signal Processing

Digital Image Processing. Lecture 6

ECG782: Multidimensional Digital Signal Processing

Point and Spatial Processing

Lecture 5: Frequency Domain Transformations

Lecture 4: Image Processing

SYDE 575: Introduction to Image Processing

Lecture 4: Spatial Domain Transformations

Computer Vision and Graphics (ee2031) Digital Image Processing I

Filtering and Enhancing Images

Fourier transform of images

Digital Image Processing. Image Enhancement - Filtering

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

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

Image Enhancement in Spatial Domain (Chapter 3)

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Chapter 3 Image Enhancement in the Spatial Domain

C2: Medical Image Processing Linwei Wang

BME I5000: Biomedical Imaging

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

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

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

Fall 2015 Dr. Michael J. Reale

Lecture: Edge Detection

Image Restoration and Reconstruction

Anno accademico 2006/2007. Davide Migliore

Digital Image Processing. Image Enhancement in the Frequency Domain

Vivekananda. Collegee of Engineering & Technology. Question and Answers on 10CS762 /10IS762 UNIT- 5 : IMAGE ENHANCEMENT.

Review for Exam I, EE552 2/2009

Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

Neighbourhood Operations

Image Restoration and Reconstruction

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

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

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

Image processing in frequency Domain

Digital Image Processing, 2nd ed. Digital Image Processing, 2nd ed. The principal objective of enhancement

Lecture 2: 2D Fourier transforms and applications

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

Image Processing (2) Point Operations and Local Spatial Operations

EELE 5310: Digital Image Processing. Lecture 2 Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

Digital Image Processing, 3rd ed.

EELE 5310: Digital Image Processing. Ch. 3. Eng. Ruba A. Salamah. iugaza.edu

COMP 9517 Computer Vision

PSD2B Digital Image Processing. Unit I -V

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

Efficient Nonlinear Image Processing Algorithms

Digital Image Processing

Biomedical Image Analysis. Homomorphic Filtering and applications to PET

Image Enhancement: To improve the quality of images

Digital Image Processing. Week 2

Fourier Transform in Image Processing. CS/BIOEN 6640 U of Utah Guido Gerig (slides modified from Marcel Prastawa 2012)

Lecture 6: Edge Detection

Noise Model. Important Noise Probability Density Functions (Cont.) Important Noise Probability Density Functions

Computer Vision. Fourier Transform. 20 January Copyright by NHL Hogeschool and Van de Loosdrecht Machine Vision BV All rights reserved

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

Filtering Images. Contents

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing

EEE 512 ADVANCED DIGITAL SIGNAL AND IMAGE PROCESSING

Edge detection. Gradient-based edge operators

Digital Image Processing

Tutorial 5. Jun Xu, Teaching Asistant March 2, COMP4134 Biometrics Authentication

Image Processing Lecture 10

Filtering and Edge Detection. Computer Vision I. CSE252A Lecture 10. Announcement

CoE4TN4 Image Processing. Chapter 5 Image Restoration and Reconstruction

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

Image Processing. Daniel Danilov July 13, 2015

Unit - I Computer vision Fundamentals

Point Operations and Spatial Filtering

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

Linear Operations Using Masks

Other Linear Filters CS 211A

Texture Segmentation Using Multichannel Gabor Filtering

Aliasing. Can t draw smooth lines on discrete raster device get staircased lines ( jaggies ):

Image Filtering, Warping and Sampling

T Digital Image Processing P (5 cr)

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

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

Filtering in frequency domain

image filtration i Ole-Johan Skrede INF Digital Image Processing

Neighborhood operations

Image restoration. Lecture 14. Milan Gavrilovic Centre for Image Analysis Uppsala University

Lecture 7: Most Common Edge Detectors

CMPUT 206. Introduction to Digital Image Processing

Lecture Image Enhancement and Spatial Filtering

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

Segmentation algorithm for monochrome images generally are based on one of two basic properties of gray level values: discontinuity and similarity.

Transcription:

Biomedical Image Analysis Contents: Spatial Filtering The mechanics of Spatial Filtering Smoothing and sharpening filters BMIA 15 V. Roth & P. Cattin 1

The Mechanics of Spatial Filtering Spatial filter: (i) neighborhood N, (ii) predefined operation w Example: N (3 3): g(x, y) = w( 1, 1)f(x 1, y 1) + + w(1, 1)f(x + 1, y + 1) BMIA 15 V. Roth & P. Cattin 2

Correlation and Convolution Correlation: w(x, y) f(x, y) = a b w(s, t)f(x + s, y + t) s= a t= b Correlating w with unit impulse w rotated by 180 deg Convolving w with unit impulse w. Convolve = pre-rotate filter and correlate: w(x, y) f(x, y) = a b w(s, t)f(x s, y t) s= a t= b BMIA 15 V. Roth & P. Cattin 3

Correlation and Convolution BMIA 15 V. Roth & P. Cattin 4

Correlation and Convolution (2) BMIA 15 V. Roth & P. Cattin 5

Vector Representation Let w = (w 1,..., w mn ) T be the coefficients of a m n filter. Its response R is R = w 1 z 1 + w 2 z 2 +..., +w mn z mn = w T z, where the zs are the corresponding image intensities. BMIA 15 V. Roth & P. Cattin 6

Smoothing Spatial Filters Box filter: averaging pixels over neighborhood. Generalization: weighted average. BMIA 15 V. Roth & P. Cattin 7

Smoothing Spatial Filters (2) BMIA 15 V. Roth & P. Cattin 8

Smoothing Spatial Filters (3) Typical application: blur image to get a gross representation of objects of interest BMIA 15 V. Roth & P. Cattin 9

Order-Statistic Filters Response based on ranking the pixels nonlinear. Median filter: response is median of of pixels in N. Salt-and-pepper noise good noise reduction with less blurring than linear filters. BMIA 15 V. Roth & P. Cattin 10

Median filter: example BMIA 15 V. Roth & P. Cattin 11

Sharpening Spatial Filters First order derivative of digital function: f x = f(x + 1) f(x). Second order: 2 f x 2 = f(x + 1) + f(x 1) 2f(x) Many ramp-like transitions in real images first order gives thick edges second order desirable for enhancing details. BMIA 15 V. Roth & P. Cattin 12

Sharpening Spatial Filters: Laplacian Simplest 2nd-order isotropic filter: Laplacian Digital functions: f = 2 f = 2 f x 2 + 2 f y 2. f = f(x + 1, y) + f(x 1, y) + f(x, y + 1) + f(x, y 1) 4f(x, y). Additional diagonal directions: ( f) = f + f(x 1, y 1) + f(x 1, y + 1) + f(x + 1, y 1) + f(x + 1, y + 1) 4f(x, y). Sharpening: weighted sum of original + filtered: g(x, y) = f(x, y) + c [ f(x, y)]. BMIA 15 V. Roth & P. Cattin 13

Laplacian filter masks BMIA 15 V. Roth & P. Cattin 14

Unsharp Masking and Highboost Filtering 1. Blur image f(x, y). 2. Subtract blurred from original mask g m = f(x, y) f(x, y). 3. Add (weighted portion of) mask to original g(x, y) = f(x, y) + k g m (x, y). BMIA 15 V. Roth & P. Cattin 15

Highboost: example BMIA 15 V. Roth & P. Cattin 16

Sharpening Spatial Filters: Gradient Approximate gradient magnitude by sum of absolute values: M(x, y) f/ x + f/ y = g x + g y. Sobel masks: g x = (z 7 + 2z 8 + z 9 ) (z 1 + 2z 2 + z 3 ), g y = (z 3 + 2z 6 + z 9 ) (z 1 + 2z 4 + z 7 ) y z z z z 1 2 3 4 5 z z6 x z 7 z 8 z 9 1 2 1 1 0 1 0 0 0 2 0 2 1 2 1 1 0 1 BMIA 15 V. Roth & P. Cattin 17

Sharpening Spatial Filters: Gradient (2) BMIA 15 V. Roth & P. Cattin 18

Combining Spatial Filters BMIA 15 V. Roth & P. Cattin 19

Combining Spatial Filters (2) BMIA 15 V. Roth & P. Cattin 20

Biomedical Image Analysis Filtering in the Fourier Domain Contents: Transform Domain Properties of the 2D DFT Practical filtering in the frequency domain BMIA 15 V. Roth & P. Cattin 21

Fourier s Idea BMIA 15 V. Roth & P. Cattin 22

Filtering in the Transform Domain So far: transformations operated directly on pixels Sometimes it is easier to transform images, filter in the transform domain, and apply inverse transform back to the spatial domain. Important class of 2D-linear transforms: transformed image = input image forward transformation kernel T (u, v) = f(x, y)r(x, y, u, v) x y BMIA 15 V. Roth & P. Cattin 23

Filtering in the Transform Domain (2) Inverse transform back into spatial domain uses inverse transformation kernel f(x, y) = T (u, v)s(x, y, u, v) u v Transform and its inverse build a transform pair. Kernel is separable if r(x, y, u, v) = r 1 (x, u)r 2 (y, v) and symmetric if r 1 = r 2. BMIA 15 V. Roth & P. Cattin 24

2D-Fourier transform Kernels: r(x, y, u, v) = exp( i2π(ux/m + vy/n)) s(x, y, u, v) = 1/(MN) exp(i2π(ux/m + vy/n)) Discrete Fourier transform pair: T (u, v) = M 1 x=0 f(x, y) = 1 MN N 1 y=0 M 1 u=0 f(x, y) exp N 1 v=0 T (u, v) exp ( i2π( ux M + vy N ) ) ( i2π( ux M + vy N ) ) BMIA 15 V. Roth & P. Cattin 25

Sampling 1. Continuous function f(t). 2. Impulse train. 3. Sampled function f(t) = f(t)s T (t) = n= f(t)δ(t n T ). 4. Sample values by integration: f k = f(t)δ(t k T ) dt = f(k T ). BMIA 15 V. Roth & P. Cattin 26

FT of sampled function: FT of sampled functions F (µ) = F{ f(t)} = F{f(t)s T (t)} = F (µ) S(µ) = F (µ) 1 T = = 1 T F (µ) S(µ τ) dτ + n= F (µ n T ). + n= δ(µ n T ) Infinite periodic sequence of copies of F (µ), separation 1/ T. BMIA 15 V. Roth & P. Cattin 27

FT of sampled functions (2) 1. FT of band-limited function: FT is zero outside [ µ max, µ max ]. 2. Oversampling: copies separated by C µ > 0. 3. Critical sampling: C µ = 0 4. Undersampling: copies overlap. BMIA 15 V. Roth & P. Cattin 28

FT of sampled functions (3) F (µ) is continuous periodic function with period 1/ T. Entire transform characterized by one complete period! We can recover f(t) from single period by inverse FT! Sampling theorem: 1/ T > 2µ max. BMIA 15 V. Roth & P. Cattin 29

FT of sampled functions (4) BMIA 15 V. Roth & P. Cattin 30

Aliasing BMIA 15 V. Roth & P. Cattin 31

Aliasing (2) BMIA 15 V. Roth & P. Cattin 32

Properties of the 2D DFT Translation: f(x, y)e i2π(u 0x/M+v 0 y/n) F (u u 0, v v 0 ), f(x x 0, y y 0 ) F (u, v)e i2π(x 0u/M+y 0 v/n). Rotation: x = r cos θ, y = r sin θ, u = ω cos φ, v = ω sin φ: f(r, θ + θ 0 ) F (ω, φ + θ 0 ). BMIA 15 V. Roth & P. Cattin 33

2D DFT Example BMIA 15 V. Roth & P. Cattin 34

Centering the DFT Centering in 2D: f(x, y)( 1) x+y F (u M/2, v N/2). BMIA 15 V. Roth & P. Cattin 35

Padding: 1D example BMIA 15 V. Roth & P. Cattin 36

Padding: 2D example BMIA 15 V. Roth & P. Cattin 37

Padding of a frequency domain filter Our goal: define filters directly in the frequency domain. What about padding?? One strategy: Given: image of size M N. Construct filter of size M N. Compute IFT of filter spatial filter mask. Pad spatial filter. Use FT to return to frequency domain. BMIA 15 V. Roth & P. Cattin 38

Padding of a frequency domain filter (2) FT of ideal low pass (box): sinc, frequency components extending to! Ringing artifacts. BMIA 15 V. Roth & P. Cattin 39

Practical filtering in the frequency domain Given: image of size M N. Select P = 2M, Q = 2M. Pad image to size P Q (appending zeros). Multiply by ( 1) x+y to center the FT. Compute DFT F (u, v). Construct (real,symmetric) filter H(u, v) of size P Q. Multiply G(u, v) = F (u, v) H(u, v) g p (x, y) = real { F 1 [G(u, v)] } ( 1) x+y. Crop to top left quadrant. BMIA 15 V. Roth & P. Cattin 40

Filtering in the frequency domain (2) BMIA 15 V. Roth & P. Cattin 41

Spatial- vs Frequency Domain Filtering BMIA 15 V. Roth & P. Cattin 42

Spatial- vs Frequency Domain Filtering BMIA 15 V. Roth & P. Cattin 43

Smoothing in the frequency domain BMIA 15 V. Roth & P. Cattin 44

Smoothing: ideal lowpass BMIA 15 V. Roth & P. Cattin 45

Smoothing: Butterworth lowpass 1 H(u, v) = 1 + [D(u, v)/d 0 ] 2n, D(u, v)2 = u 2 + v 2, (assuming centered filter) BMIA 15 V. Roth & P. Cattin 46

Smoothing: Butterworth lowpass (2) BMIA 15 V. Roth & P. Cattin 47

Smoothing: Gaussian lowpass H(u, v) = exp( 1 2 D(u, v)2 /D 2 0) BMIA 15 V. Roth & P. Cattin 48

Smoothing in the frequency domain (4) BMIA 15 V. Roth & P. Cattin 49

Sharpening in the frequency domain BMIA 15 V. Roth & P. Cattin 50

Sharpening in the frequency domain (2) BMIA 15 V. Roth & P. Cattin 51

Sharpening in the frequency domain (3) BMIA 15 V. Roth & P. Cattin 52

Sharpening in the frequency domain (4) BMIA 15 V. Roth & P. Cattin 53

Sharpening in the frequency domain (5) BMIA 15 V. Roth & P. Cattin 54

Sharpening in the frequency domain (6) BMIA 15 V. Roth & P. Cattin 55