byst eh-1 dip - ws2002: enhancement in the spatial domain digital image processing bundit thipakorn,...

47
BYST BYST Eh- Eh-1 DIP - WS2002: Enhancement in the Spatial Domain DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Digital Image Processing Bundit Thipakorn, Ph.D. Bundit Thipakorn, Ph.D. Computer Engineering Department Computer Engineering Department Image Enhancement i Image Enhancement i n the Spatial Domai n the Spatial Domai n n

Upload: griselda-cameron

Post on 17-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

BYSTBYSTEh-Eh-11DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Digital Image ProcessingDigital Image Processing

Bundit Thipakorn, Ph.D.Bundit Thipakorn, Ph.D.Computer Engineering DepartmentComputer Engineering Department

Image Enhancement in the Image Enhancement in the Spatial DomainSpatial Domain

BYSTBYSTEh-Eh-22DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Image EnhancementImage Enhancement

improve the quality of the image / orimprove the quality of the image / or emphasize particular aspects within the imageemphasize particular aspects within the image

EnhancementInput Imagef(x,y)

Output Imageg(x,y)

Application SpecificFeedback

BYSTBYSTEh-Eh-33DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

EnhancementEnhancement

The image enhancement can be performed in either:The image enhancement can be performed in either:

Spatial DomainSpatial Domain: Directly manipulate on the pixels in an : Directly manipulate on the pixels in an image.image.

Frequency DomainFrequency Domain: Modify the Fourier transform of an : Modify the Fourier transform of an image.image.

oror

Cont’d.Cont’d.

The enhancement methods are The enhancement methods are application specificapplication specific as as illustrated in previous diagram. The enhancement illustrated in previous diagram. The enhancement process requires feedback from application.process requires feedback from application.

BYSTBYSTEh-Eh-44DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

EnhancementEnhancementCont’d.Cont’d.

Image enhancement in spatial domain methods Image enhancement in spatial domain methods can be classified into five categories:can be classified into five categories:

1. 1. Point OperationsPoint Operations::Each output pixel’s gray level depends only Each output pixel’s gray level depends only

upon the gray level of the corresponding input upon the gray level of the corresponding input pixel.pixel.

2. 2. Global OperationsGlobal Operations::The global characteristics (statistics) of the The global characteristics (statistics) of the

image array are use to modify the pixel values.image array are use to modify the pixel values.

BYSTBYSTEh-Eh-55DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

EnhancementEnhancementCont’d.Cont’d.

4. 4. Geometric OperationsGeometric Operations::The pixel values are modified according to The pixel values are modified according to

the structural content of the image.the structural content of the image.

5. 5. Temporal (Frame-Based) OperationsTemporal (Frame-Based) Operations::The resulting image is a combination of The resulting image is a combination of

more than one unprocessed image.more than one unprocessed image.

3. 3. Neighbourhood OperationsNeighbourhood Operations::Data from the immediate neighbours is used Data from the immediate neighbours is used

to modify a pixel value.to modify a pixel value.

BYSTBYSTEh-Eh-66DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Spatial Domain MethodsSpatial Domain Methods

g(x,y) = T[f(x,y)]g(x,y) = T[f(x,y)]

WhereWhere f(x,y)f(x,y) = the input image= the input imageg(x,y)g(x,y)= the processed image= the processed imageTT = an operator.= an operator.

Image enhancement in spatial domain can be expr Image enhancement in spatial domain can be expr essed by the following expression: essed by the following expression:

EnhancementEnhancementCont’d.Cont’d.

BYSTBYSTEh-Eh-77DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

The operator The operator TT is normally defined over some is normally defined over some neigneighborhoodhborhood ofof (x,y)(x,y)..

EnhancementEnhancementCont’d.Cont’d.

yy

xx

00Origin( , )00Origin( , )

(x,y)(x,y)

A traditional defined ne A traditional defined ne ighborhood of a point ( ighborhood of a point (

x,y)x,y)

A square subimage area cent A square subimage area cent ered at (x,y) which is usually ered at (x,y) which is usually

called “ called “maskmask ((kernelkernel , , templatemplatete , or , or windowwindow)”.)”.

Image f(x,y) Image f(x,y)

BYSTBYSTEh-Eh-88DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

