105
Local Enhancement Local Enhancement Histogram processing methods are Histogram processing methods are global processing, in the sense global processing, in the sense that pixels are modified by a that pixels are modified by a transformation function based on transformation function based on the gray-level content of an entire the gray-level content of an entire image. image. Sometimes, we may need to enhance Sometimes, we may need to enhance details over small areas in an details over small areas in an image, which is called a local image, which is called a local enhancement. enhancement.

Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Embed Size (px)

Citation preview

Page 1: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Local EnhancementLocal Enhancement

Histogram processing methods are Histogram processing methods are global processing, in the sense that global processing, in the sense that pixels are modified by a pixels are modified by a transformation function based on the transformation function based on the gray-level content of an entire gray-level content of an entire image.image.

Sometimes, we may need to enhance Sometimes, we may need to enhance details over small areas in an image, details over small areas in an image, which is called a local enhancement.which is called a local enhancement.

Page 2: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Local EnhancementLocal Enhancement

define a square or rectangular neighborhood and move the define a square or rectangular neighborhood and move the center of this area from pixel to pixel.center of this area from pixel to pixel.

at each location, the histogram of the points in the at each location, the histogram of the points in the neighborhood is computed and either histogram equalization neighborhood is computed and either histogram equalization or histogram specification transformation function is obtained.or histogram specification transformation function is obtained.

another approach used to reduce computation is to utilize another approach used to reduce computation is to utilize nonoverlapping regions, but it usually produces an nonoverlapping regions, but it usually produces an undesirable checkerboard effect.undesirable checkerboard effect.

a) Original image (slightly blurred to reduce noise)

b) global histogram equalization (enhance noise & slightly increase contrast but the construction is not changed)

c) local histogram equalization using 7x7 neighborhood (reveals the small squares inside larger ones of the original image. (a) (b) (c)

Page 3: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Explain the result in c)Explain the result in c)

Basically, the original image consists of Basically, the original image consists of many small squares inside the larger dark many small squares inside the larger dark ones.ones.

However, the small squares were too close However, the small squares were too close in gray level to the larger ones, and their in gray level to the larger ones, and their sizes were too small to influence global sizes were too small to influence global histogram equalization significantly.histogram equalization significantly.

So, when we use the local enhancement So, when we use the local enhancement technique, it reveals the small areas.technique, it reveals the small areas.

Note also the finer noise texture is resulted Note also the finer noise texture is resulted by the local processing using relatively by the local processing using relatively small neighborhoods.small neighborhoods.

Page 4: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Enhancement using Enhancement using Arithmetic/Logic OperationsArithmetic/Logic Operations

Arithmetic/Logic operations perform Arithmetic/Logic operations perform on pixel by pixel basis between two on pixel by pixel basis between two or more imagesor more images

except NOT operation which perform except NOT operation which perform only on a single imageonly on a single image

Page 5: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Logic OperationsLogic Operations

Logic operation performs on gray-Logic operation performs on gray-level images, the pixel values are level images, the pixel values are processed as binary numbersprocessed as binary numbers

light represents a binary 1, and dark light represents a binary 1, and dark represents a binary 0 represents a binary 0

NOT operation = negative NOT operation = negative transformationtransformation

Page 6: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Example of AND OperationExample of AND Operation

original image AND image mask

result of AND

operation

Page 7: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Example of OR OperationExample of OR Operation

original image OR image mask

result of OR operation

Page 8: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Image SubtractionImage Subtraction

g(x,y) = f(x,y) – h(x,y)g(x,y) = f(x,y) – h(x,y)

enhancement of the differences enhancement of the differences between imagesbetween images

Page 9: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Image SubtractionImage Subtraction

a). original fractal imagea). original fractal image b). result of setting the four b). result of setting the four

lower-order bit planes to zerolower-order bit planes to zero• refer to the bit-plane slicingrefer to the bit-plane slicing• the higher planes contribute the higher planes contribute

significant detailsignificant detail• the lower planes contribute the lower planes contribute

more to fine detailmore to fine detail• image b). is nearly identical image b). is nearly identical

visually to image a), with a visually to image a), with a very slightly drop in overall very slightly drop in overall contrast due to less variability contrast due to less variability of the gray-level values in the of the gray-level values in the image.image.

c). difference between a). and c). difference between a). and b). (nearly black)b). (nearly black)

