1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.

Slides:



Advertisements
Similar presentations
Neighborhood Processing
Advertisements

Spatial Filtering (Chapter 3)
Lecture 6 Sharpening Filters
© by Yu Hen Hu 1 ECE533 Digital Image Processing Image Enhancement in Frequency Domain.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
Filtering in the Spatial Domain Filtering the spatial domain is achieved by convolution Qualitatively: Slide the filter to each position, x, then sum up.
Chapter 4 Image Enhancement in the Frequency Domain.
CHAPTER 4 Image Enhancement in Frequency Domain
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
Digital Image Processing
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Image Enhancement.
2-D, 2nd Order Derivatives for Image Enhancement
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
© 2010 Cengage Learning Engineering. All Rights Reserved.
Chapter 4 Image Enhancement in the Frequency Domain.
Chapter 3 Image Enhancement in the Spatial Domain.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
02/12/02 (c) 2002 University of Wisconsin, CS 559 Filters A filter is something that attenuates or enhances particular frequencies Easiest to visualize.
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
CSC589 Introduction to Computer Vision Lecture 3 Gaussian Filter, Histogram Equalization Bei Xiao.
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
Presentation Image Filters
1 Chapter 8: Image Restoration 8.1 Introduction Image restoration concerns the removal or reduction of degradations that have occurred during the acquisition.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing Image Enhancement Part IV.
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.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
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
Spatial Filtering.
Spatial Filtering (Applying filters directly on Image) By Engr. Muhammad Saqib.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 3 Intensity Transformations.
Image Subtraction Mask mode radiography h(x,y) is the mask.
Sharpening Filters To highlight fine detail or to enhance blurred detail. –smoothing ~ integration –sharpening ~ differentiation Categories of sharpening.
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.
(c) 2002 University of Wisconsin, CS 559
Computer Graphics & Image Processing Chapter # 4 Image Enhancement in Frequency Domain 2/26/20161.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
Digital Image Processing CSC331
M ATLAB L ECTURE 3 Histogram Processing. H ISTOGRAM E QUALIZATION The imhist function create a histogram that show the distribution of intensities in.
Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.
Digital Image Processing Lecture 8: Image Enhancement in Frequency Domain II Naveed Ejaz.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Fundamentals of Spatial Filtering:
ECE 692 – Advanced Topics in Computer Vision
Image Enhancement in the
Digital Image Processing
Image Enhancement in the
Digital Image Processing
Fundamentals of Spatial Filtering
Lecture 3 (2.5.07) Image Enhancement in Spatial Domain
Digital Image Processing
Digital Image Processing Week IV
Image Coding and Compression
© 2010 Cengage Learning Engineering. All Rights Reserved.
Lecture 7 Spatial filtering.
Fundamentals of Spatial Filtering
Image Enhancement in Spatial Domain: Neighbourhood Processing
Presentation transcript:

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

2 © 2010 Cengage Learning Engineering. All Rights Reserved. 5.1 Introduction Move a mask A rectangle (usually with sides of odd length) or other shape over the given image Ch5-p.87

3 5.1 Introduction © 2010 Cengage Learning Engineering. All Rights Reserved. Mask values Ch5-p.88

4 5.1 Introduction © 2010 Cengage Learning Engineering. All Rights Reserved. Corresponding pixel values Ch5-p.88

5 FIGURE 5.2 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.89

6 5.1 Introduction © 2010 Cengage Learning Engineering. All Rights Reserved. Allied to spatial filtering is spatial convolution The filter must be rotated by 180° before multiplying and adding Ch5-p.89

7 5.1 Introduction © 2010 Cengage Learning Engineering. All Rights Reserved. EXAMPLE One important linear filter is to use a 3×3 mask and take the average of all nine values within the mask Ch5-p.90

8 5.1 Introduction © 2010 Cengage Learning Engineering. All Rights Reserved. The result of filtering x with 3×3 averaging filter Ch5-p.90

9 5.2 Notation © 2010 Cengage Learning Engineering. All Rights Reserved. It is convenient to describe a linear filter simply in terms of the coefficients of all the gray values of pixels within the mask The averaging filter Ch5-p.91-92