The center of the subimage is moved from pixel to pixel an The center of the subimage is moved from pixel to pixel an d the operator d the operator TT is applied at each location (x,y) to yield th is applied at each location (x,y) to yield th e output g(x,y). e output g(x,y).

EnhancementEnhancementCont’d.Cont’d.

yy

xx

00Origin( , )00Origin( , )

(x,y)(x,y)

Image f(x,y) Image f(x,y)

ConvolutionConvolutionProcessProcess

Only the pixels in the area of the image spanned by the neighborhood are utilized.

BYSTBYSTEh-Eh-99DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Gray-Scale ModificationGray-Scale Modification

LetLet r = the gray level of f(x,y) at x,yr = the gray level of f(x,y) at x,yand and s = the gray level of g(x,y) at x,y.s = the gray level of g(x,y) at x,y.

s = M(r)s = M(r)

WhereWhere M = a gray-level or mapping transformation function. M = a gray-level or mapping transformation function.

Gray-scale modification is a type of point operations that Gray-scale modification is a type of point operations that will change the pixel’s values by a mapping equation as shwill change the pixel’s values by a mapping equation as shown in the following:own in the following:

BYSTBYSTEh-Eh-1010DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

That is, only one pixel is used and g(x,y) depends on the gr That is, only one pixel is used and g(x,y) depends on the gr ay value at (x,y). ay value at (x,y).

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

BYSTBYSTEh-Eh-1111DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

1. Image Negative1. Image Negative

1:1 Mapping1:1 Mapping

Negative MappingNegative Mapping

Input Gray LevelInput Gray Level

Output Output Gray LevelGray Level

Let Let n be the number of gray level bits usedn be the number of gray level bits used

S = 2S = 2nn - r - r

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

BYSTBYSTEh-Eh-1212DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

The primary operations applied to the gray scale of The primary operations applied to the gray scale of an image are to compress or stretch.an image are to compress or stretch.

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

CompressCompress Uninterested gray-scale rUninterested gray-scale ranges.anges.

StretchStretch Gray-scale ranges containing Gray-scale ranges containing desired information.desired information.

Gray-scale compression or stretching can be performed by Gray-scale compression or stretching can be performed by changing the slope of the mapping equations to be lower or changing the slope of the mapping equations to be lower or greater than one, respectively. greater than one, respectively.

2. Gray-Scale Compression and Stretching2. Gray-Scale Compression and Stretching

BYSTBYSTEh-Eh-1313DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

Input Gray LevelInput Gray Level

Output Output Gray LevelGray Level

1:1 Mapping1:1 Mapping

255255

255255

00

aa

bb

Gray-Scale CGray-Scale Compressionompression

Gray-Scale SGray-Scale Stretchingtretching

Slope > 1: Slope > 1: StretchingStretching

Slope < 1: CoSlope < 1: Compressingmpressing

(0-b)(0-b) (0-255)(0-255)

(0-255)(0-255) (0-a)(0-a)

““a” and “b” < 255a” and “b” < 255

BYSTBYSTEh-Eh-1414DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

InputInputGray LevelGray Level

Output Output Gray LevelGray Level

Slope = 1Slope = 1

255255

255255

00aa bb

Gray-Scale SGray-Scale Stretchingtretching

Stretching gray-scales Stretching gray-scales between a to b.between a to b.

Slope = 1Slope = 1

aa bb 255255

255255

Output Output Gray LevelGray Level

InputInputGray LevelGray Level

00

Gray-Scale SGray-Scale Stretchingtretching

Stretching with clipping at Stretching with clipping at ends.ends.

BYSTBYSTEh-Eh-1515DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

InputInputGray LevelGray Level

Output Output Gray LevelGray Level

Slope = 1Slope = 1

255255

255255

00 aa bbHighlighting gray values bHighlighting gray values between a to b.etween a to b.

Slope = 1Slope = 1

aa bb 255255

255255

Output Output Gray LevelGray Level

InputInputGray LevelGray Level

00

Highlighting gray values between Highlighting gray values between a to b and dimming others.a to b and dimming others.

Intensity-Level Slicing

BYSTBYSTEh-Eh-1616DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

To reduce contrast of brighter regions by using a To reduce contrast of brighter regions by using a logarithmic curve as the mapping function.logarithmic curve as the mapping function.

3. Logarithm Operator3. Logarithm Operator

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

