Colorado School of Mines Image and Multidimensional Signal Processing

Size: px
Start display at page:

Download "Colorado School of Mines Image and Multidimensional Signal Processing"

Transcription

1 Image and Multidimensional Signal Processing Professor William Hoff Department of Electrical Engineering and Computer Science

2 Spatial Filtering

3 Main idea Spatial filtering Define a neighborhood of a pixel Define an operation on pixels in the neighborhood Output pixel value = result of the operation Topics Linear filtering Correlation, convolution Normalized cross correlation Important examples Smoothing filters (box average, Gaussian) Sharpening filters (Laplacian, Sobel) Non-linear filters Order-statistics filters (primarily median filter) 3

4 Linear Spatial Filtering Create a filter or mask w, size m x n Apply to image f, size M x N Compute the sum of products of mask coefficients with corresponding pixels under mask Slide mask over image, apply at each point m/ n/ g( x, y) w( s, t) f ( x s, y t) sm/ tn/ w( x, y) f ( x, y) Also called crosscorrelation It is a linear operation w( x, y) a f ( x, y) a w( x, y) f ( x, y) w( x, y) f ( x, y) g( x, y) w( x, y) f ( x, y) w( x, y) g( x, y) 4

5 / / / / ), ( ), ( ), ( m m s n n t t y s x f t s w y x g 5

6 Example 3x3 averaging ( box ) filters Do manual calculation on a corner f ( x, y) g( x, y) w( x, y) f ( x, y) : : : : : : :.. 6

7 Example 3x3 averaging filters Manual calculation on corner 7

8 Matlab Examples clear all close all % Synthetic image of a white square I = zeros(00,00); I(50:150, 50:150) = 1; imshow(i,[]); % Apply 3x3 box filter w = [ 1 1 1; 1 1 1; 1 1 1]/9; I = imfilter(i, w); imtool(i,[]); fspecial useful to create filters imfilter does cross correlation % Apply 15x15 box filter w = fspecial('average', [15 15]); I3 = imfilter(i, w); imtool(i3,[]); % Show that averaging reduces noise I = I + randn(00,00)*0.5; imshow(i,[]); w = fspecial('average', [5 5]); I4 = imfilter(i, w); figure, imshow(i4,[]); 8

9 Sharpening Spatial Filters First Derivative First derivative f ( x, y) f ( x, y) f ( x, y) lim x 0 In discrete form (can also do central difference) f ( x, y) f ( x 1, y) f ( x, y) f f ( x 1) f ( x 1) / x x As a filter Sobel operators combine smoothing with derivative dx filter dy filter

10 w( x, y) Example f ( x, y) g( x, y) w( x, y) f ( x, y)

11 w( x, y) Example f ( x, y) g( x, y) w( x, y) f ( x, y)

12 Gradient Compute gradient components using first derivative operators f f f x y Gradient magnitude indicates the location of edges in the image f f x f y 1/ Gradient direction shows direction of edge We can use the Sobel operators for df/dx, df/dy 1 f y tan f x 1

13 Matlab example clear all close all I = imread('moon.tif'); imshow(i,[]); % Create Sobel filters hy = [ % can also do hy = fspecial('sobel'); ; 0 0 0; ]; hx = hy'; Ix = imfilter(i, hx); Iy = imfilter(i, hy); figure; subplot(1,,1), imshow(ix,[]); subplot(1,,), imshow(iy,[]); Note - the result is not quite correct We should first convert the input image to type double before applying imfilter (why?) 13

14 Matlab example (continued) % Compute gradient magnitude (note the use of ".") Ig = (Ix.^ + Iy.^).^ 0.5; figure, imshow(ig, []); >> help atan atan Four quadrant inverse tangent. atan(y,x) is the four quadrant arctangent of the real parts of the elements of X and Y. -pi <= atan(y,x) <= pi. See also atan. Reference page in Help browser doc atan % Compute gradient direction Iang = atan(iy,ix); figure, imshow(iang, []); % Only display angles where gradient magnitude is large Mask = (Ig > 100); figure, imshow(double(mask).* Iang, []); colormap jet 14

15 Sharpening Spatial Filters nd derivative Second derivative f x y x x x (, ) f ( x, y) f ( x 1, y) f ( x, y) f ( x 1, y) As a filter Two dimensional the Laplacian As a filter f f f x y x x =

16 High Boost Filtering We combine original image with results of Laplacian result is the original image with enhanced detail g( x, y) f ( x, y) f Also called unsharp masking In general g( x, y) Af ( x, y) f ( x, y) 16

17 17

18 Vector representation of correlation Correlation is a sum of products of corresponding terms We can think of correlation as a dot product of vectors w and f c w f w f w f mn k1 1 1 wf k k m/ n/ c( x, y) w( s, t) f ( x s, y t) sm/ tn/ w( x, y) f ( x, y) T wf mn mn If images w and f are similar, their vectors are aligned 18

19 Correlation can do matching Let w(x,y) be a template subimage Try to find an instance of w in image f(x,y) The correlation score c(x,y) is high where w matches f m/ n/ c( x, y) w( s, t) f ( x s, y t) sm/ tn/ w( x, y) f ( x, y) 19

20 0

21 Template Matching (continued) Since f is not constant everywhere, we need to normalize c wf T w f where w w 1 w w 3 w N The result is between 0..1 (for positive valued images) We can get better precision by subtracting off means c( x, y) st, s, t s, t This result is between [ w( s, t) w][ f ( x s, y t) f ] [ w( s, t) w] [ f ( x s, y t) f ] 1/ This is the normalized correlation coefficient 1

22 Normalized Cross-correlation Normalized cross-correlation (values range from ) c( x, y) where st, s, t s, t w(s,t) is a subimage, size mxn f(x,y) is a large image, size MxN sums are taken over s=1..m, t=1..n [ w( s, t) w][ f ( x s, y t) f ( x, y)] [ w( s, t) w] [ f ( x s, y t) f ( x, y)] f ( x, y) is the local mean of f, in a mxn neighborhood around (x,y) 1/ 1 f ( x, y) f ( x s, y t) mn st, See pg. 870 in the Gonzalez & Woods textbook w(s,t) Size mxn f(x,y) c(x,y) Correlation scores Size MxN Size MxN

23 Matlab Example Crop a small subimage from left image, find its match in the right image I1 = imread('test000.jpg'); T = imcrop(i1, [66, 13, 86, 33]); I = imread('test01.jpg'); C = normxcorr(t, I); % The scores are in an image that is slightly bigger than the original % image... it is expanded by half the size of the template in all % directions. So we will crop out the center portion. Csub = imcrop(c, [(size(t,)-1)/+1 (size(t,1)-1)/+1 size(i,)-1 size(i,1)-1]); cmax = max(csub(:)); [y x] = find(csub==cmax); 3

24 Doing cross correlation in Matlab without normxcorr The easiest way is to implement the equation directly, using for loops You scan through the image... at every pixel (x,y): Extract the subimage fs(x,y) from the image f surrounding x,y Subtract off the local image mean value at (x,y) Compute the sum of the product of (fs-fmean) and (w-mean(w); this is the numerator The denominator can be similarly computed Dividing the two gives you the value of the normalized cross correlation at pixel (x,y) in the ouput Note - there are faster ways to do this, using Matlab s ability to operate on whole matrices 4

25 Doing cross correlation in Matlab without normxcorr (continued) Numerator where N [ w( s, t) w][ f ( x s, y t) f ( x, y)] st, w is the mean of all pixels in w; it can be computed once. It is a scalar. f ( x, y) is the local mean of pixels in f, in a mxn window centered at (x,y). This can be represented as an image of size MxN. Then st, [ w( s, t) w][ f ( x s, y t) f ( x, y)] [ w( s, t) w] f ( x s, y t) f ( x, y) [ w( s, t) w] s, t s, t The first term is the correlation of (w-wmean) and f. The second term is zero because [ w( s, t) w] w( s, t) w mnw mnw 0 So in Matlab: N = imfilter(f,w-mean(w)); s, t s, t s, t 5

26 Doing cross correlation in Matlab without normxcorr (continued) Denominator D [ w( s, t) w] [ f ( x s, y t) f ( x, y)] s, t s, t In Matlab, you can compute fmean at every pixel by filtering with a mxn rectangle of 1 s (and dividing by mxn): [m n] = size(w); fmean = imfilter(f, ones(m,n))/(m*n); The first term is a scalar, and can be computed once. We rewrite the second term: st, [ f ( x s, y t) f ( x, y)] f ( x s, y t) f ( x, y) f ( x s, y t) f ( x, y) s, t s, t s, t f ( x s, y t) ( mn) f ( x, y) ( mn) f ( x, y) st, f ( x s, y t) ( mn) f ( x, y) st, 1/ This can be computed by filtering again with a mxn rectangle of 1 s; i.e., imfilter(f.^, ones(m,n)) 6

27 Correlation and Convolution Correlation m/ n/ g( x, y) w( s, t) f ( x s, y t) sm/ tn/ w( x, y) f ( x, y) Convolution m/ n/ g( x, y) w( s, t) f ( x s, y t) sm/ tn/ w( x, y) f ( x, y) Note that Convolution is very similar to correlation, except that we flip one of the functions Also a linear operation m/ n/ m/ n/ w( s, t) f ( x s, y t) w( s, t) f ( x s, y t) sm/ tn/ sm/ tn/ So to implement convolution we can reflect w(x,y) and then do correlation 7

28 1D Examples Figure 3.9 8

29 1D Examples 9

30 D Examples 30

31 D Examples 31

32 Properties Convolution is Commutative f * g = g * f Associative f * (g * h) = (f * g) * h Distributive f * (g + h) = f * g + f * h Correlation is distributive but not commutative or associative Convolution of a filter h(x,y) with an impulse d(x,y) yields h(x,y) 3

33 Gaussian an important smoothing filter 1D Notes: h( x) 1 x e is the standard deviation Values should sum to 1 Mask size should be at least ±3 D x y 1 h( x, y) e

34 Convolving with two Gaussians You can convolve a function with a Gaussian, then convolve again with a Gaussian. The effect is the same as convolving with a single, larger Gaussian Why? Since convolution is associative g g f g g f 1 1 and if then x x 1 1 1, 1 g e g e 1 1 g1g e 1 x 1 i.e., it is a Gaussian with standard deviation new 1 34

35 Proof You can prove this from the definition of convolution f g f ( t) g( t x) dt And use the idea that t x t x/ e e e e e t t txx x / where the last term does not depend on t and the first one is just another Gaussian, but centered around a different point. 35

36 Interesting fact If you repeatedly convolve an image N times with any filter, the effect (for large N) is that of convolving with a Gaussian This comes from the Central Limit Theorem: The sum of N mutually independent random variables with zero means and finite variances tends toward the normal probability distribution And the fact that the pdf of the sum of two independent random variables is the convolution of their pdf s

37 Separable kernels (filter masks) If a D correlation (or convolution) kernel can be separated into two 1D kernels, the operation is much faster If then h ( x, y) h1 ( x) h ( y) h( x, y) f ( x, y) h ( x) h ( y) f ( x, y) 1 Namely, do a 1D correlation with h (y) along the individual columns of the input image, then do a 1D correlation with h 1 (x) along the rows of the result from the previous step If h(x,y) is nxn, and f(x,y) is NxN Cost of a D correlation? Cost of two 1D correlations? 37

38 Separable kernels (filter masks) If a D correlation (or convolution) kernel can be separated into two 1D kernels, the operation is much faster If then h( x, y) h1 ( x) h ( y) h( x, y) f ( x, y) h ( x) h ( y) f ( x, y) 1 Prove this (HW) Namely, do a 1D correlation with h (y) along the individual columns of the input image, then do a 1D correlation with h 1 (x) along the rows of the result from the previous step If h(x,y) is nxn, and f(x,y) is NxN Cost of a D correlation? Cost of two 1D correlations? 38

39 Nonlinear Filters Median filter - a non-linear smoothing filter Steps: Order (sort) pixel values within neighborhood Replace center with some value based on the ordering (i.e., median) Advantages Especially good for reducing impulse, or shot-and-pepper noise Doesn t blur sharp edges in the image 1 1 Matlab functions medfilt1, medfilt, ordfilt D noisy step edge median filtered, filter width=7 39

40 Example on ramp edge f( x) x x 1: 4,6 :10 0 x

41 Example on ramp edge f( x) x x 1: 4,6 :10 0 x

42 4

43 Read image eight.tif Add noise: imnoise Examples - Matlab Compare imfilter, medfilt clear all close all I = imread('eight.tif'); imshow(i,[]); Inoisy = imnoise(i, 'salt & pepper', 0.05); imtool(inoisy,[]); I1 = imfilter(inoisy, fspecial('average')); imshow(i1, []); I = medfilt(inoisy); imshow(i, []); 43

44 Summary A spatial filter operates on a neighborhood of a pixel. The output pixel value is the result of the operation. A linear spatial filter performs a sum of products of the neighborhood values with the corresponding filter values. The median filter is an example of a non-linear filter. Filters can be used for smoothing and sharpening. 44

45 Questions Is the D Gaussian filter separable? Why or why not? What is the difference between convolution and correlation? Why might the median filter be preferable for some situations? 45

Review Smoothing Spatial Filters Sharpening Spatial Filters. Spatial Filtering. Dr. Praveen Sankaran. Department of ECE NIT Calicut.

Review Smoothing Spatial Filters Sharpening Spatial Filters. Spatial Filtering. Dr. Praveen Sankaran. Department of ECE NIT Calicut. Spatial Filtering Dr. Praveen Sankaran Department of ECE NIT Calicut January 7, 203 Outline 2 Linear Nonlinear 3 Spatial Domain Refers to the image plane itself. Direct manipulation of image pixels. Figure:

More information

Image Enhancement: Methods. Digital Image Processing. No Explicit definition. Spatial Domain: Frequency Domain:

Image Enhancement: Methods. Digital Image Processing. No Explicit definition. Spatial Domain: Frequency Domain: Image Enhancement: No Explicit definition Methods Spatial Domain: Linear Nonlinear Frequency Domain: Linear Nonlinear 1 Spatial Domain Process,, g x y T f x y 2 For 1 1 neighborhood: Contrast Enhancement/Stretching/Point

More information

Lecture 04 Image Filtering

Lecture 04 Image Filtering Institute of Informatics Institute of Neuroinformatics Lecture 04 Image Filtering Davide Scaramuzza 1 Lab Exercise 2 - Today afternoon Room ETH HG E 1.1 from 13:15 to 15:00 Work description: your first

More information

Computer Vision Lecture 3

Computer Vision Lecture 3 Computer Vision Lecture 3 Linear Filters 03.11.2015 Bastian Leibe RWTH Aachen http://www.vision.rwth-aachen.de leibe@vision.rwth-aachen.de Demo Haribo Classification Code available on the class website...

More information

Local Enhancement. Local enhancement

Local Enhancement. Local enhancement Local Enhancement Local Enhancement Median filtering (see notes/slides, 3.5.2) HW4 due next Wednesday Required Reading: Sections 3.3, 3.4, 3.5, 3.6, 3.7 Local Enhancement 1 Local enhancement Sometimes

More information

Local enhancement. Local Enhancement. Local histogram equalized. Histogram equalized. Local Contrast Enhancement. Fig 3.23: Another example

Local enhancement. Local Enhancement. Local histogram equalized. Histogram equalized. Local Contrast Enhancement. Fig 3.23: Another example Local enhancement Local Enhancement Median filtering Local Enhancement Sometimes Local Enhancement is Preferred. Malab: BlkProc operation for block processing. Left: original tire image. 0/07/00 Local

More information

Taking derivative by convolution

Taking derivative by convolution Taking derivative by convolution Partial derivatives with convolution For 2D function f(x,y), the partial derivative is: For discrete data, we can approximate using finite differences: To implement above

More information

ECE Digital Image Processing and Introduction to Computer Vision. Outline

ECE Digital Image Processing and Introduction to Computer Vision. Outline 2/9/7 ECE592-064 Digital Image Processing and Introduction to Computer Vision Depart. of ECE, NC State University Instructor: Tianfu (Matt) Wu Spring 207. Recap Outline 2. Sharpening Filtering Illustration

More information

Gaussian derivatives

Gaussian derivatives Gaussian derivatives UCU Winter School 2017 James Pritts Czech Tecnical University January 16, 2017 1 Images taken from Noah Snavely s and Robert Collins s course notes Definition An image (grayscale)

More information

Histogram Processing

Histogram Processing Histogram Processing The histogram of a digital image with gray levels in the range [0,L-] is a discrete function h ( r k ) = n k where r k n k = k th gray level = number of pixels in the image having

More information

Computational Photography

Computational Photography Computational Photography Si Lu Spring 208 http://web.cecs.pdx.edu/~lusi/cs50/cs50_computati onal_photography.htm 04/0/208 Last Time o Digital Camera History of Camera Controlling Camera o Photography

More information

Machine vision, spring 2018 Summary 4

Machine vision, spring 2018 Summary 4 Machine vision Summary # 4 The mask for Laplacian is given L = 4 (6) Another Laplacian mask that gives more importance to the center element is given by L = 8 (7) Note that the sum of the elements in the

More information

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news Edge Detection Introduction to Computer Vision CS / ECE 8B Thursday, April, 004 Edge detection (HO #5) Edge detection is a local area operator that seeks to find significant, meaningful changes in image

More information

CITS 4402 Computer Vision

CITS 4402 Computer Vision CITS 4402 Computer Vision Prof Ajmal Mian Adj/A/Prof Mehdi Ravanbakhsh, CEO at Mapizy (www.mapizy.com) and InFarm (www.infarm.io) Lecture 04 Greyscale Image Analysis Lecture 03 Summary Images as 2-D signals

More information

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform Cris Luengo TD396 fall 4 cris@cbuuse Today s lecture Local neighbourhood processing smoothing an image sharpening an image The convolution What is it? What is it useful for? How can I compute it? Removing

More information

Machine vision. Summary # 4. The mask for Laplacian is given

Machine vision. Summary # 4. The mask for Laplacian is given 1 Machine vision Summary # 4 The mask for Laplacian is given L = 0 1 0 1 4 1 (6) 0 1 0 Another Laplacian mask that gives more importance to the center element is L = 1 1 1 1 8 1 (7) 1 1 1 Note that the

More information

Introduction to Computer Vision. 2D Linear Systems

Introduction to Computer Vision. 2D Linear Systems Introduction to Computer Vision D Linear Systems Review: Linear Systems We define a system as a unit that converts an input function into an output function Independent variable System operator or Transfer

More information

Reading. 3. Image processing. Pixel movement. Image processing Y R I G Q

Reading. 3. Image processing. Pixel movement. Image processing Y R I G Q Reading Jain, Kasturi, Schunck, Machine Vision. McGraw-Hill, 1995. Sections 4.-4.4, 4.5(intro), 4.5.5, 4.5.6, 5.1-5.4. 3. Image processing 1 Image processing An image processing operation typically defines

More information

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

Digital Image Processing. Lecture 6 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009 Digital Image Processing Lecture 6 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 009 Outline Image Enhancement in Spatial Domain Spatial Filtering Smoothing Filters Median Filter

More information

Lecture Outline. Basics of Spatial Filtering Smoothing Spatial Filters. Sharpening Spatial Filters

Lecture Outline. Basics of Spatial Filtering Smoothing Spatial Filters. Sharpening Spatial Filters 1 Lecture Outline Basics o Spatial Filtering Smoothing Spatial Filters Averaging ilters Order-Statistics ilters Sharpening Spatial Filters Laplacian ilters High-boost ilters Gradient Masks Combining Spatial

More information

Edges and Scale. Image Features. Detecting edges. Origin of Edges. Solution: smooth first. Effects of noise

Edges and Scale. Image Features. Detecting edges. Origin of Edges. Solution: smooth first. Effects of noise Edges and Scale Image Features From Sandlot Science Slides revised from S. Seitz, R. Szeliski, S. Lazebnik, etc. Origin of Edges surface normal discontinuity depth discontinuity surface color discontinuity

More information

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading:

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading: Announcements Filtering Homework 2 is due Apr 26, :59 PM eading: Chapter 4: Linear Filters CSE 52 Lecture 6 mage Filtering nput Output Filter (From Bill Freeman) Example: Smoothing by Averaging Linear

More information

Digital Image Processing COSC 6380/4393

Digital Image Processing COSC 6380/4393 Digital Image Processing COSC 6380/4393 Lecture 11 Oct 3 rd, 2017 Pranav Mantini Slides from Dr. Shishir K Shah, and Frank Liu Review: 2D Discrete Fourier Transform If I is an image of size N then Sin

More information

TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection

TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection Technischen Universität München Winter Semester 0/0 TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection Slobodan Ilić Overview Image formation Convolution Non-liner filtering: Median

More information

Edge Detection PSY 5018H: Math Models Hum Behavior, Prof. Paul Schrater, Spring 2005

Edge Detection PSY 5018H: Math Models Hum Behavior, Prof. Paul Schrater, Spring 2005 Edge Detection PSY 5018H: Math Models Hum Behavior, Prof. Paul Schrater, Spring 2005 Gradients and edges Points of sharp change in an image are interesting: change in reflectance change in object change

More information

Image preprocessing in spatial domain

Image preprocessing in spatial domain Image preprocessing in spatial domain Sharpening, image derivatives, Laplacian, edges Revision: 1.2, dated: May 25, 2007 Tomáš Svoboda Czech Technical University, Faculty of Electrical Engineering Center

More information

Templates, Image Pyramids, and Filter Banks

Templates, Image Pyramids, and Filter Banks Templates, Image Pyramids, and Filter Banks 09/9/ Computer Vision James Hays, Brown Slides: Hoiem and others Review. Match the spatial domain image to the Fourier magnitude image 2 3 4 5 B A C D E Slide:

More information

Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER?

Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? : WHICH ONE LOOKS BETTER? 3.1 : WHICH ONE LOOKS BETTER? 3.2 1 Goal: Image enhancement seeks to improve the visual appearance of an image, or convert it to a form suited for analysis by a human or a machine.

More information

Digital Image Processing COSC 6380/4393

Digital Image Processing COSC 6380/4393 Digital Image Processing COSC 6380/4393 Lecture 13 Oct 2 nd, 2018 Pranav Mantini Slides from Dr. Shishir K Shah, and Frank Liu Review f 0 0 0 1 0 0 0 0 w 1 2 3 2 8 Zero Padding 0 0 0 0 0 0 0 1 0 0 0 0

More information

Edge Detection. Computer Vision P. Schrater Spring 2003

Edge Detection. Computer Vision P. Schrater Spring 2003 Edge Detection Computer Vision P. Schrater Spring 2003 Simplest Model: (Canny) Edge(x) = a U(x) + n(x) U(x)? x=0 Convolve image with U and find points with high magnitude. Choose value by comparing with

More information

Lecture 3: Linear Filters

Lecture 3: Linear Filters Lecture 3: Linear Filters Professor Fei Fei Li Stanford Vision Lab 1 What we will learn today? Images as functions Linear systems (filters) Convolution and correlation Discrete Fourier Transform (DFT)

More information

Lecture 7: Edge Detection

Lecture 7: Edge Detection #1 Lecture 7: Edge Detection Saad J Bedros sbedros@umn.edu Review From Last Lecture Definition of an Edge First Order Derivative Approximation as Edge Detector #2 This Lecture Examples of Edge Detection

More information

Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ]

Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ] CEE 615: Digital Image Processing Spatial Enhancements 1 Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ] Template (Windowing) Operations Template (window, box, kernel)

