Image Enhancement in Spatial Domain (Chapter 3)

Similar documents
Chapter 3: Intensity Transformations and Spatial Filtering

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Image Enhancement: To improve the quality of images

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

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

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

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

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

Digital Image Processing

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

Filtering and Enhancing 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

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

Digital Image Processing. Image Enhancement - Filtering

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Image Processing Lecture 10

Lecture 4 Image Enhancement in Spatial Domain

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

Lecture 4: Spatial Domain Transformations

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

Image Enhancement in Spatial Domain. By Dr. Rajeev Srivastava

Sampling and Reconstruction

Introduction to Digital Image Processing

Intensity Transformations and Spatial Filtering

EE795: Computer Vision and Intelligent Systems

Point and Spatial Processing

Basic relations between pixels (Chapter 2)

Digital Image Analysis and Processing

Point operation Spatial operation Transform operation Pseudocoloring

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

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

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

Introduction to Digital Image Processing

UNIT - 5 IMAGE ENHANCEMENT IN SPATIAL DOMAIN

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

Lecture 3 - Intensity transformation

IMAGE ENHANCEMENT in SPATIAL DOMAIN by Intensity Transformations

INTENSITY TRANSFORMATION AND SPATIAL FILTERING

Chapter - 2 : IMAGE ENHANCEMENT

C2: Medical Image Processing Linwei Wang

Sharpening through spatial filtering

Point Operations and Spatial Filtering

Intensity Transformation and Spatial Filtering

Selected Topics in Computer. Image Enhancement Part I Intensity Transformation

Linear Operations Using Masks

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

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

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

Chapter 3 Image Enhancement in the Spatial Domain

Digital Image Procesing

Chapter4 Image Enhancement

CS 490: Computer Vision Image Segmentation: Thresholding. Fall 2015 Dr. Michael J. Reale

Image restoration. Restoration: Enhancement:

Digital Image Processing

Digital Image Processing

Lecture 4: Image Processing

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

Biomedical Image Analysis. Spatial Filtering

IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Basic Algorithms for Digital Image Analysis: a course

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

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

Filtering Images. Contents

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

An introduction to image enhancement in the spatial domain.

ECG782: Multidimensional Digital Signal Processing

Ulrik Söderström 16 Feb Image Processing. Segmentation

Segmentation and Grouping

SYDE 575: Introduction to Image Processing

EECS490: Digital Image Processing. Lecture #22

Review for Exam I, EE552 2/2009

Image Restoration and Reconstruction

Digital Image Processing, 3rd ed. Gonzalez & Woods

Digital Image Processing

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Fall 2015 Dr. Michael J. Reale

CoE4TN4 Image Processing. Chapter 5 Image Restoration and Reconstruction

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

CS4733 Class Notes, Computer Vision

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

Image gradients and edges April 11 th, 2017

Biomedical Image Analysis. Point, Edge and Line Detection

Image gradients and edges April 10 th, 2018

Lecture 6: Edge Detection

1.Some Basic Gray Level Transformations

Digital Image Processing. Week 2

Image Enhancement. Digital Image Processing, Pratt Chapter 10 (pages ) Part 1: pixel-based operations

Other Linear Filters CS 211A

Image Restoration and Reconstruction

Digital Image Fundamentals

Digital Image Processing. Lecture # 3 Image Enhancement

CoE4TN3 Medical Image Processing

Motivation. Gray Levels

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

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Chapter 10 Image Segmentation. Yinghua He

Denoising and Edge Detection Using Sobelmethod

Digital Image Processing

Digital Image Processing. Image Enhancement (Point Processing)

Transcription:

Image Enhancement in Spatial Domain (Chapter 3) Yun Q. Shi shi@njit.edu Fall 11 Mask/Neighborhood Processing ECE643 2 1

Point Processing ECE643 3 Image Negatives S = (L 1) - r (3.2-1) Point processing ECE643 4 2

ECE643 5 Log Transformations s = c log(1 + r) (3.2-2) ECE643 6 3

Power-Law (Gamma) Transformations s = c r γ (3.2-3) ECE643 7 Gamma Correction s = c r γ (3.2-3) ECE643 8 4

Power-Law (Gamma) Transformations s = c r γ (3.2-3) ECE643 9 Power-Law (Gamma) Transformations s = c r γ (3.2-3) ECE643 10 5

Piecewise-Linear Transformation Functions Contrast stretching ECE643 11 Piecewise-Linear Transformation Functions Intensity-level slicing ECE643 12 6

