You are on page 1of 30

Image Processing:

Point Operators

Introduction du Point Operators


Histograms of Monochrome Images
Transformation Functions
Brightness and Contrast Change
Histogram Equalization
Histograms of Color Images
Color Transformation
Multiple Image Point Operations

Image processing operations

Classification of image processing operations


Point operation
Local operation
Global operation

2004 Rolf Ingold, University of Fribourg

List of point operations (non exhaustive)

on single GL images
inversion
brightness / contrast control
histogram equalization
thresholding
on single RGB images
bank operations (inversion, brightness / contrast control, histogram equalization, ...)
hue / saturation / value control
linear RGB transformations (chanel mixture)
non-linear color corrections (curves)
selective color transformations
combining several images
logical operations (on binary images)
arithmetical operations (addition, subtraction, linear combinations)
minimum / maximum operations
composition (with mask)
on multiple images
averaging, median filtering

2004 Rolf Ingold, University of Fribourg

Image histogram

The histogram of an image is a statistical table that provides the


number of pixels of each pixel class
Hist I ( z ) = Card {[ x, y ] I [ x, y ] = z}

It gives valuable information about


the overall intensity
the contrast
color distribution
It is easily computed by scanning the image and incrementing
counters associated to each pixel value

2004 Rolf Ingold, University of Fribourg

Histogram of gray level images

The histogram of a gray level image is a 1D array


which can be displayed as a bar graph

2004 Rolf Ingold, University of Fribourg

Histogram interpretation

Histograms provide information about the visual features :


Luminosity is represented by the histogram mean

LumI =

n 1
1
Size I

z Hist I (z )

z =0

Contrast is measured by its standard deviation

Contr I =

n1
1
SizeI

(z LumI )

Hist I (z )

z= 0

Dynamics is determined by the histogram range

Dyn I = Max{z| Hist I ( z ) 0} Min{z| Hist I ( z) 0}

2004 Rolf Ingold, University of Fribourg

Transformation function

A point operation is defined by a transformtion function z = f(u) where

u is a pixel value of the source image


z the correponding pixel value of the result image
J [ x, y ] = f ( I [ x, y ])

2004 Rolf Ingold, University of Fribourg

Continuous and Discrete Domains

Domain conversion is needed since


