imgp roc 03 point op

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

Upload: pa-ra

Post on 11-Jan-2016

220 views

Category:

Documents


0 download

DESCRIPTION

Basic image processing operators

TRANSCRIPT

Page 1: Imgp Roc 03 Point Op

Image Processing:Point Operators

Introduction du Point OperatorsHistograms of Monochrome ImagesTransformation FunctionsBrightness and Contrast ChangeHistogram EqualizationHistograms of Color ImagesColor TransformationMultiple Image Point Operations

Page 2: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Image processing operations

Classification of image processing operations

Point operation

Local operation

Global operation

Page 3: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

List of point operations (non exhaustive)

on single GL imagesinversionbrightness / contrast controlhistogram equalizationthresholding

on single RGB imagesbank operations (inversion, brightness / contrast control, histogram equalization, ...)hue / saturation / value controllinear RGB transformations (chanel mixture)non-linear color corrections (curves)selective color transformations

combining several imageslogical operations (on binary images)arithmetical operations (addition, subtraction, linear combinations)minimum / maximum operationscomposition (with mask)

on multiple imagesaveraging, median filtering

Page 4: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Image histogram

The histogram of an image is a statistical table that provides thenumber of pixels of each pixel class

It gives valuable information about the overall intensitythe contrastcolor distribution

It is easily computed by scanning the image and incrementingcounters associated to each pixel value

{ }zyxIyxCardzHistI == ],[],[)(

Page 5: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Histogram of gray level images

The histogram of a gray level image is a 1D arraywhich can be displayed as a bar graph

Page 6: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Histogram interpretation

Histograms provide information about the visual features :Luminosity is represented by the histogram mean

Contrast is measured by its standard deviation

Dynamics is determined by the histogram range

LumI = 1SizeI

z ⋅HistI (z )z =0

n −1

Contr I = 1SizeI

2(z − LumI ) ⋅HistI (z )z=0

n−1

DynI = Max{z| HistI (z ) ≠ 0}− Min{z| HistI (z) ≠ 0}

Page 7: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Transformation function

A point operation is defined by a transformtion function z = f(u) whereu is a pixel value of the source imagez the correponding pixel value of the result image

]),[(],[ yxIfyxJ =

Page 8: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Continuous and Discrete Domains

Domain conversion is needed sincetransformation functions of point operations are usually expressedin a continuous space (usually [0,1[ )pixel values belong to a discrete space (for instance 0..n-1)

The following formulas will be (implicitely) appliedto convert a pixel value k to a real intensity z

to convert an intensity z to a quantizied pixel value kn

kkz n 221)(Real +

==

)Floor()Round()(Quant 21 nznzzk n =−==

Page 9: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Inversion

The inverted image (negative) is obtained by applying thetransformation function

expressed on the image, we get

z

uINV

uuf −=1)(

])),[(Real1(Quant],[ yxIyxJ nn −=

Page 10: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Brightening

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

expressed on the image, we get

z

uLighter

)))1,],[((Min(RealQuant],[ cyxIyxJ nn +=

⎩⎨⎧ ≤++

=else

cuifcuuf

11

)(

Page 11: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Darkening

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

expressed on the image, we get

z

uDarker

⎩⎨⎧ ≥−−

=else

cuifcuuf

00

)(

)))0,],[((Max(RealQuant],[ cyxIyxJ nn −=

Page 12: Imgp Roc 03 Point Op

© 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

Page 13: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Contrast change

Contrast change is obtained by multiplying the intensities by a constant c

c > 1 for contrast enhancementc < 1 for contrast reduction

To compensate brightness changes, a term δ must be addedsimultaneously

δ > 0 for contrast reductionδ < 0 for contrast enhancement

To maintain brightness, δ should be chosen according to the image luminosity LumI

))1(]),[(Real(Quant],[ clumyxIcyxJ Inn −+=

Page 14: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Contrast changes : examples

z

uLessContr

z

uMoreContr

Page 15: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Combining contrast changes

Contrast changes are generally not reversiblecontrast enhancement produce white and black saturationcontrast reduction produce loss of gray level shades

Page 16: Imgp Roc 03 Point Op

© 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 histogramIn a continuous domain, we suppose

pI and pJ to represent respectively the density functions of I and JFI and FJ to be the distribution functions of I and J

then we have

Thus, the transformation function to be used is the distribution function of the source image

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

FI (u) =FJ (T(u))

Page 17: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Histogram Equalization : Discrete Case

In the discrte space, histogram equalization is performed bycomputing the cumulative histogram

and using it to compute the result image

where Size represents the size (number of pixels)

CHist I (u) = HistI (w)w=0

u

)/]),[((Quant],[ SizeyxICHistyxJ n=

Page 18: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Histogram Equalization : Example

The histogram of the result image is not exactly flat !however, it canbe consideredthe closest onestatisticallyto get a flat histogram,supernumerarypixel values must be partlychanged toneighbourvalues

Page 19: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Thresholding

Thresholding produces a binary image according to a threshold value

z

uThreshold

⎩⎨⎧

≥<

=tvuItvuI

yxJ],[1],[0

],[

More sophisticated algorithms are neededfor image segmentationfor printing

Page 20: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

3D color histograms

The color histogram of a RGB image is a sparse 3D arrayit can be represented by a 3D color plot alternatively, 2D or 1D projections may be used

Page 21: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

1D Histograms of Color Images

Instead of 3D color histograms, three (onefor each color bank) independent 1D histograms are often used

it correponds to projection of the colorhistogram on the R, G, B axisprimary color correlation is lost !

Page 22: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Color transfomations

Some operations discussed on gray level images may be appliedbankwise or globally on RGB images

inversionbrightness and contrast controllinear RGB transformation

Many operations are expressed in HSV or other color spaceshue transformationssaturation transformations

Page 23: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Examples of RGB Transformations

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

Page 24: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Linear combinations with only positive components

and with negative components

Linear RGB Transformations

Page 25: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Hue / Saturation Changes

Hue/saturation transformations are computed in the HSV color space

Page 26: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Multiple Image Point Operations

Point operations may be defined on two source images I and J in orderto 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 compositionslayer based color transformations

Page 27: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Arithmetical operations

Pixel values of two source images are added together or subtractedfrom each other

the sum of two images is defined as

the difference of two images is defined as

a scale factor and an offset are needed to adjust the result !

])),[((Real]),[((Real(Quant],[ 21 yxJyxIyxK nnn +=

))1],[((Real]),[((Real(Quant],[ 21 +−= yxJyxIyxK nnn

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

Page 28: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Linear Combinations

The previous operations can be generalized to linear combinationsthe combination of a times I and b times J is defined as

where

)])),[(Real]),[(Real((Quant],[ tyxJbyxIasyxK nnn +⋅+⋅=

( ))(211 babat

bas +−+=

+=

from left to right : I, J, 2I+3J, J−4I

Page 29: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Layer Based Image Composition

Page 30: Imgp Roc 03 Point Op

© 2004 Rolf Ingold, University of Fribourg

Layer Based Color Transformations