d). histogram equalization of d). histogram equalization of c). (perform contrast c). (perform contrast stretching transformation)stretching transformation)

aa bb

cc dd

Page 10: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 11: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 12: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 13: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 14: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Spatial FilteringSpatial Filtering

use filter (can also be called as use filter (can also be called as mask/kernel/template or window)mask/kernel/template or window)

the values in a filter subimage are the values in a filter subimage are referred to as coefficients, rather than referred to as coefficients, rather than pixel.pixel.

our focus will be on masks of odd our focus will be on masks of odd sizes, e.g. 3x3, 5x5,…sizes, e.g. 3x3, 5x5,…

Page 15: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 16: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Spatial Filtering ProcessSpatial Filtering Process

simply move the filter mask from simply move the filter mask from point to point in an image.point to point in an image.

at each point (x,y), the response of at each point (x,y), the response of the filter at that point is calculated the filter at that point is calculated using a predefined relationship.using a predefined relationship.

mn

iiii

mnmn

zw

zwzwzwR ...2211

Page 17: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Smoothing Spatial FiltersSmoothing Spatial Filters

used for blurring and for noise used for blurring and for noise reductionreduction

blurring is used in preprocessing steps, blurring is used in preprocessing steps, such as such as • removal of small details from an image removal of small details from an image

prior to object extractionprior to object extraction• bridging of small gaps in lines or curvesbridging of small gaps in lines or curves

noise reduction can be accomplished noise reduction can be accomplished by blurring with a linear filter and also by blurring with a linear filter and also by a nonlinear filterby a nonlinear filter

Page 18: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Smoothing Linear FiltersSmoothing Linear Filters

output is simply the average of the output is simply the average of the pixels contained in the neighborhood of pixels contained in the neighborhood of the filter mask.the filter mask.

called averaging filters or lowpass filters.called averaging filters or lowpass filters.

Page 19: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Smoothing Linear FiltersSmoothing Linear Filters

replacing the value of every pixel in an replacing the value of every pixel in an image by the average of the gray levels in image by the average of the gray levels in the neighborhood will reduce the “sharp” the neighborhood will reduce the “sharp” transitions in gray levels.transitions in gray levels.

sharp transitionssharp transitions• random noise in the imagerandom noise in the image• edges of objects in the imageedges of objects in the image

thus, smoothing can reduce noises thus, smoothing can reduce noises (desirable) and blur edges (undesirable)(desirable) and blur edges (undesirable)

Page 20: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

3x3 Smoothing Linear Filters3x3 Smoothing Linear Filters

box filter weighted average

the center is the most important and other pixels are inversely weighted as a function of their distance from the center of the mask

Page 21: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Weighted average filterWeighted average filter

the basic strategy behind weighting the basic strategy behind weighting the center point the highest and then the center point the highest and then reducing the value of the coefficients reducing the value of the coefficients as a function of increasing distance as a function of increasing distance from the origin is simply from the origin is simply an attempt an attempt to reduce blurring in the to reduce blurring in the smoothing processsmoothing process..

Page 22: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

ExampleExample

a). original image 500x500 a). original image 500x500 pixelpixel

b). - f). results of smoothing b). - f). results of smoothing with square averaging filter with square averaging filter masks of size n = 3, 5, 9, 15 masks of size n = 3, 5, 9, 15 and 35, respectively.and 35, respectively.

Note:Note:• big mask is used to eliminate big mask is used to eliminate

small objects from an image.small objects from an image.• the size of the mask establishes the size of the mask establishes

the relative size of the objects the relative size of the objects that will be blended with the that will be blended with the background.background.

aa bb

cc dd

ee ff

Page 23: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Order-Statistics Filters (Nonlinear Order-Statistics Filters (Nonlinear Filters)Filters)

the response is based on ordering the response is based on ordering (ranking) the pixels contained in the (ranking) the pixels contained in the image area encompassed by the filterimage area encompassed by the filter

exampleexample• median filter : R = median{zmedian filter : R = median{zk k |k = 1,2,|k = 1,2,

…,n x n}…,n x n}• max filter : R = max{zmax filter : R = max{zk k |k = 1,2,…,n x n}|k = 1,2,…,n x n}• min filter : R = min{zmin filter : R = min{zk k |k = 1,2,…,n x n}|k = 1,2,…,n x n}

note: n x n is the size of the masknote: n x n is the size of the mask