Notation © 2010 Cengage Learning Engineering. All Rights Reserved. EXAMPLE The filter would operate on gray values as Ch5-p.92

Edges of the Image © 2010 Cengage Learning Engineering. All Rights Reserved. What happens at the edge of the image, where the mask partly falls outside the image? There are a number of different approaches to dealing with this problem Ch5-p.92

Edges of the Image © 2010 Cengage Learning Engineering. All Rights Reserved. Ignore the edges Pad with zeros Ch5-p.92

Edges of the Image © 2010 Cengage Learning Engineering. All Rights Reserved. Mirroring Ch5-p.93

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. filter2 function shape is optional; it describes the method for dealing with the edges ‘same’- pad with zeros ‘valid’- ignore the edges the result is a matrix of data type double!! Ch5-p.93

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.93

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.94

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. The result of ’same’ may also be obtained by padding with zeros and using ’valid’: Ch5-p.94

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. filter2(filter,image,’full’) returns a result larger than the original It does this by padding with zero and applying the filter at all places on and around the image where the mask intersects the image matrix Ch5-p.94

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.94

Filtering in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. filter2 provides no mirroring option The mirroring approach can be realized by placing the following codes before filter2 (filter,image,’valid’) Ch5-p.95

21 © 2010 Cengage Learning Engineering. All Rights Reserved. 5.3 Filtering in M ATLAB Where matrix x is extended to m_x, wr/wc is defined as one half total column/row number of the mask (chopping the decimal) Ch5-p.95

22 © 2010 Cengage Learning Engineering. All Rights Reserved. 5.3 Filtering in M ATLAB fspecial function h = fspecial(type, parameters) >>imshow(uint8(cf1)) >>imshow(cf1/255) or Ch5-p.95

23 FIGURE 5.4 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.97

Frequencies: Low- and High-Pass Filters © 2010 Cengage Learning Engineering. All Rights Reserved. Frequencies of an image are a measure of the amount by which gray values change with distance high-pass filter low-pass filter Ch5-p.98

Frequencies: Low- and High-Pass Filters © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.99

26 FIGURE 5.5 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.100

Frequencies: Low- and High-Pass Filters © 2010 Cengage Learning Engineering. All Rights Reserved. VALUES OUTSIDE THE RANGE 0–255 Make negative values positive Clip values Ch5-p.100

Frequencies: Low- and High-Pass Filters © 2010 Cengage Learning Engineering. All Rights Reserved Scaling transformation (uint8) Ch5-p.101

29 © 2010 Cengage Learning Engineering. All Rights Reserved. 5.4 Frequencies: Low- and High-Pass Filters 0-1 Scaling transformation (double) Ch5-p

30 © 2010 Cengage Learning Engineering. All Rights Reserved. FIGURE 5.6 Ch5-p.102

Gaussian Filters © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.103

32 FIGURE 5.8 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.104

Gaussian Filters © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.104

34 FIGURE 5.9 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.105

Edge Sharpening © 2010 Cengage Learning Engineering. All Rights Reserved Unsharp Masking Ch5-p.106

36 FIGURE 5.11 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.107

37 FIGURE 5.12 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.107

Unsharp Masking © 2010 Cengage Learning Engineering. All Rights Reserved. The unsharp option of fspecial produces such filters α = 0.5 Ch5-p.108

39 FIGURE 5.13 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.109

High-Boost Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. Allied to unsharp masking filters are the high- boost filters where A is an amplification factor If A = 1, then the high-boost filter becomes an ordinary high-pass filter Ch5-p.109

High-Boost Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.111

42 FIGURE 5.14 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.111 >> x1=filter2(hb1, x); >> imshow(x1/255) >> x2=filter2(hb2, x); >> imshow(x2/255)

Nonlinear Filters © 2010 Cengage Learning Engineering. All Rights Reserved. Maximum filter Minimum filter Ch5-p.112

44 FIGURE 5.15 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.113

Region of Interest Processing © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.115

Regions of Interest in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p

Regions of Interest in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. This will bring up the iguana image (if it isn’t shown already). Vertices of the ROI can be selected with the mouse Ch5-p.116

Region of Interest Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.116

49 FIGURE 5.18 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch5-p.117