S = c log(|r|) or S = c log(1+|r|)S = c log(|r|) or S = c log(1+|r|)

rr

SS

Where c is the scaling Where c is the scaling constant which is constant which is selected so that the selected so that the maximum output value maximum output value is 255.is 255.

M(r)

A logarithmic transform A logarithmic transform stretches the lower values stretches the lower values while compresses the while compresses the higher values.higher values.

BYSTBYSTEh-Eh-1717DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

An original image.An original image. A enhanced image after A enhanced image after applying the logarithm applying the logarithm operator.operator.

BYSTBYSTEh-Eh-1818DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

To enhance high intensity pixel values by using a To enhance high intensity pixel values by using a exponential curve as the mapping function.exponential curve as the mapping function.

4. Exponential Operator4. Exponential Operator

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

S = c bS = c brr or S = c(b or S = c(brr - 1) - 1) WhereWhere b = the basisb = the basis

rr

SS

M(r)

A exponential transform A exponential transform stretches the higher values stretches the higher values while compresses the lower while compresses the lower values.values.

c = the scaling constantc = the scaling constant

BYSTBYSTEh-Eh-1919DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

An original image.An original image. A enhanced image after A enhanced image after applying the exponential applying the exponential operator.operator.

BYSTBYSTEh-Eh-2020DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

An alternative method: “An alternative method: “Raised to the PowerRaised to the Power””

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

S = c rS = c rii

In this alternative method, the input intensity “In this alternative method, the input intensity “rr” is a basis of ” is a basis of the exponential mapping function. Hence the new pixel the exponential mapping function. Hence the new pixel intensity value is equal to the input intensity value raised to the intensity value is equal to the input intensity value raised to the value of “value of “ii”. ”.

IfIf i > 1 i > 1 An exponential transform. An exponential transform.

i < 1 i < 1 A logarithmic transform. A logarithmic transform.

BYSTBYSTEh-Eh-2121DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

The brightness of the image can be easily adjusted The brightness of the image can be easily adjusted by adding or subtracting f(x,y) with some constant by adding or subtracting f(x,y) with some constant gray-level gray-level (sliding the histogram to the bigger or the (sliding the histogram to the bigger or the smaller gray-level)smaller gray-level)..

S = r + A ; S = r - A

5. Brightness Modification5. Brightness Modification

WhereWhere A = the enhancement factor (constant).A = the enhancement factor (constant).

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

BYSTBYSTEh-Eh-2222DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

To improve the contrast in an image by linearly To improve the contrast in an image by linearly stretching the intensity values that image contains to span stretching the intensity values that image contains to span within a desired range of values.within a desired range of values.

LetLet a = the lowest gray level (0)a = the lowest gray level (0)b = the highest gray level (255)b = the highest gray level (255)c = the lowest pixel value in the present imagec = the lowest pixel value in the present imaged = the highest pixel value in the present image. d = the highest pixel value in the present image.

Therefore;Therefore;

S = [(r-c)(b-a)/(d-c)] + aS = [(r-c)(b-a)/(d-c)] + a

6. Contrast Stretching6. Contrast Stretching

Cont’d.Cont’d.Gray-Scale Gray-Scale ModificationModification

BYSTBYSTEh-Eh-2323DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

A plot of the gray-level values versus A plot of the gray-level values versus

the number of pixels at that value.the number of pixels at that value.

# of pixels

gray-level

BYSTBYSTEh-Eh-2424DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Given an image f, the histogram of f over the gray levels ranged from 0 to L-1 is defined as:

P(g) =N(g)

MWhere P(g) = the histogram probability

N(g) = the number of pixels at gray level gM = the total number of pixels in the

image.

BYSTBYSTEh-Eh-2525DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

# of pixels

Gray Level

# of pixels

Gray Level

Note: 0 = White255 = Black

DarkImage

BrightImage

BYSTBYSTEh-Eh-2626DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

# of pixels

Gray Level

# of pixels

Gray Level

Note: 0 = White255 = Black

Low- ContrastImage

High- ContrastImage

BYSTBYSTEh-Eh-2727DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Histogram processing (modification) is a type of global Histogram processing (modification) is a type of global operations that will modify the dynamic range and contrasoperations that will modify the dynamic range and contrast of the original image.t of the original image.