Page 24: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Median FiltersMedian Filters

replaces the value of a pixel by the median replaces the value of a pixel by the median of the gray levels in the neighborhood of of the gray levels in the neighborhood of that pixel (the original value of the pixel is that pixel (the original value of the pixel is included in the computation of the median)included in the computation of the median)

quite popular because for certain types of quite popular because for certain types of random noise (random noise (impulse noise impulse noise salt and salt and pepper noisepepper noise) , they ) , they provide excellent provide excellent noise-reduction capabilitiesnoise-reduction capabilities, with , with considering considering less blurring than linear less blurring than linear smoothing filters of similar size.smoothing filters of similar size.

Page 25: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 26: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

2626

Example : Median FiltersExample : Median Filters

Page 27: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

2727

Sharpening Spatial FiltersSharpening Spatial Filters

to highlight fine detail in an image to highlight fine detail in an image or to enhance detail that has been or to enhance detail that has been

blurred, either in error or as a natural blurred, either in error or as a natural effect of a particular method of effect of a particular method of image acquisition.image acquisition.

Page 28: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

2828

Blurring vs. SharpeningBlurring vs. Sharpening

as we know that blurring can be done as we know that blurring can be done in spatial domain by pixel averaging in in spatial domain by pixel averaging in a neighbors a neighbors

since averaging is analogous to since averaging is analogous to integrationintegration

thus, we can guess that the sharpening thus, we can guess that the sharpening must be accomplished by must be accomplished by spatial spatial differentiation.differentiation.

Page 29: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

2929

Derivative operatorDerivative operator

the strength of the response of a derivative the strength of the response of a derivative operator is proportional to the degree of operator is proportional to the degree of discontinuity of the image at the point at discontinuity of the image at the point at which the operator is applied.which the operator is applied.

thus, image differentiation thus, image differentiation • enhances edges and other discontinuities enhances edges and other discontinuities

(noise)(noise)• deemphasizes area with slowly varying gray-deemphasizes area with slowly varying gray-

level values.level values.

Page 30: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

3030

First-order derivativeFirst-order derivative

a basic definition of the first-order a basic definition of the first-order derivative of a one-dimensional derivative of a one-dimensional function f(x) is the differencefunction f(x) is the difference

)()1( xfxfx

f

Page 31: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

3131

Second-order derivativeSecond-order derivative

similarly, we define the second-order similarly, we define the second-order derivative of a one-dimensional derivative of a one-dimensional function f(x) is the differencefunction f(x) is the difference

)(2)1()1(2

2

xfxfxfx

f

Page 32: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Response of First and Second Response of First and Second order derivativesorder derivatives

Response of first order derivative is:Response of first order derivative is: zero in flat segments (area of constant grey zero in flat segments (area of constant grey

values)values) Non zero at the onset of a grey level step or rampNon zero at the onset of a grey level step or ramp Non zero along ramps Non zero along ramps

Response of second order derivative is:Response of second order derivative is: Zero in flat areasZero in flat areas Non zero at the onset of a grey level step or rampNon zero at the onset of a grey level step or ramp Zero along ramps of constant slopeZero along ramps of constant slope

Page 33: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 34: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

First and Second-order derivative First and Second-order derivative of f(x,y)of f(x,y)

when we consider an image function when we consider an image function of two variables, f(x,y), at which time of two variables, f(x,y), at which time we will dealing with partial we will dealing with partial derivatives along the two spatial derivatives along the two spatial axes.axes.

y

yxf

x

yxf

yx

yxf

),(),(),(f

2

2

2

22 ),(),(

y

yxf

x

yxff

(linear operator)

Laplacian operator

Gradient operator

Page 35: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Discrete Form of LaplacianDiscrete Form of Laplacian

),(2),1(),1(2

2

yxfyxfyxfx

f

),(2)1,()1,(2

2

yxfyxfyxfy

f

from

yield,

)],(4)1,()1,(

),1(),1([2

yxfyxfyxf

yxfyxff

Page 36: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Result Laplacian maskResult Laplacian mask

Page 37: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Laplacian mask implemented an Laplacian mask implemented an extension of diagonal neighborsextension of diagonal neighbors

Page 38: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Other implementation of Laplacian Other implementation of Laplacian masksmasks

give the same result, but we have to keep in mind that when combining (add / subtract) a Laplacian-filtered image with another image.

Page 39: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Effect of Laplacian OperatorEffect of Laplacian Operator

as it is a derivative operator,as it is a derivative operator,• it highlights gray-level discontinuities in it highlights gray-level discontinuities in

an imagean image• it deemphasizes regions with slowly it deemphasizes regions with slowly

varying gray levelsvarying gray levels tends to produce images that have tends to produce images that have

• grayish edge lines and other grayish edge lines and other discontinuities, all superimposed on a discontinuities, all superimposed on a dark, dark,

• featureless background.featureless background.

Page 40: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Correct the effect of featureless Correct the effect of featureless backgroundbackground

easily by adding the original and easily by adding the original and Laplacian image.Laplacian image.

be careful with the Laplacian filter usedbe careful with the Laplacian filter used

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxg

if the center coefficient of the Laplacian mask is negative

if the center coefficient of the Laplacian mask is positive

Page 41: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

ExampleExample

a). image of the North a). image of the North pole of the moonpole of the moon

