Chapter 3: Intensity Transformations and Spatial Filtering

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

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

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

Image Enhancement in Spatial Domain (Chapter 3)

Image Enhancement: To improve the quality of images

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

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

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

Intensity Transformations and Spatial Filtering

Lecture 4 Image Enhancement in Spatial Domain

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

Digital Image Processing

Sampling and Reconstruction

EE795: Computer Vision and Intelligent Systems

UNIT - 5 IMAGE ENHANCEMENT IN SPATIAL DOMAIN

Chapter 3 Image Enhancement in the Spatial Domain

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

Intensity Transformation and Spatial Filtering

Lecture 4. Digital Image Enhancement. 1. Principle of image enhancement 2. Spatial domain transformation. Histogram processing

In this lecture. Background. Background. Background. PAM3012 Digital Image Processing for Radiographers

Image Enhancement in Spatial Domain. By Dr. Rajeev Srivastava

Filtering and Enhancing Images

Introduction to Digital Image Processing

Introduction to Digital Image Processing

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

Lecture 4: Spatial Domain Transformations

IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Point and Spatial Processing

1.Some Basic Gray Level Transformations

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

ECG782: Multidimensional Digital Signal Processing

Biomedical Image Analysis. Spatial Filtering

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Digital Image Analysis and Processing

Sharpening through spatial filtering

Chapter - 2 : IMAGE ENHANCEMENT

ECG782: Multidimensional Digital Signal Processing

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

Digital Image Processing. Image Enhancement - Filtering

SYDE 575: Introduction to Image Processing

Digital Image Processing

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

Basic relations between pixels (Chapter 2)

Point operation Spatial operation Transform operation Pseudocoloring

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

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

Digital Image Processing. Lecture # 3 Image Enhancement

Selected Topics in Computer. Image Enhancement Part I Intensity Transformation

IMAGE ENHANCEMENT in SPATIAL DOMAIN by Intensity Transformations

Chapter4 Image Enhancement

Point Operations and Spatial Filtering

Image Processing Lecture 10

IMAGING. Images are stored by capturing the binary data using some electronic devices (SENSORS)

C2: Medical Image Processing Linwei Wang

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

Digital Image Processing

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

Digital Image Processing

An introduction to image enhancement in the spatial domain.

Point Operations. Prof. George Wolberg Dept. of Computer Science City College of New York

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

Digital Image Processing

Lecture 6: Edge Detection

Digital Image Processing

Unit - I Computer vision Fundamentals

Lecture 3 - Intensity transformation

Histograms. h(r k ) = n k. p(r k )= n k /NM. Histogram: number of times intensity level rk appears in the image

Digital Image Fundamentals

Edge and local feature detection - 2. Importance of edge detection in computer vision

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]

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

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

Digital Image Processing, 3rd ed. Gonzalez & Woods

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

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

Basic Algorithms for Digital Image Analysis: a course

Lecture 4: Image Processing

Digital Image Processing. Image Enhancement (Point Processing)

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

x' = c 1 x + c 2 y + c 3 xy + c 4 y' = c 5 x + c 6 y + c 7 xy + c 8

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

PSD2B Digital Image Processing. Unit I -V

Chapter 10: Image Segmentation. Office room : 841

3.3 Histogram Processing(page 142) h(r k )=n k. p(r k )=1

Motivation. Intensity Levels

EECS490: Digital Image Processing. Lecture #19

Neighbourhood Operations

3 Image Enhancement in the Spatial Domain

Digital Image Processing, 3rd ed.

Image Restoration and Reconstruction

Broad field that includes low-level operations as well as complex high-level algorithms

CoE4TN4 Image Processing. Chapter 5 Image Restoration and Reconstruction

Lecture No Image Enhancement in SpaPal Domain (course: Computer Vision)

Filtering Images. Contents

Fall 2015 Dr. Michael J. Reale

Topic 4 Image Segmentation

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