Piecewise-Linear Transformation Functions Intensity-level slicing ECE643 13 Piecewise-Linear Transformation Functions Bit-plane slicing ECE643 14 7

Piecewise-Linear Transformation Functions Bit-plane slicing ECE643 15 Piecewise-Linear Transformation Functions Bit-plane slicing ECE643 16 8

Definition of Histogram The histogram of a digital image having intensity levels [0,L-1] is h(r k )=n k, where r k is the k th intensity value and n k the number of pixels in the image assuming intensity r k. Normalization of histogram: h(r k )/MN (M N is the total number of pixels) Histogram reflects important information about the image. How do gray levels distributed in the image? Still, not one-to-one Important basis for numerous image processing techniques. ECE643 17 Fig. 3.16 Four basic image types: Dark, light, low contract, high contrast, and their corresponding histogram ECE643 18 9

Histogram Equalization Consider for a moment a continuous image, r(x,y), simply r A transform of r as follows: s = T(r), 0 r 1 T is strictly monotonically increasing, hence a one-to-one mapping Then, according to probability theory, we have p s (s) = p r (r) dr/ds If the function T is the CDF of r and is strictly monotonically increasing, then dr/ds = 1/p r (r) according to probability theory, hence p s (s) = 1 This is called histogram equalization. ECE643 19 Histogram Equalization T(r) is non-decreasing T(r) is monotonically increasing ECE643 20 10

Histogram Equalization Analogue case: histogram is exactly equalized ECE643 21 Histogram Equalization: One Example ECE643 22 11

Histogram Equalization: One Example ECE643 23 ECE643 24 12

Histogram Equalization ECE643 25 Histogram Specification Histogram equalization is only one way of manipulating histogram Sometimes, it does not work well Example 3.9 (Figures 3.23 and 3.24) next 2 slides Hence, we would like to work on histogram specification r(x,y): given image having its histogram p(r) z(x,y): desired image with histogram p(z) ECE643 26 13

ECE643 27 ECE643 28 14

ECE643 29 Histogram Specification For given r(x,y), we can do histogram equalization, end up with s(x,y) such that p(s) = CDF of r = T(r). For desired z(x,y), also do histogram equalization, end up with v(x,y) and p(v)=cdf of z = G(z). Note that both s and v are roughly uniformly distributed. Hence, we have z = G -1 [T(r)] For discrete case, we use mapping. ECE643 30 15

Histogram Specification Example 3.8 (continuation of Example 3.5) First, equalization of r and end up with s = T(r) Then, equalization of z, end up with v = G(z) Note that both s and v are (roughly) uniform distributed. Hence, we have z = G -1 [T(r)] This is discrete case, we use mapping. ECE643 31 Histogram Specification Some detail is as follows ECE643 32 16

Histogram Specification ECE643 33 ECE643 34 17

Histogram Specification Done ECE643 35 What is shown in text (3 rd edition) ECE643 36 18

ECE643 37 ECE643 38 19

ECE643 39 Local Histogram Processing Discussed above is Global histogram processing Transformation is based on global histogram Sometimes, this does not work effectively Example 3.10 (Fig. 3.26, the next slide) Hence, we sometimes need local histogram processing - Based on local histogram ECE643 40 20

ECE643 41 Histogram Statistics for Image Enhancement r : intensity value (treated as a random variable) Range of r : [0, L-1] p(r i ) : pdf - normalized histogram n th central moment: µ n (r) = all i (r i - m) n p(r i ) Mean: m = all i r i p(r i ) measure of average intensity Variance: µ 2 (r) = all I (r i - m) 2 p(r i ) measure of contrast Sample mean: m = (1/(M N)) x y f(x,y) Sample variance: σ 2 = (1/(M N)) x y [f(x,y) - m] 2 Sample mean and sample variance always can be found. ECE643 42 21

SEM: Scanning electron microscope for processing refer to the next slide ECE643 43 Parameters used in Figure 3.27 S x,y : a 3x3 neighborhood m Sx,y, σ Sx,y : local mean and local standard deviation m Sx,y compared with M G (global mean) σ Sx,y compared with D G (global standard deviation) g(x,y)= E f(x,y) if m Sx,y k 0 M G & k 1 D G σ Sx,y k 2 D G = f(x,y) otherwise Parameters used in Figure 3.27: E = 4.0, k 0 = 0.4, k 1 = 0.02, k 2 = 0.4 ECE643 44 22