b). Laplacian-filtered b). Laplacian-filtered image with image with

c). Laplacian image c). Laplacian image scaled for display scaled for display purposespurposes

d). image enhanced by d). image enhanced by addition with original addition with original image image

11 11 11

11 -8-8 11

11 11 11

Page 42: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Mask of Laplacian + additionMask of Laplacian + addition

to simply the computation, we can to simply the computation, we can create a mask which do both create a mask which do both operations, Laplacian Filter and operations, Laplacian Filter and Addition the original image.Addition the original image.

Page 43: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Mask of Laplacian + additionMask of Laplacian + addition

00 -1-1 00

-1-1 55 -1-1

00 -1-1 00

)]1,()1,(

),1(),1([),(5

)],(4)1,()1,(

),1(),1([),(),(

yxfyxf

yxfyxfyxf

yxfyxfyxf

yxfyxfyxfyxg

Page 44: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

ExampleExample

Page 45: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

NoteNote

00--11

00

--11

55--11

00--11

00

00 00 00

00 11 00

00 00 00

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxg

= +00

--11

00

--11

44--11

00--11

00

00--11

00

--11

99--11

00--11

00

00 00 00

00 11 00

00 00 00= +

00--11

00

--11

88--11

00--11

00

Page 46: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Unsharp maskingUnsharp masking

to subtract a blurred version of an image to subtract a blurred version of an image produces sharpening output image.produces sharpening output image.

),(),(),( yxfyxfyxf s

sharpened image = original image – blurred imagesharpened image = original image – blurred image

Page 47: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

High-boost filteringHigh-boost filtering

generalized form of Unsharp maskinggeneralized form of Unsharp masking A A 1 1

),(),(),( yxfyxAfyxfhb

),(),()1(

),(),(),()1(),(

yxfyxfA

yxfyxfyxfAyxf

s

hb

Page 48: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

High-boost filteringHigh-boost filtering

if we use Laplacian filter to create if we use Laplacian filter to create sharpen image fsharpen image fss(x,y) with addition of (x,y) with addition of original imageoriginal image

),(),()1(),( yxfyxfAyxf shb

),(),(

),(),(),(

2

2

yxfyxf

yxfyxfyxf s

Page 49: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

High-boost filteringHigh-boost filtering

yieldsyields

),(),(

),(),(),(

2

2

yxfyxAf

yxfyxAfyxfhb

if the center coefficient of the Laplacian mask is negative

if the center coefficient of the Laplacian mask is positive

Page 50: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

High-boost MasksHigh-boost Masks

A A 1 1 if A = 1, it becomes “standard” if A = 1, it becomes “standard”

Laplacian sharpeningLaplacian sharpening

Page 51: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

ExampleExample

Page 52: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gradient OperatorGradient Operator

first derivatives are implemented first derivatives are implemented using the using the magnitude of the magnitude of the gradientgradient..

y

fx

f

G

G

y

xf

21

22

2122 ][)f(

y

f

x

f

GGmagf yx

the magnitude becomes nonlinearyx GGf

commonly approx.

Page 53: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gradient MaskGradient Mask simplest approximation, 2x2simplest approximation, 2x2

zz11 zz22 zz33

zz44 zz55 zz66

zz77 zz88 zz99

)( and )( 5658 zzGzzG yx

212

562

582

122 ])()[(][ zzzzGGf yx

5658 zzzzf

Page 54: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gradient MaskGradient Mask

Sobel operators, 3x3Sobel operators, 3x3

zz11 zz22 zz33

zz44 zz55 zz66

zz77 zz88 zz99

)2()2(

)2()2(

741963

321987

zzzzzzG

zzzzzzG

y

x

yx GGf

the weight value 2 is to achieve smoothing by giving more important to the center point

Page 55: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

NoteNote

the summation of coefficients in all the summation of coefficients in all masks equals 0, indicating that they masks equals 0, indicating that they would give a response of 0 in an area would give a response of 0 in an area of constant gray level.of constant gray level.

Page 56: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

ExampleExample

Page 57: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Example of Combining Spatial Example of Combining Spatial Enhancement MethodsEnhancement Methods

want to sharpen want to sharpen the original image the original image and bring out more and bring out more skeletal detail.skeletal detail.

problems: narrow problems: narrow dynamic range of dynamic range of gray level and high gray level and high noise content noise content makes the image makes the image difficult to enhancedifficult to enhance

Page 58: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Example of Combining Spatial Example of Combining Spatial Enhancement MethodsEnhancement Methods

solve : solve :

1.1. Laplacian to highlight fine Laplacian to highlight fine detaildetail

2.2. gradient to enhance gradient to enhance prominent edgesprominent edges

3.3. gray-level transformation to gray-level transformation to increase the dynamic range of increase the dynamic range of gray levelsgray levels

Page 59: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 60: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level
Page 61: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Image Enhancement in the Image Enhancement in the Frequency DomainFrequency Domain

Page 62: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Fourier SeriesFourier Series

Any function that periodically repeats itself can be expressedas the sum of sines and/or cosines of different frequencies, each multiplied by a different coefficients. This sum is called a Fourier series.

Page 63: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Fourier SeriesFourier Series

00

0

00

0

00

0

00

00

00

1000

sin)(2

cos)(2

)(1

sincos)(

Tt

tn

Tt

tn

Tt

t

nnn

dttnwtgT

b

dttnwtgT

a

dttgT

a

tnwbtnwaatg

Page 64: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Fourier TransformFourier Transform

A function that is not periodic but the area under its curve is finite can be expressed as the integral of sines and/or cosines multiplied by a weighing function. The formulationin this case is Fourier transform.

Page 65: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The One-Dimensional Fourier The One-Dimensional Fourier Transform and its InverseTransform and its Inverse

The fourier transform F(u) :The fourier transform F(u) :

The inverse Fourier transform f(x) :The inverse Fourier transform f(x) :

Two variables Fourier transform F(u, v) : Two variables Fourier transform F(u, v) :

The inverse transform f(x, y) : The inverse transform f(x, y) :

dxexfuF uxj 2)()(

dueuFxf uxj 2)()(

dxdyeyxfvuF vyuxj )(2),(),(

dudvevuFyxf vyuxj )(2),(),(

Page 66: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The One-Dimensional Fourier The One-Dimensional Fourier Transform and its InverseTransform and its Inverse

The discrete Fourier Transform F(u) :The discrete Fourier Transform F(u) :

The inverse DFT :The inverse DFT :

Apply euler’s formula : Apply euler’s formula :

1,,1,0)(1

)(1

0

/2

MuforexfM

uFM

x

Muxj

1,,1,0)()(1

0

/2

MxforeuFxfM

u

Muxj

1

0

]/2sin/2)[cos(1

)(M

x

MuxjMuxxfM

uF

Page 67: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The One-Dimensional Fourier The One-Dimensional Fourier Transform and its InverseTransform and its Inverse

F(u) in polar coordinates :F(u) in polar coordinates :

spectrum)Fourier theof (square

spectrumpower : )()()()(

ansformFourier tr theof

spectrum phaseor angle phase the: )(

)(tan)(

ansformFourier tr theof

spectrumor magnitude the: )]()([)( where

)()(

222

1

2/122

)(

uIuRuFuP

uR

uIu

uIuRuF

euFuF uj

Page 68: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The One-Dimensional Fourier The One-Dimensional Fourier Transform and its InverseTransform and its Inverse

Page 69: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The two dimensional DFT and its The two dimensional DFT and its InverseInverse

The discrete fourier transform of a function f(x,y) The discrete fourier transform of a function f(x,y) of size M x N :of size M x N :

The inverse Fourier transform :The inverse Fourier transform :

1

0

1

0

)//(2),(1

),(M

x

N

y

NvyMuxjeyxfMN

vuF

1

0

1

0

)//(2),(),(M

