32
HISTOGRAM BASED ENHANCEMENT SUBMITTED BY, LIBA MANOPRIYA.J IDHAYA.T KARTHIKA.S GREESHMA.L.B

Histogram based enhancement

Embed Size (px)

Citation preview

Page 1: Histogram based enhancement

HISTOGRAM BASED ENHANCEMENT

SUBMITTED BY,

LIBA

MANOPRIYA.J

IDHAYA.T

KARTHIKA.S

GREESHMA.L.B

Page 2: Histogram based enhancement

IMAGE HISTOGRAM Acts as a graphical representation of

the lightness/color distribution in a digital image.

Shows how many times a particular gray level (intensity) appears in an image.

It plots the number of pixels for each value.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

1

Page 3: Histogram based enhancement

WHY HISTOGRAM? Information derived from histograms

are useful in image processing application.

Provides an visual information for evaluating statistical properties of the image.

Histogram reveals the object is under-exposed or over-exposed.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

2

Page 4: Histogram based enhancement

4

UNDER-EXPOSED IMAGE

0 50 100 150 200 250

0

0.5

1

1.5

2

2.5

3

3.5

4

x 104

Histogram information reveals that image is under-exposed

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

3

Page 5: Histogram based enhancement

OVER-EXPOSED IMAGE

0 50 100 150 200 250

0

1000

2000

3000

4000

5000

6000

7000

Histogram information reveals that image is over-exposed

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

4

Page 6: Histogram based enhancement

HISTOGRAM PROCESSING The histogram of a digital image with

gray levels in the range [0, L-1] Discrete function:

h(rk) = nk

rk - kth gray level nk - number of pixels in the image having gray level rk.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

5

Page 7: Histogram based enhancement

Most of the histogram components are localized in the low intensity values .

Not making dynamic range of pixels.

EXAMPLE OF HISTOGRAM-1

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

6

Page 8: Histogram based enhancement

Histogram components are localized to high intensity values. Not making dynamic range of pixels.

EXAMPLE OF HISTOGRAM-2

Bright image

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

7

Page 9: Histogram based enhancement

Most of the histogram components are localized in the middle region intensity values.

Not making dynamic range of pixels.

EXAMPLE OF HISTOGRAM-3

Low contrast image

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

8

Page 10: Histogram based enhancement

High contrast image components are spread dynamically .

EXAMPLE OF HISTOGRAM-4

High contrast image

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

9

Page 11: Histogram based enhancement

EXAMPLE OF HISTOGRAM-4 In histogram-4 components are distributed over

all the intensity range. Distribution is almost uniform with few peaks. If the distribution is uniform , the image tends to

have a high dynamic range and the details are more easily perceived.

Proved that high contrast image gives better visual appearance.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

10

Page 12: Histogram based enhancement

HISTOGRAM PROCESSING

Histogram Equalization Histogram Matching/Specification Local Histogram Processing

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

11

Page 13: Histogram based enhancement

HISTOGRAM EQUALIZATION

Techniques for adjusting image intensities to enhance contrast.

Used to improve the visual appearance of an image.

Spread out the frequencies in an image (or equalizing image) is a simple way to dark or washed out images.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

12

Page 14: Histogram based enhancement

HOW TO IMPLEMENT HISTOGRAM EQUALIZATION?

Step 1:For images with discrete gray values, compute:

nnrp k