Lecture #5. Point transformations (cont.) Histogram transformations. Intro to neighborhoods and spatial filtering

Image Restoration and Reconstruction

Transcription:

Chapter 3: Intensity Transformations and Spatial Filtering 3.1 Background 3.2 Some basic intensity transformation functions 3.3 Histogram processing 3.4 Fundamentals of spatial filtering 3.5 Smoothing spatial filters 3.6 Sharpening spatial filters Chapter 3. R.C. Gonzalez & R.E. Woods 1

Preview Spatial domain processing: direct manipulation of pixels in an image Two categories of spatial (domain) processing Intensity transformation: - Operate on single pixels - Contrast manipulation, image thresholding Spatial filtering - Work in a neighborhood of every pixel in an image - Image smoothing, image sharpening Chapter 3. R.C. Gonzalez & R.E. Woods 2

3.1 Background Spatial domain methods: operate directly on pixels Spatial domain processing g(x,y) = T[f(x, y)] f(x, y): input image g(x, y): output (processed) image T: operator Operator T is defined over a neighborhood of point (x, y) Chapter 3. R.C. Gonzalez & R.E. Woods 3

3.1 Background Spatial filtering For any location (x,y), output image g(x,y) is equal to the result of applying T to the neighborhood of (x,y) in f Filter: mask, kernel, template, window Chapter 3. R.C. Gonzalez & R.E. Woods 4

3.1 Background The simplest form of T: g depends only on the value of f at (x, y) T becomes intensity (gray-level) transformation function s = T(r) r: intensity of f(x,y) s: intensity of g(x,y) Point processing: enhancement at any point depends only on the gray level at that point Chapter 3. R.C. Gonzalez & R.E. Woods 5

3.1 Background Point processing (a) Contrast stretching Values of r below k are compressed into a narrow range of s (b) Thresholding Chapter 3. R.C. Gonzalez & R.E. Woods 6

3.2 Some Basic Intensity Transformation Functions r: pixel value before processing s: pixel value after processing T: transformation s = T(r) 3 types Linear (identity and negative transformations) Logarithmic (log and inverse-log transformations) Power-law(nth power and nth root transformations) Chapter 3. R.C. Gonzalez & R.E. Woods 7

3.2 Some Basic Gray Level Transformations Chapter 3. R.C. Gonzalez & R.E. Woods 8

3.2.1 Image Negatives Negative of an image with gray level [0, L-1] s = L 1 r Enhancing white or gray detail embedded in dark regions of an image Chapter 3. R.C. Gonzalez & R.E. Woods 9

3.2.2 Log Transformations General form of log transformation s = c log(1+r) c: constant, r 0 This transformation maps a narrow range of low gray-level values in the input image into a wider range of output levels Classical application of log transformation: Display of Fourier spectrum Chapter 3. R.C. Gonzalez & R.E. Woods 10

3.2.2 Log Transformations (a) Original Fourier spectrum: 0 ~ 1,500,000 range scaled to 0 ~ 255 (b) Result of log transformation: 0 ~ 6.2 range scaled to 0 ~ 255 Chapter 3. R.C. Gonzalez & R.E. Woods 11

3.2.3 Power-Law Transformations Chapter 3. R.C. Gonzalez & R.E. Woods 12

3.2.3 Power-Law Transformations Basic form of power-law transformations s = c r γ c, γ : positive constants Gamma correction: process of correcting this power-law response Example: cathode ray tube (CRT) Intensity to voltage response is power function with exponent (γ) 1.8 to 2.5 Solution: preprocess the input image by performing transformation s = r 1/2.5 = r 0.4 Chapter 3. R.C. Gonzalez & R.E. Woods 13

3.2.3 Power-Law Transformations CRT monitor gamma correction example Chapter 3. R.C. Gonzalez & R.E. Woods 14

3.2.3 Power-Law Transformations MRI gamma correction example original γ = 0.6 γ = 0.4 γ = 0.3 Chapter 3. R.C. Gonzalez & R.E. Woods 15

