Filtering in the Spatial Domain Filtering the spatial domain is achieved by convolution Qualitatively: Slide the filter to each position, x, then sum up.

Slides:



Advertisements
Similar presentations
Basis beeldverwerking (8D040) dr. Andrea Fuster dr. Anna Vilanova Prof.dr.ir. Marcel Breeuwer Filtering.
Advertisements

3-D Computational Vision CSc Image Processing II - Fourier Transform.
Neighborhood Processing
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)
Image Processing Lecture 4
Chapter 3 Image Enhancement in the Spatial Domain.
© by Yu Hen Hu 1 ECE533 Digital Image Processing Image Enhancement in Frequency Domain.
Computer Vision Lecture 16: Texture
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
CHAPTER 4 Image Enhancement in Frequency Domain
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.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Image Enhancement.
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Chapter 4 Image Enhancement in the Frequency Domain.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
Basic Image Processing January 26, 30 and February 1.
Input image Output image Transform equation All pixels Transform equation.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
Application of Digital Signal Processing in Computed tomography (CT)
02/12/02 (c) 2002 University of Wisconsin, CS 559 Filters A filter is something that attenuates or enhances particular frequencies Easiest to visualize.
Linear Algebra and Image Processing
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
1 Chapter 8: Image Restoration 8.1 Introduction Image restoration concerns the removal or reduction of degradations that have occurred during the acquisition.
Spatial Filtering: Basics
: Chapter 14: The Frequency Domain 1 Montri Karnjanadecha ac.th/~montri Image Processing.
Chapter 5 Neighborhood Processing
Chapter 7: The Fourier Transform 7.1 Introduction
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering Prof. Charlene Tsai.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Part I: Image Transforms DIGITAL IMAGE PROCESSING.
Image Arithmetic Image arithmetic is the implementation of standard arithmetic operations, such as addition, subtraction, multiplication, and division,
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Chapter 5: Neighborhood Processing
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2
Spatial Filtering (Applying filters directly on Image) By Engr. Muhammad Saqib.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Course 2 Image Filtering. Image filtering is often required prior any other vision processes to remove image noise, overcome image corruption and change.
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
1 Reconstruction Technique. 2 Parallel Projection.
Chapter 5: Neighborhood Processing 5.1 Introduction
Digital Image Processing Lecture 5: Neighborhood Processing: Spatial Filtering March 9, 2004 Prof. Charlene Tsai.
Sejong Univ. CH3. Area Processes Convolutions Blurring Sharpening Averaging vs. Median Filtering.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
Digital Image Processing Lecture 8: Image Enhancement in Frequency Domain II Naveed Ejaz.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Miguel Tavares Coimbra
Image Subtraction Mask mode radiography h(x,y) is the mask.
Image Pre-Processing in the Spatial and Frequent Domain
IMAGE ENHANCEMENT TECHNIQUES
Image Enhancement in the
(C) 2002 University of Wisconsin, CS 559
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.
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
2D Fourier transform is separable
Computer Vision Lecture 16: Texture II
Digital Image Processing
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Basic Image Processing
Digital Image Processing Week IV
Fourier Transforms.
Image Enhancement in Spatial Domain: Neighbourhood Processing
Even Discrete Cosine Transform The Chinese University of Hong Kong
Presentation transcript:

Filtering in the Spatial Domain Filtering the spatial domain is achieved by convolution Qualitatively: Slide the filter to each position, x, then sum up the function multiplied by the filter at that position

Convolution Example

Convolution Theorem Convolution in the spatial domain is the same as multiplication in the frequency domain –Take a function, f, and compute its Fourier transform, F –Take a filter, g, and compute its Fourier transform, G –Compute H=F  G –Take the inverse Fourier transform of H, to get h –Then h=f  g Multiplication in the spatial domain is the same as convolution in the frequency domain

Filtering Images Work in the discrete spatial domain Convert the filter into a matrix, the filter mask Move the matrix over each point in the image, multiply the entries by the pixels below, then sum –eg 3x3 box filter –averages

filter2(filter,image,shape) filter2(filter,image,'same') is the default; it produces a matrix of equal size to the original image matrix. filter2(filter,image,'valid') applies the mask only to inside pixels. filter2(filter,image,'full') returns a result larger than the original; it does this by padding with zero, and applying the lter at all places on and around the image where the mask intersects the image matrix.

fspecial function; this has many options which makes for easy creation of many different filters. fspecial('average',[5,7]) will return an averaging filter of size 5x7 fspecial('average',11) will return an averaging filter of size 11x11 If we leave out the final number or vector, the 3 x3 averaging filter is returned.

c=imread('cameraman.tif'); f1=fspecial('average'); cf1=filter2(f1,c); figure,imshow(c),figure,imshow(cf1/255)

Using a 9x9 filter Using a 25x25 filter c=imread('cameraman.tif'); f9=fspecial('average', 9); cf9=filter2(f9,c); figure,imshow(c),figure,imshow(cf9/255) f25=fspecial('average', 25); cf25=filter2(f25,c); figure,imshow(c),figure,imshow(cf25/255)

f=fspecial('laplacian') f = >> cf=filter2(f,c); imshow(cf/100)

Laplacian of Gaussian (log) Filter f1=fspecial('log') f1 = >> cf1=filter2(f1,c); figure,imshow(cf1/100) In each case, the sum of all the lter elements is zero.

cf1=filter2(f1,c); figure,imshow(cf1/100) >> f2=[1 -2 1; ;1 -2 1]; cf2=filter2(f2,c); >> figure,imshow(mat2gray(cf2)); mat2gray function automatically scales the matrix elements to displayable values

maxcf2=max(cf2(:)); mincf2=min(cf2(:)); f2g=(cf2-mincf2)/(maxcf2-mincf2); >> imshow(cf2g) >> figure,imshow(cf2/60) We can generally obtain a better result by dividing the result of the filtering by a constant before displaying it:

a=50; s=3; g=fspecial('gaussian', [a a], s); surf(1:a, 1:a, g)

s=9; >> g2=fspecial('gaussian', [a a], s); >> figure, surf(1:a, 1:a, g2)

Edge sharpening

p=imread('pelicans.tif'); u=fspecial('unsharp',0.5); pu=filter2(u,p); imshow(p),figure,imshow(pu/255)

Non-linear Filters maximum filter, which has as its output the maximum value minimum filter, which has as its output the minimum value rank-order filters. In such a filter, the elements under the mask are ordered Colfilt function, which rearranges the image into columns first. median filter, which takes the central value of the ordered list.

geometric mean lter