Window operation (filtering) ECE643 45 Window operation (filtering) g(x,y)=w(-1,-1)f(x-1,y-1)+w(-1,0)f(x-1,y)+ +w(0,1)f(x,y)+ +w(1,1)x(x+1,y+1) Spatial filter: linear vs. non-linear Linear spatial filtering: g(x,y) = s=-a to a t=-b to b w(s,t)f(x+s,y+t) where x and y are varied so that each pixel (x,y) in the image has been visited by the window center. ECE643 46 23

Correlation and Convolution ECE643 47 Correlation and Convolution Correlation: w(x,y) g(x,y)= s=-a to a t =-b to b w(s,t)f(x+s,y+t) f(x,y): image w(x,y): linear filter, size m n, m and n are odd numbers a = (m-1)/2, b = (n-1)/2 Convolution: w(x,y)*g(x,y)= s=-a to a t =-b to b w(s,t)f(x-s,y-t) Convolution/Correlation filter, mask, kernal ECE643 48 24

Correlation and Convolution ECE643 49 Vector representation of linear filtering R = k=1 to 9 w k z k = w T z w and z are 9-D vectors w: weights (filter coefficients) z: image intensities encompassed by the mask Normalization: dividing the w T z by the sum of all the nine weights. ECE643 50 25

Average filter (a LPF) R = (1/9) k=1 to 9 z k, i.e., w i = 1/9 for all i. This will lead to image smoothing. ECE643 51 Non-linear filtering Non-linear filtering is also possible. For example: maximum filter. There the maximum value among 9 pixel values is used to replace the central pixel value. Ordered filter will be discussed later. ECE643 52 26

Smoothing Spatial filtering ECE643 53 ECE643 54 27

Threshold = 25% of the highest intensity in (b) (c) shows the largest, brightest objects in image (a) ECE643 55 Order-Statistic Filters Non-linear filtering Median filter Able to remove impulse noise Often called salt-and-pepper noise 50 th percentile of a ranked set of numbers Maximum filter 100 th Minimum filter 0th ECE643 56 28

ECE643 57 Sharpening Spatial Filter 1 st order derivative of a 1-D function f(x) f/ x = f(x+1) f(x) (Suitable for edge detection) 2 nd order derivative of a 1-D function f(x) 2 f/ x 2 = f(x+1) + f(x-1) 2f(x) (Sensitive to change) In both cases, using difference to approximate differentiation. ECE643 58 29

ECE643 59 Laplacian Using 2 nd order derivative for image sharpening Laplacian 2 f (x,y)= 2 f/ x 2 + 2 f/ y 2 2 f/ x 2 = f(x+1,y) + f(x-1,y) 2f(x,y) 2 f/ y 2 = f(x,y+1) + f(x,y-1) 2f(x,y) 2 f (x,y) = f(x+1,y) + f(x-1,y) + f(x,y+1) + f(x,y-1) 4f(x,y) ECE643 60 30

ECE643 61 Recover background The Laplacian highlights intensity discontinuity and de-emphases regions with slowly varying intensities. Background can be recovered while still preserving the sharpening effect by adding the Lapalacian image to the original one: g(x,y) = f(x,y) + c[ 2 f (x,y)] C = 1 or -1 ECE643 62 31

ECE643 63 Gradient Using 1 st order derivative for image sharpening Gradiant f (x,y) = grad(f) = [g x g y ] T = [ f/ x f/ y] T Magnitude of gradient M(x,y) M(x,y) = mag( f) = [(g x ) 2 + g y ) 2 ] (1/2) Gradient image (each element is gradient) In DIP, M(x,y) = mag( f) g x + g y ECE643 64 32

ECE643 65 Gradient Using 1 st order derivative for image sharpening Roberts gradient M(x,y) = mag( f) z 9 - z 5 + z 8 - z 6 Sobel gradient M(x,y) = mag( f) (z 7 + 2z 8 + z 9 ) (z 1 + 2z 2 + z 3 ) + (z 3 + 2z 6 + z 9 ) (z 1 + 2z 4 + z 7 ) ECE643 66 33

ECE643 67 ECE643 68 34

ECE643 69 Illustration of Figure 3.43 Aim: To have more skeletal detail Utilize the Laplacian to highlight fine detail Utilize gradient to enhance prominent edges Use a smoothed version of the gradient image to mask the Laplacian image (hence removing noise in the background) Increase the dynamic range of intensity by using power law ECE643 70 35

Summary Image enhancement in spatial domain Two ways: point-wise and window-wise Smooth, noise removal Sharpening, edge enhancement ECE643 71 36