The modification is performed by altering the histograThe modification is performed by altering the histogram of the original image to have the desired shape.m of the original image to have the desired shape.

Histogram modification can perform using non-linear oHistogram modification can perform using non-linear or non-monotonic mapping functions.r non-monotonic mapping functions.

Histogram ProcessingHistogram Processing

BYSTBYSTEh-Eh-2828DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

1. Histogram Equalization1. Histogram Equalization

Ideally: The output image contains a uniform distributionIdeally: The output image contains a uniform distribution

of intensities ( a flat histogram).of intensities ( a flat histogram).

N(g) = Max { 0, Round ( ) -1}2l x c(g)m x n

WhereWhere l = the number of bits;l = the number of bits; m x n = the image resolutionm x n = the image resolutionN(g) = the new intensity valueN(g) = the new intensity valuec(g) = the cumulative pixel count up to old intensity value gc(g) = the cumulative pixel count up to old intensity value gRound( ) = a rounding to the nearest integer function. Round( ) = a rounding to the nearest integer function.

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-2929DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Examples m=n=8 and l = 3

g f c(g) N(g)0

1

2

3

4

5

6

7

8

22

20

2

30

2

8

2

0

8 0

50

52

54

62

64

64

3

5

5

6

7

7

7

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3030DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

An original image.An original image. A enhanced image after A enhanced image after applying the histogram applying the histogram equalization method.equalization method.

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3131DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

2. Histogram Specification (Matching)2. Histogram Specification (Matching)

The output image contains a desired shape of the output The output image contains a desired shape of the output

intensity distribution (histogram).intensity distribution (histogram).

Histogram specification will map the intensity distributHistogram specification will map the intensity distribut

ion of the original image into a desired intensity distributioion of the original image into a desired intensity distributio

n by using a histogram equalized image as the intermediatn by using a histogram equalized image as the intermediat

e stage.e stage.

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3232DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Histogram specification can be performed as following Histogram specification can be performed as following steps:steps: Apply the histogram equalization to the original image Apply the histogram equalization to the original image (Row H in the following table).(Row H in the following table).

Specify the histogram of the new image.Specify the histogram of the new image.

Apply the histogram equalization to the desired histograApply the histogram equalization to the desired histogram in step 2 (Row S).m in step 2 (Row S).

Map each value of row H to the closest value in row S aMap each value of row H to the closest value in row S and then using the corresponding row in O for the new valund then using the corresponding row in O for the new value of gray level (Row M).e of gray level (Row M).

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3333DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Examples:Step 1: Result of applying histogram equalization to the original image.

Original Gray-Scale Value (O) Histogram Equalized Values (H)

0

1

2

3

4

5

6

7

1

2

4

4

6

6

7

7

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3434DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Examples:Step 2: The desired histogram.

Gray-Scale Value Number of Pixels in Desired Histogram

0

1

2

3

4

5

6

7

1

5

10

15

20

0

0

0

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3535DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Examples:Step 3: Result of applying histogram equalization to the desired histogram.

Gray-Scale Value Histogram Equalized Values (S)

0

1

2

3

4

5

6

7

0

1

2

4

7

7

7

7

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3636DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Examples:Step 4: Mapping result

O H S M

0

1

2

3

4

5

6

7

1

2

4

4

6

6

7

7

0

1

2

4

7

7

7

7

1

2

3

3

4

4

4

4

Cont’d.Cont’d.

HistogramHistogram

BYSTBYSTEh-Eh-3737DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Local EnhancementLocal Enhancement

Histogram equalization and histogram specification preHistogram equalization and histogram specification pre

viously discussed will viously discussed will enhance an image globallyenhance an image globally since pixel since pixel

s are modified by a transformation function based on the gs are modified by a transformation function based on the g

ray-level distribution over an entire image.ray-level distribution over an entire image.

To enhance details over small areas, gray-level values wiTo enhance details over small areas, gray-level values wi

thin an image can be modified locally by applying histograthin an image can be modified locally by applying histogra

m modification techniques to the image on a m modification techniques to the image on a block-by-blockblock-by-block

basis (7x7, 15x15, etc.). This technique is called “basis (7x7, 15x15, etc.). This technique is called “local enhlocal enh

ancementancement”.”.

BYSTBYSTEh-Eh-3838DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Local EnhancementLocal EnhancementCont’d.Cont’d.

