You are on page 1of 21

Escuela Profesional de

Ciencia de la Computación

ICC Fase 1

Computer graphics
Histogram Equalization

MSc. Vicente Machaca Arceda

Universidad Nacional de San Agustín de Arequipa

May 6, 2020

MSc. Vicente Machaca Arceda (UNSA) 1704146 1 / 20


Overview

1 Introduction
Objectives
Sample application

2 Point operators
Definition
Histogram Equalization
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 2 / 20


Introduction

Table of Contents

1 Introduction
Objectives
Sample application

2 Point operators
Definition
Histogram Equalization
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 3 / 20


Introduction Objectives

Objectives

Understand the difference between point, local and


operators in image processing.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 4 / 20


Introduction Objectives

Objectives

Understand the difference between point, local and


operators in image processing.
Learn Histogram Equalization method.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 4 / 20


Introduction Sample application

Sample application

Figure: Sample application in pattern recognition


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 5 / 20


Introduction Sample application

Sample application
vmachacaa@unsa.edu.pe

Figure: Sample application in pattern recognition

MSc. Vicente Machaca Arceda (UNSA) 1704146 6 / 20


Point operators

Table of Contents

1 Introduction
Objectives
Sample application

2 Point operators
Definition
Histogram Equalization
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 7 / 20


Point operators Definition

Point operators
Example
vmachacaa@unsa.edu.pe

Figure: Point operator.

MSc. Vicente Machaca Arceda (UNSA) 1704146 8 / 20


Point operators Definition

Point operators
Formal definition

Point operator
O{f [x, y ]} = g[x 0 , y 0 ]
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 9 / 20


Point operators Definition

Point operators
Examples

Thresholding
Contrast Stretching
Histogram Equalization
Logarithm Operator
Exponential/Raise to Power Operator
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 10 / 20


Point operators Histogram Equalization

Histogram Equalization

Figure: Histogram equalization employs a monotonic, non-linear


mapping which re-assigns the intensity values of pixels in the input
vmachacaa@unsa.edu.pe

image such that the output image contains a uniform distribution of


intensities. This technique is used in image comparison processes
(because it is effective in detail enhancement).

MSc. Vicente Machaca Arceda (UNSA) 1704146 11 / 20


Point operators Histogram Equalization

Histogram Equalization
vmachacaa@unsa.edu.pe

Figure: Example of Histogram Equalization.

MSc. Vicente Machaca Arceda (UNSA) 1704146 12 / 20


Point operators Histogram Equalization

Histogram Equalization

g[x, y ] = sf [x,y ]

 
n
X
sn = floor (L − 1) Pn 
j=0

number of pixels with intensity n


Pn =
total number of pixels

n = 0, 1, ..., L − 1
vmachacaa@unsa.edu.pe

Where:
L : Pixel intensity length (256).

MSc. Vicente Machaca Arceda (UNSA) 1704146 13 / 20


Point operators Histogram Equalization

Histogram Equalization

Example: Suppose we have a 3-bits image (L = 8) of 64x64


size (m ∗ n = 4096) which have the distribution:

n histogram pn
0 790 0.19
1 1023 0.25
2 850 0.21
3 656 0.16
4 329 0.08
5 245 0.06
6 122 0.03
vmachacaa@unsa.edu.pe

7 81 0.02

MSc. Vicente Machaca Arceda (UNSA) 1704146 14 / 20


Point operators Histogram Equalization

Histogram Equalization
n
X
sn = (L − 1) Pn
j=0

n
X
s0 = (7) Pr (rj ) = 7P0 = 7(0.19) = 1.33
j=0

n
X
s1 = (7) Pr (rj ) = 7(P1 + P0 ) = 3.08
j=0

s2 = 4.55
s3 = 5.67
vmachacaa@unsa.edu.pe

s4 = 6.23
s5 = 6.65
s6 = 6.86
s7 = 7.00
MSc. Vicente Machaca Arceda (UNSA) 1704146 15 / 20
Point operators Histogram Equalization

Histogram Equalization

Values sk : Floor:
s0 = 1.33 s0 = 1
s1 = 3.08 s1 = 3
s2 = 4.55 s2 = 4
s3 = 5.67 s3 = 5
s4 = 6.23 s4 = 6
s5 = 6.65 s5 = 6
s6 = 6.86 s6 = 6
s7 = 7.00 s7 = 7
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 16 / 20


Point operators Histogram Equalization

Histogram Equalization
Example
vmachacaa@unsa.edu.pe

Figure: Example of Histogram Equalization.

MSc. Vicente Machaca Arceda (UNSA) 1704146 17 / 20


Point operators Histogram Equalization

Histogram Equalization
Local histogram equalization example
vmachacaa@unsa.edu.pe

Figure: Image after histogram


Figure: Original image.
equalization.

MSc. Vicente Machaca Arceda (UNSA) 1704146 18 / 20


Point operators Histogram Equalization

Histogram Equalization
Local histogram equalization example
vmachacaa@unsa.edu.pe

Figure: Sub image use to Figure: Image after local


compute sn . histogram equalization.

MSc. Vicente Machaca Arceda (UNSA) 1704146 19 / 20


Point operators Histogram Equalization

Questions?
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 20 / 20

You might also like