chapter 3- gonzalez

25
Digital Image Processing Using MATLAB ® Chapter 3 Intensity Transformations and Spatial Filtering (,) [ (, )] gxy T fxy • 3.1 Background

Upload: andrei-chih

Post on 10-Apr-2016

55 views

Category:

Documents


1 download

DESCRIPTION

Intensity Transformationsand Spatial Filtering using matlab software

TRANSCRIPT

Page 1: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

( , ) [ ( , )]g x y T f x y• 3.1 Background

Page 2: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering• 3.2 Intensity transformation functions

– Simplest: voxel-wise operator (1x1 mask)

( , ) [ ( , )] ( )g x y T f x y s T r

g=imadjust(f,[low_in, high_in], [low_out, high_out, gamma])

Page 3: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®Some Intensity Transformation Functions

Page 4: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®Power–Law (Gamma) transformation

s = crγ, c,γ –positive constantscurve the grayscale components either to brighten the

intensity (when γ< 1) or darken the intensity (when γ > 1).

Page 5: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®Power –Law (Gamma) transformation

Page 6: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 7: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering• 3.2 Intensity transformation functions (cont)

– Logarithmic transformation of intensities– Contrast stretching 1( )

1Es T r

mr

g = 1 ./ (1 + (m ./ (double(f) + eps )) .^ E);

Page 8: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Contrast stretchingContrast stretching is a process that expands the range of intensity

levels in a image so that it spans the full intensity range of the recording medium or

display device.Contrast-stretching transformations increase the contrast between the

darks and the lights

Page 9: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Thresholding function

Page 10: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Intensity-level slicingHighlighting a specific range of gray levels in an

image

Page 11: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 12: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Histogram processingThe histogram of a digital image

with gray levels in the range [0, L-1] is

a discretefunction h(rk)=nk , where rk is the

kth gray level and nk is the number of

pixels in the image having gray level rk. It is common practice to

normalize a histogram by dividing each of its

values by the total number of pixels in the

image, denoted by the product MN.

Thus, a normalized histogram is given by h(rk)=nk/MN

The sum of all components of anormalized histogram is equal to

1.

Page 13: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Histogram Equalization Histogram equalization can be used to improve the visual

appearance of an image.

Histogram equalization automatically determines a transformation function that produce and output image that has a near uniform histogram

Page 14: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Page 15: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Histogram EqualizationLet rk, k[0..L-1] be intensity levels and let

p(rk) be its normalized histogram function.The intensity transformation function for

histogram equalization is

k

jj

k

jjrkk

LknMNL

rpLrTs

0

0

1,...,2,1,0,1

)()1()(

Page 16: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

g=histeq (f, nlev)

Page 17: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 18: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 19: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 20: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 21: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

g=imfilter (f, w, filtering_mode, boundary_opts, size_opts)

Page 22: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 23: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformationsand Spatial Filtering

w=fspecial (type , [params])

Page 24: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering

Page 25: Chapter 3- Gonzalez

Digital Image Processing Using MATLAB®

Chapter 3Intensity Transformations

and Spatial Filtering