BYSTBYSTEh-Eh-3939DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Local EnhancementLocal Enhancement

Original ImageOriginal Image Image after global histoImage after global histogram equalization.gram equalization.

Cont’d.Cont’d.

BYSTBYSTEh-Eh-4040DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Local EnhancementLocal Enhancement

Image after local histogram eImage after local histogram equalization (7x7).qualization (7x7).

Image after local histogram Image after local histogram equalization (15x15).equalization (15x15).

Cont’d.Cont’d.

BYSTBYSTEh-Eh-4141DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Adaptive Contrast EnhancementAdaptive Contrast Enhancement

Modify the histogram by a transformation function basModify the histogram by a transformation function bas

ed on the gray-level distribution over small areas (Local ened on the gray-level distribution over small areas (Local en

hancement).hancement).

Adaptive Contrast Enhancement (ACE) method is based Adaptive Contrast Enhancement (ACE) method is based

on the intensity on the intensity meanmean and and variancevariance (or S.D.) of the pixel int (or S.D.) of the pixel int

ensities in a neighborhood.ensities in a neighborhood.Let f(x,y) = an input image,Let f(x,y) = an input image,

g(x,y) = a new image,g(x,y) = a new image,

M = the global mean of f(x,y),M = the global mean of f(x,y),

BYSTBYSTEh-Eh-4242DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Adaptive Contrast EnhancementAdaptive Contrast Enhancement

(x,y) = the gray-level standard deviation (S.D.),(x,y) = the gray-level standard deviation (S.D.),

Cont’d.Cont’d.

m(x,y) = the gray-level mean,m(x,y) = the gray-level mean,

kk11 and k and k22 = constants and 0 < k = constants and 0 < k11, k, k22 < 1. < 1.

Where Where (x,y) and m(x,y) are calculated in a neighborhood (x,y) and m(x,y) are calculated in a neighborhood centered at (x,y).centered at (x,y).

The transformation function of ACE method is defined as The transformation function of ACE method is defined as follows:follows:

)y,x(mk)y,x(m)y,x(f)y,x(

Mk)y,x(g 21

BYSTBYSTEh-Eh-4343DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Adaptive Contrast EnhancementAdaptive Contrast EnhancementCont’d.Cont’d.

The termThe term)y,x(

Mk1

is called the “local gain”. is called the “local gain”.

(x,y)(x,y))y,x(

Mk1

High contrastHigh contrast

(x,y)(x,y))y,x(

Mk1

Low contrastLow contrast

Thus, areas with low contrast will have larger local gain.Thus, areas with low contrast will have larger local gain.

BYSTBYSTEh-Eh-4444DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Arithmetic/Logic OperationsArithmetic/Logic Operations

Image 1, …, n are normally the identical scenes but may Image 1, …, n are normally the identical scenes but may

be acquired at be acquired at different timesdifferent times or through or through different spectral fdifferent spectral f

iltersilters..

Arithmeticor Logic Operations

1Image 1Image

2Image 2Image

Image n Image n

RRRRRRRRRRRRRRRRRRRRRR

BYSTBYSTEh-Eh-4545DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Arithmetic/Logic OperationsArithmetic/Logic Operations

Arithmetic/logic operations will operate on a Arithmetic/logic operations will operate on a pixel-by-pixpixel-by-pix

elel basis between two or more images. basis between two or more images.

The result image is a new image whose pixel at coordinaThe result image is a new image whose pixel at coordina

tes (x,y) is the result of applying arithmetic or logic operatites (x,y) is the result of applying arithmetic or logic operati

ons to the pixels in the same location.ons to the pixels in the same location.

Image subtraction and division are more widely used thImage subtraction and division are more widely used th

an image addition and multiplication.an image addition and multiplication.

The The ANDAND or or OROR operations are used for selecting subim operations are used for selecting subim

ages in an image (ages in an image (maskingmasking).).

Cont’d.Cont’d.

BYSTBYSTEh-Eh-4646DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Arithmetic/Logic OperationsArithmetic/Logic OperationsCont’d.Cont’d.

BYSTBYSTEh-Eh-4747DIP - WS2002: Enhancement in the Spatial DomainDIP - WS2002: Enhancement in the Spatial Domain

Arithmetic/Logic OperationsArithmetic/Logic OperationsCont’d.Cont’d.