3.2.3 Power-Law Transformations Arial image gamma correction example original γ = 3.0 γ = 4.0 γ = 5.0 Chapter 3. R.C. Gonzalez & R.E. Woods 16

3.2.4 Piecewise-Linear Transformation Functions Contrast stretching Low contrast image Piecewise linear function Result of contrast stretching Result of thresholding Chapter 3. R.C. Gonzalez & R.E. Woods 17

3.2.4 Piecewise-Linear Transformation Functions Contrast stretching (c) Contrast stretching (r 1, s 1 ) = (r min, 0), (r 2, s 2 ) = (r max, L-1) r min, r max : minimum, maxmum level of image (d) Thresholding: r 1 = r 2 = m, s 1 = 0, s 2 = L-1 m: mean gray level Chapter 3. R.C. Gonzalez & R.E. Woods 18

3.2.4 Piecewise-Linear Transformation Functions Intensity-level slicing Chapter 3. R.C. Gonzalez & R.E. Woods 19

3.2.4 Piecewise-Linear Transformation Functions Intensity-level slicing (a) Display a high value for all gray levels in the range of interest, and a low value for all other images - produces binary image (b) Brightens the desired range of gray levels but preserves the background and other parts Chapter 3. R.C. Gonzalez & R.E. Woods 20

3.2.4 Piecewise-Linear Transformation Functions Intensity-level slicing Chapter 3. R.C. Gonzalez & R.E. Woods 21

3.2.4 Piecewise-Linear Transformation Functions Bit-plane slicing Chapter 3. R.C. Gonzalez & R.E. Woods 22

3.2.4 Piecewise-Linear Transformation Functions Bit-plane slicing Chapter 3. R.C. Gonzalez & R.E. Woods 23

3.2.4 Piecewise-Linear Transformation Functions Bit-plane slicing (a) Multiply bit plane 8 by 128 Multiply bit plane 7 by 64 Add the results of two planes Chapter 3. R.C. Gonzalez & R.E. Woods 24

3.3 Histogram Processing The histogram of digital image with gray levels in the range [0, L-1] is a discrete function h(r k ) = n k r k : kth gray level n k : number of pixels in image having gray levels r k Normalized histogram p(r k ) = n k /n n: total number of pixels in image n = MN (M: row dimension, N: column dimension) Chapter 3. R.C. Gonzalez & R.E. Woods 25

3.3 Histogram Processing Histogram horizonal axis: r k (kth intensity value) vertical axis: n k : number of pixels, or n k /n: normalized number Chapter 3. R.C. Gonzalez & R.E. Woods 26

3.3.1 Histogram Equalization r: intensities of the image to be enhanced r is in the range [0, L-1] r = 0: black, r = L-1: white s: processed gray levels for every pixel value r s = T(r), 0 r L-1 Requirements of transformation function T (a) T(r) is a (strictly) monotonically increasing in the interval 0 r L-1 (b) 0 T(r) L-1 for 0 r L-1 Inverse transformation r = T -1 (s), 0 s L-1 Chapter 3. R.C. Gonzalez & R.E. Woods 27

3.3.1 Histogram Equalization Intensity transformation function Chapter 3. R.C. Gonzalez & R.E. Woods 28

3.3.1 Histogram Equalization Intensity levels: random variable in interval [0, L-1] p () s p () r s r dr ds probability density function (PDF) s Tr () ( L 1) pr ( wdw ) r 0 cumulative distribution function (CDF) ds dt () r d r ( L 1) [ p ( ) ] ( 1) ( ) 0 r w dw L pr r dr dr dr dr 1 1 ps() s pr() r pr() r ds ( L 1) p ( r ) L 1 r 0 s L 1 Uniform probability density function Chapter 3. R.C. Gonzalez & R.E. Woods 29

3.3.1 Histogram Equalization Chapter 3. R.C. Gonzalez & R.E. Woods 30