k )( 10 kr 10 Lk

L: Total number of gray levels

nk: Number of pixels with gray value rk

n: Total number of pixels in the image

Step 2: Compute the discrete version of the previous transformation :

k

jjrkk rpLrTs

0

)()1()( 10 Lk

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

13

Page 15: Histogram based enhancement

EXAMPLE-1· Consider an 8-level 64 x 64 image with gray values (0, 1, …,7). The normalized gray values are (0, 1/7, 2/7, …, 1). n= 64 x 64 =4096.The normalized histogram is given below:

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

14

Page 16: Histogram based enhancement

APPLYING THE TRANSFORMATION

k

jrr

k

jrr

k

jrr

k

jrr

k

jrr

k

jrr

k

jrrr

k

jrr

rpsrprTs

rpsrprTs

rpsrprTs

rpsrprTs

rpsrprTs

rpsrprTs

rprprprTs

rprprTs

076777

065666

054555

04444

03333

01222

010111

00000

700.7)02.0(786.6)(7)(7)(

786.6)03.0(765.6)(7)(7)(

765.6)06.0(723.6)(7)(7)(

623.6)08.0(767.5)(73)(7)(

667.5)16.0(755.4)(72)(7)(

555.4)21.0(708.3)(71)(7)(

308.3)25.0(733.1)(7)(7)(7)(

133.1)19.0(7)(7)(7)(

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

15

Page 17: Histogram based enhancement

CALCULATION r0=0 was mapped to s0=1,there are 790 pixels(nk). r1=1 was mapped to s1=3,there are 1023 pixels. r2=2 was mapped to s2=5,there are 850 pixels. r3 and r4 were mapped to the same value, so there are

(656+329)=985 pixels with a value of 6. r5,r6 and r7 were mapped to the same value, so there are

(245+122+81)=448 pixels with a value of 7. Dividing all these pixels by n=4096 yielded the equalized

histogram.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

16

Page 18: Histogram based enhancement

EQUALIZATION OF A DISCRETE RANDOM VARIABLE

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

17

Page 19: Histogram based enhancement

ORIGINAL IMAGE HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

18

Page 20: Histogram based enhancement

TRANSFORMATION FUNCTION

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

19

Page 21: Histogram based enhancement

EQUALIZED HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

20

Page 22: Histogram based enhancement

ORIGINAL IMAGE AND ITS HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

21

Page 23: Histogram based enhancement

HISTOGRAM EQUALIZED IMAGE AND ITS HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

22

Page 24: Histogram based enhancement

HISTOGRAM SPECIFICATION/MATCHING Equalize the levels of the original image. Histogram matching is the transformation of an image. The process of Histogram Matching takes in an input image and

produces an output image that is based upon a specified histogram.

The well-known histogram equalization method is a special case in which the specified histogram is uniformly distributed.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

23

Page 25: Histogram based enhancement

HISTOGRAM SPECIFICATION/MATCHING Sometimes, this may not be desirable. Instead, we

may want a transformation that yields an output image with a pre-specified histogram.

Applying the transformation H to the original image yields an image with histogram .

Again, the actual histogram of the output image does not exactly but only approximately matches with the specified histogram. This is because we are dealing with discrete histograms.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

24

Page 26: Histogram based enhancement

EXAMPLE: HISTOGRAM MATCHINGSuppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in the following table (on the left). Get the histogram transformation function and make the output image with the specified histogram, listed in the table on the right.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

25

Page 27: Histogram based enhancement

EXAMPLE: HISTOGRAM MATCHING

(a) Original image histogram (b) Specified histogram

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

26

Page 28: Histogram based enhancement

ORIGINAL IMAGE AND ITS HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

27

Page 29: Histogram based enhancement

HISTOGRAM SPECIFIED IMAGE AND ITS HISTOGRAM

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

28

Page 30: Histogram based enhancement

LOCAL HISTOGRAM PROCESSING

To enhances an image with low contrast, using a method called local histogram equalization, which spreads out the most frequent intensity values in an image.

Define a neighborhood and move its center from pixel to pixel. At each location, the histogram of the points in the neighborhood is

computed. Either histogram equalization or histogram specification transformation function is obtained.

Map the intensity of the pixel centered in the neighborhood. Move to the next location and repeat the procedure.

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

29

Page 31: Histogram based enhancement

EXAMPLE

(a) Original (b) Equalized (c) Locally equalized

M . PHIL (C.S).M.S.UNIVERSITY,THIRUNELVELI

30

Page 32: Histogram based enhancement

Thank you