More information

Lecture 3: Linear Filters

Lecture 3: Linear Filters Lecture 3: Linear Filters Professor Fei Fei Li Stanford Vision Lab 1 What we will learn today? Images as functions Linear systems (filters) Convolution and correlation Discrete Fourier Transform (DFT)

More information

Empirical Mean and Variance!

Empirical Mean and Variance! Global Image Properties! Global image properties refer to an image as a whole rather than components. Computation of global image properties is often required for image enhancement, preceding image analysis.!

More information

CAP 5415 Computer Vision Fall 2011

CAP 5415 Computer Vision Fall 2011 CAP 545 Computer Vision Fall 2 Dr. Mubarak Sa Univ. o Central Florida www.cs.uc.edu/~vision/courses/cap545/all22 Oice 247-F HEC Filtering Lecture-2 General Binary Gray Scale Color Binary Images Y Row X

More information

Image Filtering. Slides, adapted from. Steve Seitz and Rick Szeliski, U.Washington

Image Filtering. Slides, adapted from. Steve Seitz and Rick Szeliski, U.Washington Image Filtering Slides, adapted from Steve Seitz and Rick Szeliski, U.Washington The power of blur All is Vanity by Charles Allen Gillbert (1873-1929) Harmon LD & JuleszB (1973) The recognition of faces.