3.3.1 Histogram Equalization nk pr( rk) k 0,1,2,..., L 1 MN MN: total number of pixels in image n k : number of pixels having gray level r k L: total number of possible gray levels k L 1 k s Tr ( ) ( L 1) p( r) n k 0,1,2,.., L 1 k k r j j j 0 MN j 0 histogram equalization (histogram linearization): Processed image is obtained by mapping each pixel r k (input image) into corresponding level s k (output image) Chapter 3. R.C. Gonzalez & R.E. Woods 31

3.3.1 Histogram Equalization Chapter 3. R.C. Gonzalez & R.E. Woods 32

3.3.1 Histogram Equalization Histogram equalization from dark image (1) Histogram equalization from light image (2) Histogram equalization from low contrast image (3) Histogram equalization from high contrast image (4) Chapter 3. R.C. Gonzalez & R.E. Woods 33

3.3.1 Histogram Equalization Transformation functions Chapter 3. R.C. Gonzalez & R.E. Woods 34

3.3.3 Local Histogram Processing Histogram processing methods in previous section are global Global methods are suitable for overall enhancement Histogram processing techniques are easily adapted to local enhancement Example (b) Global histogram equalization Considerable enhancement of noise (c) Local histogram equalization using 7x7 neighborhood Reveals (enhances) the small squares inside the dark squares Contains finer noise texture Chapter 3. R.C. Gonzalez & R.E. Woods 35

3.3.3 Local Histogram Processing Original image Global histogram equalized image Local histogram equalized image Chapter 3. R.C. Gonzalez & R.E. Woods 36

3.3.4 Use of Histogram Statistics for Image Enhancement r: discrete random variable representing intensity values in the range [0, L-1] p(r i ): normalized histogram component corresponding to value r i L 1 n n r ri m p ri i 0 () ( ) ( ) 2 L 1 m rip( ri) i 0 L 1 () r ( r m) p( r) i 0 i 2 i nth moment of r mean (average) value of r variance of r, б 2 (r) m 1 M 1N 1 f( x, y) sample mean MN x 0 y 0 1 MN M 1N 1 2 2 x 0 y 0 [ f ( x, y) m] sample variance Chapter 3. R.C. Gonzalez & R.E. Woods 37

3.3.4 Use of Histogram Statistics for Image Enhancement Global mean and variance are measured over entire image Used for gross adjustment of overall intensity and contrast Local mean and variance are measured locally Used for local adjustment of local intensity and contrast (x,y): coordinate of a pixel S xy : neighborhood (subimage), centered on (x,y) r 0,, r L-1 : L possible intensity values p Sxy : histogram of pixels in region S xy L 1 m r p ( r) Sxy i Sxy i i 0 L 1 2 2 S r xy i ms p xy S r xy i i 0 ( ) ( ) local mean local variance Chapter 3. R.C. Gonzalez & R.E. Woods 38

3.3.4 Use of Histogram Statistics for Image Enhancement A measure whether an area is relatively light or dark at (x,y) Compare the local average gray level m Sxy to the global mean m G (x,y) is a candidate for enhancement if m Sxy k 0 m G Enhance areas that have low contrast Compare the local standard deviation б Sxy to the global standard deviation б G (x,y) is a candidate for enhancement if б Sxy k 2 б G Restrict lowest values of contrast (x,y) is a candidate for enhancement if k 1 б G б Sxy Enhancement is processed simply multiplying the gray level by a constant E gxy (, ) E f( x, y) if m k m AND k k xy xy f( x, y) otherwise S 0 G 1 G S 2 G Chapter 3. R.C. Gonzalez & R.E. Woods 39

3.3.4 Use of Histogram Statistics for Image Enhancement Problem: enhance dark areas while leaving the light area as unchanged as possible E = 4.0, k 0 = 0.4, k 1 = 0.02, k 2 = 0.4, Local region (neighborhood) size: 3x3 Chapter 3. R.C. Gonzalez & R.E. Woods 40