u

N

v

NvyMuxjevuFyxf

Page 70: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The two dimensional DFT and its The two dimensional DFT and its InverseInverse

In the polar coordinateIn the polar coordinate

spectrum)Fourier theof (square

spectrumpower : ),(),(),(),(

ansformFourier tr theof

spectrum phaseor angle phase the: ),(

),(tan),(

ansformFourier tr theof

spectrumor magnitude the: )],(),([),(

222

1

2/122

vuIvuRvuFvuP

vuR

vuIvu

yxIyxRvuF

Page 71: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The two dimensional DFT and its The two dimensional DFT and its InverseInverse

DFT corresponding (u,v)=(0,0)DFT corresponding (u,v)=(0,0)

If f(x,y) is real, its Fourier transform is conjugate If f(x,y) is real, its Fourier transform is conjugate symmetricsymmetric

The spectrum of the Fourier transform is The spectrum of the Fourier transform is symmetricsymmetric

),( of average the: ),(1

)0,0(1

0

1

0

yxfyxfMN

FM

x

N

y

),(),( * vuFvuF

),(),( vuFvuF

Page 72: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The two dimensional DFT and its The two dimensional DFT and its InverseInverse

Page 73: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Basics of filtering in the frequency Basics of filtering in the frequency domaindomain

1.1. Multiply the input image by to Multiply the input image by to center the transformcenter the transform

2.2. Compute F(u,v), by the DFT of the image Compute F(u,v), by the DFT of the image from (1)from (1)

3.3. Multiply F(u,v) by a filter function H(u,v)Multiply F(u,v) by a filter function H(u,v)4.4. Compute the inverse DFT of the result in Compute the inverse DFT of the result in

(3)(3)5.5. Obtain the real part of the result in (4)Obtain the real part of the result in (4)6.6. Multiply the result in (5) by Multiply the result in (5) by

yx )1(

yx )1(

yx )1(

Page 74: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Basics of filtering in the frequency Basics of filtering in the frequency domaindomain

)],([Image Filtered

),(),(),(1 vuG

vuFvuHvuG

Page 75: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Some basic filters and their Some basic filters and their propertiesproperties

otherwise 1

)2/,2/(),( if 0),(

filternotch

NMvuvuH

Page 76: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Some basic filters and their Some basic filters and their propertiesproperties

Lowpass filter : less Lowpass filter : less sharpsharp(Smoothing)(Smoothing)

Highpass filter : less Highpass filter : less gray-level variation gray-level variation and emphasized and emphasized edgesedges(Sharpening)(Sharpening)

Page 77: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Correspondence between Filtering Correspondence between Filtering in the Spatial and Frequency in the Spatial and Frequency

DomainsDomains The convolution theorem :The convolution theorem :

The impulse response :The impulse response :

),(*),(),(),(

),(),(),(*),(

),(),(1

),(*),(1

0

1

0

vuHvuFyxhyxf

vuHvuFyxhyxf

nymxhnmfMN

yxhyxfM

m

N

n

1

0

1

0

1

0

1

00000

)0,0(),(),(

),(),(),(

M

x

N

y

M

x

N

y

syxyxs

yxAsyyxxAyxs

Page 78: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Correspondence between Filtering Correspondence between Filtering in the Spatial and Frequency in the Spatial and Frequency

DomainsDomains The Fourier transform of a unit impulse functionThe Fourier transform of a unit impulse function

Let Let

1

0

1

0

)//(2 1),(

1),(

M

x

N

y

NvyMuxj

MNeyx

MNvuF

),(),( yxyxf

),(1

),(),(1

),(*),(1

0

1

0

yxhMN

nymxhnmMN

yxhyxfM

m

N

n

),(),(

),()],([),(*),(

),(),(),(*),(

vuHyxh

vuHyxyxhyx

vuHvuFyxhyxf

Page 79: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Correspondence between Filtering Correspondence between Filtering in the Spatial and Frequency in the Spatial and Frequency

DomainsDomains Gaussian functions :Gaussian functions :

222

2221

2

22

22

21

21

222

22

22

21

212/2/

2

2/

22)(

domain spatial in thefilter ingcorrespond the

, with )(

Gaussian of difference a asfilter highpass

2)(

domain spatial in thefilter ingcorrespond the

)(

functionfilter Gaussian

xx

uu

x

u

BeAexh

BABeAeuH

Aexh

AeuH

Page 80: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Correspondence between Filtering Correspondence between Filtering in the Spatial and Frequency in the Spatial and Frequency

DomainsDomains

Page 81: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Smoothing Frequency-Domain Smoothing Frequency-Domain FiltersFilters

IdealIdeal ButterworthButterworth GaussianGaussian

Page 82: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal lowpass filterIdeal lowpass filter

0

0

),( 0

),( 1 {),(

DvuDif

DvuDifvuH

2/122 ])2/()2/[(),( NvMuvuD

Page 83: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal lowpass filterIdeal lowpass filter

Page 84: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal lowpass filterIdeal lowpass filter

1

0

1

0

),(M

u

N

vT vuPP

u v

TPvuP ]/),([100

Page 85: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal lowpass filterIdeal lowpass filter

Page 86: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal lowpass filterIdeal lowpass filter

Page 87: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Butterworth Lowpass FiltersButterworth Lowpass Filters

When D(u,v)= , H(u,v)=0.5When D(u,v)= , H(u,v)=0.50D

nDvuDvuH

20 ]/),([1

1),(

Page 88: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Butterworth Lowpass FiltersButterworth Lowpass Filters

Page 89: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Butterworth Lowpass FiltersButterworth Lowpass Filters

Page 90: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Butterworth Lowpass FiltersButterworth Lowpass Filters

Page 91: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gaussian Lowpass filterGaussian Lowpass filter

letlet

22 2/),(),( vuDevuH

20

2 2/),(),( DvuDevuH

0D

Page 92: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gaussian Lowpass filterGaussian Lowpass filter

Page 93: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gaussian Lowpass filterGaussian Lowpass filter

Page 94: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Sharpening Frequency Domain Sharpening Frequency Domain FiltersFilters

IdealIdeal ButterworthButterworth GaussianGaussian

),(1),( vuHvuH lphp

Page 95: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Sharpening Frequency Domain Sharpening Frequency Domain FiltersFilters

Page 96: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal Highpass FiltersIdeal Highpass Filters

Page 97: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Ideal highpass filterIdeal highpass filter

0

0

),( 1

),( 0 {),(

DvuDif

DvuDifvuH

Page 98: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Butterworth Highpass FiltersButterworth Highpass Filters

nvuDDvuH

20 )],(/[1

1),(

Page 99: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Gaussian Highpass FiltersGaussian Highpass Filters

20

2 2/),(1),( DvuDevuH

Page 100: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The Laplacian in the Frequency The Laplacian in the Frequency DomainDomain

)()()(

uFjudx

xfd nn

n

),()(

),()(),()(),(),(

22

222

2

2

2

vuFvu

vuFjuvuFjuy

yxf

x

yxf

),()(),( 222 vuFvuyxf

)(),( 22 vuvuH

])2/()2/[(),( 22 NvMuvuH

)},(])2/()2/[({),( 2212 vuFNvMuyxf

Page 101: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The Laplacian in the Frequency The Laplacian in the Frequency DomainDomain

Page 102: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

The Laplacian in the Frequency The Laplacian in the Frequency DomainDomain

),(),(),( 2 yxfyxfyxg

Page 103: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Unsharp Masking, High-Boost Filtering, and Unsharp Masking, High-Boost Filtering, and High-Frequency Emphasis FilteringHigh-Frequency Emphasis Filtering

Unsharp masking :Unsharp masking : High-Boost filtering :High-Boost filtering :

High-Frequency Emphasis FilteringHigh-Frequency Emphasis Filtering

),(),(),( yxfyxfyxf lphp

),(),(),( yxfyxAfyxf lphb

0.21.5 ,5.00.25 valuetypical,,0

),(),(

baaba

vubHavuH hphfe

),()1(),(

),(1),(

vuHAvuH

vuHvuH

hphb

lphp

Page 104: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Unsharp Masking, High-Boost Filtering, and Unsharp Masking, High-Boost Filtering, and High-Frequency Emphasis FilteringHigh-Frequency Emphasis Filtering

Page 105: Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level

Unsharp Masking, High-Boost Filtering, and Unsharp Masking, High-Boost Filtering, and High-Frequency Emphasis FilteringHigh-Frequency Emphasis Filtering