More information

Computer Vision Lecture 3

Computer Vision Lecture 3 Demo Haribo Classification Computer Vision Lecture 3 Linear Filters 23..24 Bastian Leibe RWTH Aachen http://www.vision.rwth-aachen.de leibe@vision.rwth-aachen.de Code available on the class website...

More information

Linear Operators and Fourier Transform

Linear Operators and Fourier Transform Linear Operators and Fourier Transform DD2423 Image Analysis and Computer Vision Mårten Björkman Computational Vision and Active Perception School of Computer Science and Communication November 13, 2013

More information

Laplacian Filters. Sobel Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters

Laplacian Filters. Sobel Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters Sobel Filters Note that smoothing the image before applying a Sobel filter typically gives better results. Even thresholding the Sobel filtered image cannot usually create precise, i.e., -pixel wide, edges.

More information

Outline. Convolution. Filtering

Outline. Convolution. Filtering Filtering Outline Convolution Filtering Logistics HW1 HW2 - out tomorrow Recall: what is a digital (grayscale) image? Matrix of integer values Images as height fields Let s think of image as zero-padded

More information

CAP 5415 Computer Vision

CAP 5415 Computer Vision CAP 545 Computer Vision Dr. Mubarak Sa Univ. o Central Florida Filtering Lecture-2 Contents Filtering/Smooting/Removing Noise Convolution/Correlation Image Derivatives Histogram Some Matlab Functions General