3.4 Fundamentals of Spatial Filtering Operations with the values of the image pixels in the neighborhood and the corresponding values of subimage Subimage: filter, mask, kernel, template, window Values in the filter subimage: coefficient Spatial filtering operations are performed directly on the pixels of an image One-to-one correspondence between linear spatial filters and filters in the frequency domain Chap.3 Intensity Transformations and Spatial Filtering 41 Konkuk University, C. Yim

3.4.1 Mechanics of Spatial Filtering A spatial filter consists of (1) a neighborhood (typically a small rectangle) (2) a predefined operation A processed (filtered) image is generated as the center of the filter visits each pixel in the input image Linear spatial filtering using 3x3 neighborhood At any point (x,y), the response, g(x,y), of the filter g(x,y) = w(-1,-1)f(x-1,y-1) + w(-1,0)f(x-1,y) + + w(0,0)f(x,y) + + w(1,0)f(x+1,y) + w(1,1)f(x+1,y+1) Chap.3 Intensity Transformations and Spatial Filtering 42 Konkuk University, C. Yim

3.4.1 Mechanics of Spatial Filtering Chap.3 Intensity Transformations and Spatial Filtering 43 Konkuk University, C. Yim

3.4.1 Mechanics of Spatial Filtering Filtering of an image f with a filter w of size m x n a = (m-1) / 2, b = (n-1) / 2 or m = 2a+1, n = 2b+1 (a, b: positive integer) a b g( x, y) wst (, ) f ( x s, y t) s at b Chap.3 Intensity Transformations and Spatial Filtering 44 Konkuk University, C. Yim

3.4.2 Spatial Correlation and Convolution Chap.3 Intensity Transformations and Spatial Filtering 45 Konkuk University, C. Yim

3.4.2 Spatial Correlation and Convolution Chap.3 Intensity Transformations and Spatial Filtering 46 Konkuk University, C. Yim

3.4.2 Spatial Correlation and Convolution Correlation of a filter w(x,y) of size m x n with an image f(x,y) a b g( x, y) wst (, ) f ( x s, y t) s at b Convolution of w(x,y) and f(x,y) a b g( x, y) wst (, ) f ( x s, y t) s at b Chap.3 Intensity Transformations and Spatial Filtering 47 Konkuk University, C. Yim

3.4.3 Vector Representation of Linear Filtering Linear spatial filtering by m x n filter R w z w z w z wz 1 1 2 2 mn mn mn i i i 1 T w z Linear spatial filtering by 3 x 3 filter 1 1 2 2 9 9 9 R w z w z w z wz i 1 i i T w z Chap.3 Intensity Transformations and Spatial Filtering 48 Konkuk University, C. Yim

3.4.3 Vector Representation of Linear Filtering Spatial filtering at the border of an image Limit the center of the mask no less than (n-1)/2 pixels from the border -> Smaller filtered image Padding -> Effect near the border Adding rows and columns of 0 s Replicating rows and columns Chap.3 Intensity Transformations and Spatial Filtering 49 Konkuk University, C. Yim

3.4.4 Generating Spatial Filter Masks Linear spatial filtering by 3 x 3 filter 9 1 1 2 2 9 9 i 1 R w z w z w z wz Average value in 3 x 3 neighborhood R 1 9 9 i 1 Gaussian function z i i i 2 2 x y 2 hxy (, ) e 2 Chap.3 Intensity Transformations and Spatial Filtering 50 Konkuk University, C. Yim

3.5 Smoothing Spatial Filters Linear spatial filters for smoothing: averaging filters, lowpass filters Noise reduction Undesirable side effect: blur edges standard average weighted average Chap.3 Intensity Transformations and Spatial Filtering 51 Konkuk University, C. Yim

