0% found this document useful (0 votes)
9 views

Ene461 Class5

The document discusses various image processing techniques for enhancing images including adjusting brightness, contrast stretching, and histogram equalization. Brightness can be adjusted by adding or subtracting a constant value from pixel intensities. Contrast can be enhanced using techniques such as logarithmic contrast stretching and piecewise linear stretching. Histogram equalization improves contrast by spreading out the most frequent intensity values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Ene461 Class5

The document discusses various image processing techniques for enhancing images including adjusting brightness, contrast stretching, and histogram equalization. Brightness can be adjusted by adding or subtracting a constant value from pixel intensities. Contrast can be enhanced using techniques such as logarithmic contrast stretching and piecewise linear stretching. Histogram equalization improves contrast by spreading out the most frequent intensity values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ENE 461 Class 5 (1/2008), July 4, 2008

1
Werapon Chiracharit, Ph.D., ENE, KMUTT

Simple Image Processing Tool

Enhancement

1
Brightness (Intensity)

I=I-100 I=I+100

I=I-50 I=I+50
3
I (Original)

Adding and Subtracting, Inew=Iold+C


If I>255 then I=255
g
255 n in e
t e al u
Adjusted Intensity

h
g V
Li w
Ne
ue
l
Va

g
in
ld

n
ke alue
O

r
C Da w V
Ne
0
0 -C 255
Original Intensity
If I<0 then I=0 4

2
I=0.1I I=2I

I=0.5I I=1.5I

5
I (Original)

Multiplying and Dividing, Inew=C Iold


C>1 If I>255 then I=255
255
a lu g
e
Ne tenin
Adjusted Intensity

ue
l
Va
wV
h
Lig

ld
O

e n ing
rk e
Da V a lu
w
Ne 0<C<1
0
0 Original Intensity 255
6

3
Piecewise Linear Stretching
Inew

255
Imax_new

I2_new

I1_new
Imin_new
0
0 I1 I2 255 Iold
7

MATLAB Toolbox Function


• imadd()
• imsubtract()
• immultiply()
• imdivide()
• brighten()

4
• imadjust(I,[Ilow Ihigh],[Ilow_new Ihigh_new],Gamma)
Inew

255
if Iold>=Ihigh then Inew=Ihigh_new
Ihigh_new a<
1
m
m 1
Ga a=
m
m
Ga a>
1
m
m
Ilow_new Ga
if Iold<=Ilow then Inew=Ilow_new
0
0 Ilow Ihigh 255 Iold
9

Contrast
C
C = (imax-imin)
(imax+imin)

Intensity
Number of Pixel, ni

Histogram
with Low Contrast /

0 Intensity, i 255 10

5
Contrast Enhancement

I I=(3/2)I-50
Brightening
Inew
Darkening

0 Iold 11

Logarithmic Contrast Stretching


Limiting function at threshold T and slope E > 1
I Inew = 1 / [ 1 + (T / Iold)E ]
new

1
Normalized Intensity

Brightening

1/2

Darkening

0
0 T 255 Iold 12

6
Intensity Normalization
Inormalized Inormalized = Iold / 255

0 Iold
0 255

Note: Inormalized = (Iold - Imin) / (Imax - Imin) 13

Histogram Equalization
1. Find Histogram of the image
H(i) = ni for gray level i=0,1,2,…,255
2. Find Probability Density Function (pdf)
P(i) = ni/N where N = Height×Width
3. Find Cummulative Distribution Function (cdf)
C(i) = Σk=0 →iP(k)
4. Change the gray level,
inew = C(iold)×255

14

7
Equalized-Histogram Intensity
Low-Contrast
Number of Pixel

Histogram
#4
#3
#1
#2 #5
Cumulative Probability

Percent of 255 (×100)


1
0 Intensity 255

Higher-Contrast

Number of Pixel
0 Histogram
0 Intensity 255 #4
#3
#1
#2
#5

0 New Intensity 255


15

MATLAB Toolbox Function (Cont’d)


• histeq()

I histeq(I) 16

You might also like