More information

Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems

Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems 1 Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems V. Estivill-Castro 2 Perception Concepts Vision Chapter 4 (textbook) Sections 4.3 to 4.5 What is the course

More information

Filtering and Edge Detection

Filtering and Edge Detection Filtering and Edge Detection Local Neighborhoods Hard to tell anything from a single pixel Example: you see a reddish pixel. Is this the object s color? Illumination? Noise? The next step in order of complexity

More information

Edge Detection in Computer Vision Systems

Edge Detection in Computer Vision Systems 1 CS332 Visual Processing in Computer and Biological Vision Systems Edge Detection in Computer Vision Systems This handout summarizes much of the material on the detection and description of intensity

More information

Edge Detection. CS 650: Computer Vision

Edge Detection. CS 650: Computer Vision CS 650: Computer Vision Edges and Gradients Edge: local indication of an object transition Edge detection: local operators that find edges (usually involves convolution) Local intensity transitions are

More information

CS4670: Computer Vision Kavita Bala. Lecture 7: Harris Corner Detec=on

CS4670: Computer Vision Kavita Bala. Lecture 7: Harris Corner Detec=on CS4670: Computer Vision Kavita Bala Lecture 7: Harris Corner Detec=on Announcements HW 1 will be out soon Sign up for demo slots for PA 1 Remember that both partners have to be there We will ask you to