3.5.1 Smoothing Linear Filters Standard averaging by 3x3 filter R 1 9 9 i 1 z i Weighted averaging Reduce blurring compared to standard averaging General implementation for filtering with a weighted averaging filter of size m x n (m=2a+1, n=2b+1) gxy (, ) a b s at b wst (,) f ( x s, y t) a b s at b wst (,) Chap.3 Intensity Transformations and Spatial Filtering 52 Konkuk University, C. Yim

3.5.1 Smoothing Linear Filters Result of smoothing with square averaging filter masks Original m=3 m=5 m=9 m=15 m=35 Chap.3 Intensity Transformations and Spatial Filtering 53 Konkuk University, C. Yim

3.5.1 Smoothing Linear Filters Application example of spatial averaging Original 15x15 averaging Result of thresholding Chap.3 Intensity Transformations and Spatial Filtering 54 Konkuk University, C. Yim

3.5.2 Order-Statistic (Nonlinear) Filters Order-statistic filters are nonlinear spatial filters whose response is based on ordering (ranking) the pixels Median filter Replaces the pixel value by the median of the gray levels in the neighborhood of that pixel Effective for impulse noise (salt-and-pepper noise) Isolated clusters of pixels that are light or dark with respect to their neighbors, and whose area is less than n 2 /2, are eliminated by an n x n median filter Median 3x3 neighborhood: 5th largest value 5x5 neighborhood: 13th largest value Max filter: select maximum value in the neighborhood Min filter: select minimum value in the neighborhood Chap.3 Intensity Transformations and Spatial Filtering 55 Konkuk University, C. Yim

3.5.2 Order-Statistic (Nonlinear) Filters Chap.3 Intensity Transformations and Spatial Filtering 56 Konkuk University, C. Yim

3.6 Sharpening Spatial Filters Objective of sharpening: highlight fine detail to enhance detail that has been blurred Image blurring can be accomplished by digital averaging Digital averaging is similar to spatial integration Image sharpening can be done by digital differentiation Digital differentiation is similar to spatial derivative Image differentiation enhances edges and other discontinuities Chap.3 Intensity Transformations and Spatial Filtering 57 Konkuk University, C. Yim

3.6.1 Foundation Image sharpening by first- and second-order derivatives Derivatives are defined in terms of differences Requirement of first derivative 1) Must be zero in flat areas 2) Must be nonzero at the onset (start) of step and ramp 3) Must be nonzero along ramps Requirement of second derivative 1) Must be zero in flat areas 2) Must be nonzero at the onset (start) of step and ramp 3) Must be zero along ramps of constant slope Chap.3 Intensity Transformations and Spatial Filtering 58 Konkuk University, C. Yim

3.6.1 Foundation f x ( x) f( x 1) f( x) first-order derivative f x ( x 1) f( x) f( x 1) 2 f f ( x 1) f( x 1) 2 f( x) 2 x second-order derivative Chap.3 Intensity Transformations and Spatial Filtering 59 Konkuk University, C. Yim

3.6.1 Foundation Chap.3 Intensity Transformations and Spatial Filtering 60 Konkuk University, C. Yim

3.6.1 Foundation At the ramp First-order derivative is nonzero along the ramp Second-order derivative is zero along the ramp Second-order derivative is nonzero only at the onset and end of the ramp At the step Both the first- and second-order derivatives are nonzero Second-order derivative has a transition from positive to negative (zero crossing) Some conclusions First-order derivatives generally produce thicker edges Second-order derivatives have stronger response to fine detail First-order derivatives generally produce stronger response to gray-level step Second-order derivatives produce a double response at step Chap.3 Intensity Transformations and Spatial Filtering 61 Konkuk University, C. Yim

3.6.2 Use of Second Derivatives for Enhancement Isotropic filters: rotation invariant Simplest isotropic second-order derivative operator: Laplacian 2 2 2 f f f 2 2 x y 2-D Laplacian operation 2 f f ( x 1, y) f( x 1, y) 2 f( x, y) 2 x x-direction 2 f f ( xy, 1) f( xy, 1) 2 f( xy, ) 2 y y-direction 2 f ( x, y) [ f( x 1, y) f( x 1, y) f( x, y 1) f( x, y 1)] 4 f( x, y) Chap.3 Intensity Transformations and Spatial Filtering 62 Konkuk University, C. Yim