transformation functions of point operations are usually expressed
in a continuous space (usually [0,1[ )
pixel values belong to a discrete space (for instance 0..n-1)
The following formulas will be (implicitely) applied
to convert a pixel value k to a real intensity z
z = Realn (k ) =

1 + 2k
2n

to convert an intensity z to a quantizied pixel value k


k = Quant n ( z ) = Round( nz 12 ) = Floor(nz )

2004 Rolf Ingold, University of Fribourg

Inversion

The inverted image (negative) is obtained by applying the


transformation function
f (u ) = 1 u
expressed on the image, we get
J [ x, y ] = Quant n (1 Realn ( I [ x, y ]))

INV

2004 Rolf Ingold, University of Fribourg

Brightening

Brightening is obtained by adding a constant c and taking care of


owerflows
u + c if u + c 1
f (u ) =
else
1
expressed on the image, we get
J [ x, y ] = Quant n (Min(Realn ( I [ x, y ] + c,1)))

Lighter

2004 Rolf Ingold, University of Fribourg

Darkening

Darkening is obtained by subtracting a constant c and taking care of


underflows
u c if u c 0
f (u ) =
else
0
expressed on the image, we get
J [ x, y ] = Quant n (Max(Realn ( I [ x, y ] c, 0)))

Darker

2004 Rolf Ingold, University of Fribourg

Combining Brightening and Darkening

First brightening then darkening (or the opposite) may result in


dynamics loss !
the phenomenon is due to white (or black) saturation

2004 Rolf Ingold, University of Fribourg

Contrast change

Contrast change is obtained by multiplying the intensities by a


constant c

c > 1 for contrast enhancement


c < 1 for contrast reduction

To compensate brightness changes, a term must be added


simultaneously

> 0 for contrast reduction


< 0 for contrast enhancement

To maintain brightness, should be chosen according to the image


luminosity LumI
J [ x, y ] = Quant n (c Realn ( I [ x, y ]) + lumI (1 c))

2004 Rolf Ingold, University of Fribourg

Contrast changes : examples

LessContr

MoreContr u
2004 Rolf Ingold, University of Fribourg

Combining contrast changes

Contrast changes are generally not reversible


contrast enhancement produce white and black saturation
contrast reduction produce loss of gray level shades

2004 Rolf Ingold, University of Fribourg

Histogram Equalization : Continuous Case

The goal is to find a monotonic transformation function f, so that J = f(I)


has a uniform histogram
In a continuous domain, we suppose
pI and pJ to represent respectively the density functions of I and J
FI and FJ to be the distribution functions of I and J
then we have
F I (u) =F J ( T(u))

pI ( u) = pJ (T( u)) T' (u)

T' (u) = pI (u)


T( u) = F I ( u)

Thus, the transformation function to be used is the distribution


function of the source image

2004 Rolf Ingold, University of Fribourg

Histogram Equalization : Discrete Case

In the discrte space, histogram equalization is performed by


computing the cumulative histogram
CHist I (u) =

Hist I (w)

w=0

and using it to compute the result image


J [ x, y ] = Quant n (CHist ( I [ x, y ]) / Size)

where Size represents the size (number of pixels)

2004 Rolf Ingold, University of Fribourg

Histogram Equalization : Example

The histogram of the result image is not exactly flat !


however, it can
be considered
the closest one
statistically
to get a flat
histogram,
supernumerary
pixel values
must be partly
changed to
neighbour
values

2004 Rolf Ingold, University of Fribourg

Thresholding

Thresholding produces a binary image according to a threshold value


0 I [u , v] < t
J [ x, y ] =
1 I [u , v] t
z

Threshold u

More sophisticated algorithms are needed


for image segmentation
for printing

2004 Rolf Ingold, University of Fribourg

3D color histograms

The color histogram of a RGB image is a sparse 3D array


it can be represented by a 3D color plot
alternatively, 2D or 1D projections may be used

2004 Rolf Ingold, University of Fribourg

1D Histograms of Color Images

Instead of 3D color histograms, three (one


for each color bank) independent 1D
histograms are often used
it correponds to projection of the color
histogram on the R, G, B axis
primary color correlation is lost !

2004 Rolf Ingold, University of Fribourg

Color transfomations

Some operations discussed on gray level images may be applied


bankwise or globally on RGB images
inversion
brightness and contrast control
linear RGB transformation
Many operations are expressed in HSV or other color spaces
hue transformations
saturation transformations

2004 Rolf Ingold, University of Fribourg

Examples of RGB Transformations

Inversion, brightness/contrast changes, equalization, non linear transf.

2004 Rolf Ingold, University of Fribourg

Linear RGB Transformations

Linear combinations with only positive components

and with negative components

2004 Rolf Ingold, University of Fribourg

Hue / Saturation Changes

Hue/saturation transformations are computed in the HSV color space

2004 Rolf Ingold, University of Fribourg

Multiple Image Point Operations

Point operations may be defined on two source images I and J in order


to produce a result image K
logical operations (for binary images)
arithmetical operations (addition, subtraction, ...)
minimum / maximum operations
...
Some operations may use additional pixel based parameters which are
considered as mask layers
layer based image compositions
layer based color transformations

2004 Rolf Ingold, University of Fribourg

Arithmetical operations

Pixel values of two source images are added together or subtracted


from each other
the sum of two images is defined as
K [ x, y ] = Quant n ( 12 (Realn ( I [ x, y ]) + (Realn ( J [ x, y ]))
the difference of two images is defined as
K [ x, y ] = Quant n ( 12 (Realn ( I [ x, y ]) (Realn ( J [ x, y ] + 1))
a scale factor and an offset are needed to adjust the result !

from left to right : I, J, I+J, IJ


2004 Rolf Ingold, University of Fribourg

Linear Combinations

The previous operations can be generalized to linear combinations


the combination of a times I and b times J is defined as
K [ x, y ] = Quant n ( s (a Realn ( I [ x, y ]) + b Realn ( J [ x, y ])) + t )
where

s=

1
a+b

t=

1
( a + b ( a + b) )
2

from left to right : I, J, 2I+3J, J4I

2004 Rolf Ingold, University of Fribourg

Layer Based Image Composition

2004 Rolf Ingold, University of Fribourg

Layer Based Color Transformations

2004 Rolf Ingold, University of Fribourg

You might also like