More information

Introduction to Linear Systems

Introduction to Linear Systems cfl David J Fleet, 998 Introduction to Linear Systems David Fleet For operator T, input I, and response R = T [I], T satisfies: ffl homogeniety: iff T [ai] = at[i] 8a 2 C ffl additivity: iff T [I + I 2

More information

Image Filtering, Edges and Image Representation

Image Filtering, Edges and Image Representation Image Filtering, Edges and Image Representation Capturing what s important Req reading: Chapter 7, 9 F&P Adelson, Simoncelli and Freeman (handout online) Opt reading: Horn 7 & 8 FP 8 February 19, 8 A nice

More information

The Frequency Domain, without tears. Many slides borrowed from Steve Seitz

The Frequency Domain, without tears. Many slides borrowed from Steve Seitz The Frequency Domain, without tears Many slides borrowed from Steve Seitz Somewhere in Cinque Terre, May 2005 CS194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2016

More information

Basic Linear Algebra in MATLAB

Basic Linear Algebra in MATLAB Basic Linear Algebra in MATLAB 9.29 Optional Lecture 2 In the last optional lecture we learned the the basic type in MATLAB is a matrix of double precision floating point numbers. You learned a number

More information

Lecture 8: Interest Point Detection. Saad J Bedros

Lecture 8: Interest Point Detection. Saad J Bedros #1 Lecture 8: Interest Point Detection Saad J Bedros sbedros@umn.edu Review of Edge Detectors #2 Today s Lecture Interest Points Detection What do we mean with Interest Point Detection in an Image Goal:

More information

Computer Vision & Digital Image Processing

Computer Vision & Digital Image Processing Computer Vision & Digital Image Processing Image Restoration and Reconstruction I Dr. D. J. Jackson Lecture 11-1 Image restoration Restoration is an objective process that attempts to recover an image

More information

Image Processing. Waleed A. Yousef Faculty of Computers and Information, Helwan University. April 3, 2010

Image Processing. Waleed A. Yousef Faculty of Computers and Information, Helwan University. April 3, 2010 Image Processing Waleed A. Yousef Faculty of Computers and Information, Helwan University. April 3, 2010 Ch3. Image Enhancement in the Spatial Domain Note that T (m) = 0.5 E. The general law of contrast

More information

18/10/2017. Image Enhancement in the Spatial Domain: Gray-level transforms. Image Enhancement in the Spatial Domain: Gray-level transforms

18/10/2017. Image Enhancement in the Spatial Domain: Gray-level transforms. Image Enhancement in the Spatial Domain: Gray-level transforms Gray-level transforms Gray-level transforms Generic, possibly nonlinear, pointwise operator (intensity mapping, gray-level transformation): Basic gray-level transformations: Negative: s L 1 r Generic log:

More information

ITK Filters. Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms

ITK Filters. Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms ITK Filters Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms ITCS 6010:Biomedical Imaging and Visualization 1 ITK Filters:

More information

Prof. Mohd Zaid Abdullah Room No:

Prof. Mohd Zaid Abdullah Room No: EEE 52/4 Advnced Digital Signal and Image Processing Tuesday, 00-300 hrs, Data Com. Lab. Friday, 0800-000 hrs, Data Com. Lab Prof. Mohd Zaid Abdullah Room No: 5 Email: mza@usm.my www.eng.usm.my Electromagnetic

More information

The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall Many slides borrowed from Steve Seitz

The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall Many slides borrowed from Steve Seitz The Frequency Domain 15-463: Computational Photography Alexei Efros, CMU, Fall 2008 Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve Seitz Salvador Dali Gala Contemplating the Mediterranean

More information

IMAGE ENHANCEMENT II (CONVOLUTION)

IMAGE ENHANCEMENT II (CONVOLUTION) MOTIVATION Recorded images often exhibit problems such as: blurry noisy Image enhancement aims to improve visual quality Cosmetic processing Usually empirical techniques, with ad hoc parameters ( whatever

More information

Enhancement Using Local Histogram

Enhancement Using Local Histogram Enhancement Using Local Histogram Used to enhance details over small portions o the image. Deine a square or rectangular neighborhood hose center moves rom piel to piel. Compute local histogram based on

More information

Introduction to Computer Vision

Introduction to Computer Vision Introduction to Computer Vision Michael J. Black Sept 2009 Lecture 8: Pyramids and image derivatives Goals Images as functions Derivatives of images Edges and gradients Laplacian pyramids Code for lecture

More information

CS 3710: Visual Recognition Describing Images with Features. Adriana Kovashka Department of Computer Science January 8, 2015

CS 3710: Visual Recognition Describing Images with Features. Adriana Kovashka Department of Computer Science January 8, 2015 CS 3710: Visual Recognition Describing Images with Features Adriana Kovashka Department of Computer Science January 8, 2015 Plan for Today Presentation assignments + schedule changes Image filtering Feature

More information

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

I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University. Computer Vision: 4. Filtering I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University Computer Vision: 4. Filtering Outline Impulse response and convolution. Linear filter and image pyramid. Textbook: David A. Forsyth

More information

PDEs in Image Processing, Tutorials

PDEs in Image Processing, Tutorials PDEs in Image Processing, Tutorials Markus Grasmair Vienna, Winter Term 2010 2011 Direct Methods Let X be a topological space and R: X R {+ } some functional. following definitions: The mapping R is lower

More information

Convolution Spatial Aliasing Frequency domain filtering fundamentals Applications Image smoothing Image sharpening

Convolution Spatial Aliasing Frequency domain filtering fundamentals Applications Image smoothing Image sharpening Frequency Domain Filtering Correspondence between Spatial and Frequency Filtering Fourier Transform Brief Introduction Sampling Theory 2 D Discrete Fourier Transform Convolution Spatial Aliasing Frequency

More information

Additional Pointers. Introduction to Computer Vision. Convolution. Area operations: Linear filtering

Additional Pointers. Introduction to Computer Vision. Convolution. Area operations: Linear filtering Additional Pointers Introduction to Computer Vision CS / ECE 181B andout #4 : Available this afternoon Midterm: May 6, 2004 W #2 due tomorrow Ack: Prof. Matthew Turk for the lecture slides. See my ECE

More information

Convolution and Linear Systems

Convolution and Linear Systems CS 450: Introduction to Digital Signal and Image Processing Bryan Morse BYU Computer Science Introduction Analyzing Systems Goal: analyze a device that turns one signal into another. Notation: f (t) g(t)

More information

COMP344 Digital Image Processing Fall 2007 Final Examination

COMP344 Digital Image Processing Fall 2007 Final Examination COMP344 Digital Image Processing Fall 2007 Final Examination Time allowed: 2 hours Name Student ID Email Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Total With model answer HK University

More information

ECG782: Multidimensional Digital Signal Processing

ECG782: Multidimensional Digital Signal Processing Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu ECG782: Multidimensional Digital Signal Processing Spring 2014 TTh 14:30-15:45 CBC C313 Lecture 05 Image Processing Basics 13/02/04 http://www.ee.unlv.edu/~b1morris/ecg782/

More information

Image Enhancement in the frequency domain. Inel 5046 Prof. Vidya Manian

Image Enhancement in the frequency domain. Inel 5046 Prof. Vidya Manian Image Enhancement in the frequency domain Inel 5046 Prof. Vidya Manian Introduction 2D Fourier transform Basics of filtering in frequency domain Ideal low pass filter Gaussian low pass filter Ideal high

More information

The Frequency Domain. Many slides borrowed from Steve Seitz

The Frequency Domain. Many slides borrowed from Steve Seitz The Frequency Domain Many slides borrowed from Steve Seitz Somewhere in Cinque Terre, May 2005 15-463: Computational Photography Alexei Efros, CMU, Spring 2010 Salvador Dali Gala Contemplating the Mediterranean

More information

Image Gradients and Gradient Filtering Computer Vision

Image Gradients and Gradient Filtering Computer Vision Image Gradients and Gradient Filtering 16-385 Computer Vision What is an image edge? Recall that an image is a 2D function f(x) edge edge How would you detect an edge? What kinds of filter would you use?

More information

Lecture 8: Interest Point Detection. Saad J Bedros

Lecture 8: Interest Point Detection. Saad J Bedros #1 Lecture 8: Interest Point Detection Saad J Bedros sbedros@umn.edu Last Lecture : Edge Detection Preprocessing of image is desired to eliminate or at least minimize noise effects There is always tradeoff

More information

Feature extraction: Corners and blobs

Feature extraction: Corners and blobs Feature extraction: Corners and blobs Review: Linear filtering and edge detection Name two different kinds of image noise Name a non-linear smoothing filter What advantages does median filtering have over

More information

Digital Image Processing. Filtering in the Frequency Domain

Digital Image Processing. Filtering in the Frequency Domain 2D Linear Systems 2D Fourier Transform and its Properties The Basics of Filtering in Frequency Domain Image Smoothing Image Sharpening Selective Filtering Implementation Tips 1 General Definition: System

More information

LoG Blob Finding and Scale. Scale Selection. Blobs (and scale selection) Achieving scale covariance. Blob detection in 2D. Blob detection in 2D

LoG Blob Finding and Scale. Scale Selection. Blobs (and scale selection) Achieving scale covariance. Blob detection in 2D. Blob detection in 2D Achieving scale covariance Blobs (and scale selection) Goal: independently detect corresponding regions in scaled versions of the same image Need scale selection mechanism for finding characteristic region

More information

Lecture 4 Filtering in the Frequency Domain. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016

Lecture 4 Filtering in the Frequency Domain. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016 Lecture 4 Filtering in the Frequency Domain Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016 Outline Background From Fourier series to Fourier transform Properties of the Fourier

More information

Medical Image Analysis

Medical Image Analysis Medical Image Analysis CS 593 / 791 Computer Science and Electrical Engineering Dept. West Virginia University 20th January 2006 Outline 1 Discretizing the heat equation 2 Outline 1 Discretizing the heat

More information

Discrete Fourier Transform

Discrete Fourier Transform Discrete Fourier Transform DD2423 Image Analysis and Computer Vision Mårten Björkman Computational Vision and Active Perception School of Computer Science and Communication November 13, 2013 Mårten Björkman

More information

Lifting Detail from Darkness

Lifting Detail from Darkness Lifting Detail from Darkness J.P.Lewis zilla@computer.org Disney The Secret Lab Lewis / Detail from Darkness p.1/38 Brightness-Detail Decomposition detail image image intensity Separate detail by Wiener

More information

Image processing and Computer Vision

Image processing and Computer Vision 1 / 1 Image processing and Computer Vision Continuous Optimization and applications to image processing Martin de La Gorce martin.de-la-gorce@enpc.fr February 2015 Optimization 2 / 1 We have a function

More information

Image Enhancement in the frequency domain. GZ Chapter 4

Image Enhancement in the frequency domain. GZ Chapter 4 Image Enhancement in the frequency domain GZ Chapter 4 Contents In this lecture we will look at image enhancement in the frequency domain The Fourier series & the Fourier transform Image Processing in

More information

Slow mo guys Saccades. https://youtu.be/fmg9zohesgq?t=4s

Slow mo guys Saccades. https://youtu.be/fmg9zohesgq?t=4s Slow mo guys Saccades https://youtu.be/fmg9zohesgq?t=4s Thinking in Frequency Computer Vision James Hays Slides: Hoiem, Efros, and others Recap of Wednesday Linear filtering is dot product at each position

More information

Vectors [and more on masks] Vector space theory applies directly to several image processing/ representation problems

Vectors [and more on masks] Vector space theory applies directly to several image processing/ representation problems Vectors [and more on masks] Vector space theory applies directly to several image processing/ representation problems 1 Image as a sum of basic images What if every person s portrait photo could be expressed

More information

Achieving scale covariance

Achieving scale covariance Achieving scale covariance Goal: independently detect corresponding regions in scaled versions of the same image Need scale selection mechanism for finding characteristic region size that is covariant

More information

Basics on 2-D 2 D Random Signal

Basics on 2-D 2 D Random Signal Basics on -D D Random Signal Spring 06 Instructor: K. J. Ray Liu ECE Department, Univ. of Maryland, College Park Overview Last Time: Fourier Analysis for -D signals Image enhancement via spatial filtering

More information

ECG782: Multidimensional Digital Signal Processing

ECG782: Multidimensional Digital Signal Processing Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu ECG782: Multidimensional Digital Signal Processing Filtering in the Frequency Domain http://www.ee.unlv.edu/~b1morris/ecg782/ 2 Outline Background

More information

Roadmap. Introduction to image analysis (computer vision) Theory of edge detection. Applications

Roadmap. Introduction to image analysis (computer vision) Theory of edge detection. Applications Edge Detection Roadmap Introduction to image analysis (computer vision) Its connection with psychology and neuroscience Why is image analysis difficult? Theory of edge detection Gradient operator Advanced

More information

Image Analysis. Feature extraction: corners and blobs

Image Analysis. Feature extraction: corners and blobs Image Analysis Feature extraction: corners and blobs Christophoros Nikou cnikou@cs.uoi.gr Images taken from: Computer Vision course by Svetlana Lazebnik, University of North Carolina at Chapel Hill (http://www.cs.unc.edu/~lazebnik/spring10/).

More information

Image Degradation Model (Linear/Additive)

Image Degradation Model (Linear/Additive) Image Degradation Model (Linear/Additive),,,,,,,, g x y h x y f x y x y G uv H uv F uv N uv 1 Source of noise Image acquisition (digitization) Image transmission Spatial properties of noise Statistical

More information

DISCRETE FOURIER TRANSFORM

DISCRETE FOURIER TRANSFORM DD2423 Image Processing and Computer Vision DISCRETE FOURIER TRANSFORM Mårten Björkman Computer Vision and Active Perception School of Computer Science and Communication November 1, 2012 1 Terminology:

More information

Used to extract image components that are useful in the representation and description of region shape, such as

Used to extract image components that are useful in the representation and description of region shape, such as Used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction skeletons convex hull morphological filtering thinning pruning Sets

More information

Numerical Methods in TEM Convolution and Deconvolution

Numerical Methods in TEM Convolution and Deconvolution Numerical Methods in TEM Convolution and Deconvolution Christoph T. Koch Max Planck Institut für Metallforschung http://hrem.mpi-stuttgart.mpg.de/koch/vorlesung Applications of Convolution in TEM Smoothing

More information

Why does a lower resolution image still make sense to us? What do we lose? Image:

Why does a lower resolution image still make sense to us? What do we lose? Image: 2D FREQUENCY DOMAIN The slides are from several sources through James Hays (Brown); Srinivasa Narasimhan (CMU); Silvio Savarese (U. of Michigan); Bill Freeman and Antonio Torralba (MIT), including their

More information

Gaussian Basics Random Processes Filtering of Random Processes Signal Space Concepts

Gaussian Basics Random Processes Filtering of Random Processes Signal Space Concepts White Gaussian Noise I Definition: A (real-valued) random process X t is called white Gaussian Noise if I X t is Gaussian for each time instance t I Mean: m X (t) =0 for all t I Autocorrelation function:

More information

Suppose we have a one-dimensional discrete signal f(x). The convolution of f with a kernel g is defined as h(x) = f(x)*g(x) = w 1. f(i)g(x i), (3.

Suppose we have a one-dimensional discrete signal f(x). The convolution of f with a kernel g is defined as h(x) = f(x)*g(x) = w 1. f(i)g(x i), (3. Chapter 3 Image filtering Filtering an image involves transforming the values of the pixels by taking into account the values of the neighboring pixels. Filtering is a basic concept of signal and image

More information

Digital Image Processing. Chapter 4: Image Enhancement in the Frequency Domain

Digital Image Processing. Chapter 4: Image Enhancement in the Frequency Domain Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain Image Enhancement in Frequency Domain Objective: To understand the Fourier Transform and frequency domain and how to apply

More information

Chapter 16. Local Operations

Chapter 16. Local Operations Chapter 16 Local Operations g[x, y] =O{f[x ± x, y ± y]} In many common image processing operations, the output pixel is a weighted combination of the gray values of pixels in the neighborhood of the input

More information

Recap of Monday. Linear filtering. Be aware of details for filter size, extrapolation, cropping

Recap of Monday. Linear filtering. Be aware of details for filter size, extrapolation, cropping Recap of Monday Linear filtering h[ m, n] k, l f [ k, l] I[ m Not a matrix multiplication Sum over Hadamard product k, n l] Can smooth, sharpen, translate (among many other uses) 1 1 1 1 1 1 1 1 1 Be aware

More information

Linear Diffusion. E9 242 STIP- R. Venkatesh Babu IISc

Linear Diffusion. E9 242 STIP- R. Venkatesh Babu IISc Linear Diffusion Derivation of Heat equation Consider a 2D hot plate with Initial temperature profile I 0 (x, y) Uniform (isotropic) conduction coefficient c Unit thickness (along z) Problem: What is temperature

More information