3.6.2 Use of Second Derivatives for Enhancement 4 neighbors negative center coefficient 8 neighbors negative center coefficient 4 neighbors positive center coefficient 8 neighbors positive center coefficient Chap.3 Intensity Transformations and Spatial Filtering 63 Konkuk University, C. Yim

3.6.2 Use of Second Derivatives for Enhancement Image enhancement (sharpening) by Laplacian operation gxy (, ) 2 f( x, y) f( x, y) if the center coefficient of the Laplacian mask is negative 2 f( x, y) f( x, y) if the center coefficient of the Laplacian mask is positive Simplification g( x, y) f( x, y) [ f( x 1, y) f( x 1, y) f( x, y 1) f( x, y 1)] 4 f( x, y) 5 f( x, y) [ f( x 1, y) f( x 1, y) f( x, y 1) f( x, y 1)] Chap.3 Intensity Transformations and Spatial Filtering 64 Konkuk University, C. Yim

3.6.2 Use of Second Derivatives for Enhancement Chap.3 Intensity Transformations and Spatial Filtering 65 Konkuk University, C. Yim

3.6.3 Unsharp Masking and Highboost Filtering g ( x, y) f( x, y) f ( x, y) mask original image blurred image g( x, y) f( x, y) k g ( x, y) mask When k=1, unsharp masking When k > 1, highboost filtering Chap.3 Intensity Transformations and Spatial Filtering 66 Konkuk University, C. Yim

3.6.3 Unsharp Masking and Highboost Filtering Chap.3 Intensity Transformations and Spatial Filtering 67 Konkuk University, C. Yim

3.6.3 Unsharp Masking and Highboost Filtering Chap.3 Intensity Transformations and Spatial Filtering 68 Konkuk University, C. Yim

3.6.4 Using First-Order Derivatives for Image Sharpening First derivatives in image processing is implemented using the magnitude of the gradient f gx x f grad( f) g f y y gradient of f at (x,y) 2 2 1/2 x y 2 1/2 M( x, y) mag( f) [ g g ] 2 f f x y magnitude of gradient (, ) x y M xy g g Approximation of magnitude of gradient by absolute values Chap.3 Intensity Transformations and Spatial Filtering 69 Konkuk University, C. Yim

3.6.4 Using First-Order Derivatives for Image Sharpening 3x3 region Roberts operators Sobel operators Chap.3 Intensity Transformations and Spatial Filtering 70 Konkuk University, C. Yim

3.6.4 Using First-Order Derivatives for Image Sharpening Simplest approximation to first-order derivative g ( z z ) and g ( z z ) x 8 5 y 6 5 Roberts cross-gradient operators g ( z z ) and g ( z z ) x 9 5 y 8 6 2 2 1/2 2 2 1/2 x y 9 5 8 6 M( x, y) [ g g ] [( z z ) ( z z ) ] M ( xy, ) gx gy z z z z 9 5 8 6 Chap.3 Intensity Transformations and Spatial Filtering 71 Konkuk University, C. Yim

3.6.4 Using First-Order Derivatives for Image Sharpening Sobel operators gx ( z7 2 z8 z9) ( z1 2 z2 z3) and g ( z 2 z z ) ( z 2 z z ) y 3 6 9 1 4 7 M( x, y) gx gy ( z7 2 z8 z9) ( z1 2 z2 z3) +( z 2 z z ) ( z 2 z z ) 3 6 9 1 4 7 Chap.3 Intensity Transformations and Spatial Filtering 72 Konkuk University, C. Yim

3.6.4 Using First-Order Derivatives for Image Sharpening Optical image of contact lens Sobel gradient Chap.3 Intensity Transformations and Spatial Filtering 73 Konkuk University, C. Yim