einführung visual computing€¦ · point operations point operations perform a mapping of the...

62
Einführung in Visual Computing U it11 P i tO ti Unit 11: PointOperations http://www.caa.tuwien.ac.at/cvl/teaching/sommersemester/evc Content: Introduction to Point Operations Operations Histogram Histogram Normali ation Histogram Normaliz ation Histogram Equalization 1 Robert Sablatnig, Computer Vision Lab, EVC11: Point Operations

Upload: others

Post on 01-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Einführung in Visual Computing U it 11 P i t O tiUnit 11: Point Operations

http://www.caa.tuwien.ac.at/cvl/teaching/sommersemester/evc

Content: Introduction to Point OperationsOperations

HistogramHistogram Normali ation Histogram Normalization

Histogram Equalization

1 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 2: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operationsp

mainly applied in the pre‐processing step:  Intensity of a new pixel is dependent on the original pixel only: Intensity of a new pixel is dependent on the original pixel only:  Example: Inversion, Threshold, Brightness Enhancement, Contrast EnhancementContrast Enhancement…

2 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 3: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operationsp

Point Operations perform a mapping of the pixel values without changing the size, geometry, or local structure of the imageg g , g y, g

Each new pixel value I’(u,v) depends on the previous value I(u,v)at the same position and on a mapping function f()at the same position and on a mapping function f()

The function f() is independent of the coordinatesS ch operation is called “homogeneo s” Such operation is called “homogeneous”

3 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 4: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operationsp

4 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 5: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operationsp

Example of homogeneous point operations: Modifying image brightness or contrast Modifying image brightness or contrast Applying arbitrary intensity transformation (curves)Q ti i ( t i i ) i Quantizing (posterizing) images

Global thresholding Gamma correction Color transformations

5 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 6: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Definition of Point Operationsp

New intensity value (gray‐level) of a pixel only depends on the previouslvalue.

Transformation is performed on the pixel intensity value using apixel intensity value using a mapping function: linear or  non‐linear.

Mapping is usually implemented pp g y pwith look‐up tables (LUT).

Following functions are possible: Linear stepwise linear I‘(u,v) ← a · I (u,v) + b non‐linear

6 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 7: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Identity Functionp y

The identity function does not alter any pixel values. 

Before:

I‘(u,v) ← a · I (u,v) + by p

After:

7 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = 1, b = 0

Page 8: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Inversion Functionp

Inversion means that dark become bright and vice versa.

Before:

gI‘(u,v) ← a · I (u,v) + b

After:

8 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = ‐1, b = q = 255

Page 9: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Example: Inversion Transformationp

Fi i f lid G l / W d DIP b k b i (Ch 3)Figure is from slides at Gonzalez/ Woods DIP book website (Chapter 3)

Page 10: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Inversion Transformation

Inverting Images

I‘(u,v) ← −I(u,v) + q = q − I(u, v).

Page 11: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Threshold Operationp

Thresholding an image is a special type of quantization that separates the pixel values in two classes, depending on a given p p , p g gthreshold value pth

The threshold function maps all the pixels to one of two fixedThe threshold function maps all the pixels to one of two fixed intensity values po, p1

0 < pth ≤ pmax

Example: binarization: po=0, p1=1

11 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 12: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Threshold Operationp

pthp1

p0

12 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Histograms

Page 13: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Threshold Functionp

Before: Thresholding means a reduction to only two different color levels 

Before:

yupon a certain threshold value.

After:

13 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 14: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Gray Level Reduction F nctionFunction

Before: Gray‐level reduction reduces the number of intensity levels (e.g. 4 

Before:

y ( gdifferent levels).

After:

14 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 15: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Brightness Increasing F nctionFunction

Before:Before: Generally the intensity values are increased. Note: Clipping may occur.

Before:Before:

pp g yI‘(u,v) ← a · I (u,v) + b

After:After:

15 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = 1, b = 90

Page 16: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Brightness Reducing F nctionFunction

Before: Generally the intensity values are reduced

Before:

I‘(u,v) ← a · I (u,v) + b

After:

16 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = 1, b = ‐90

Page 17: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Contrast Enhancing F nctionFunction

Before: Intensity value that formerly were close together are now further apart 

Before:

(spreading). Note: Clipping may occur.I‘(u,v) ← a · I (u,v) + b

After:

17 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = 0,01, b = 1

Page 18: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Contrast Reducing Functionp g

Before: Intensity value that formerly were wider apart are now closer (narrowing). The resulting 

Before:

( g) gimage does not contain the full intensity range.

I‘(u,v) ← a · I (u,v) + b

After:

18 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

a = 90, b = 1

Page 19: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Point Operations: Gamma Correcting F nctionFunction

Before: Example of a non‐linear mapping function.

Before:

After:

19 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 20: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Photoshop: Image ‐ Adjustments ‐ Curvesp g j

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations20

Page 21: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram

Page 22: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

The histogram function is defined over all possible intensity levels.  For each intensity level its value is equal to the number of the For each intensity level, its value is equal to the number of the pixels with that intensity.

Consider a 5x5 image with integer intensities in the range Consider a 5x5 image with integer intensities in the range between one and eight: 

1   8   4   3   4 1 1 1 7 81   1   1   7   88   8   3   3   12 2 1 5 22   2   1   5   21   1   8   5   2

22 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 23: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Examplep

1   8   4   3   4 1   1   1   7   88   8   3   3   12   2   1   5   21   1   8   5   2

1      2      3        4       5       6     7       8

23 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 24: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Functiong

H(x) = card{(u,v) | I(u,v)=k}, k {0,...,q}

1n 2n 3n 4n 5n 6n 7n 8n

f )( kk nrf )(

1 2 3 4 5 6 7 81      2      3     4      5      6      7     8

Page 25: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Functiong

8)( rf4)(8)(

2

1

rfrf

1n 2n 3n 4n 5n 6n 7n 8n

3)(3)(

4

3

rfrf

0)(2)(

)(

5

4

f

rff

1)(0)(

7

6

rfrf

1 2 3 4 5 6 7 85)( 8 rf

1      2      3     4      5      6      7     8

Page 26: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

Assume that the digital image has q discrete gray levels and that nk, k = 0, ..., q‐1, is the number of pixel having intensity k. The histogram is given by:

nrhrp kkk

)()(

where p is the normalized histogram function, n the total number 

nn

of image pixels. nk are the number of pixels in the bin assigned to pixels with intensity level k.

It gives a measure of how likely is for a pixel to have a certain intensity. That is, it gives the probability of occurrence the intensityintensity.

The sum of the normalized histogram function over the range of all intensities is 1all intensities is 1.

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations26

Page 27: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

The histogram function can be plotted graphically. The image histogram carries g p y g gimportant information about the image content.

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations27

Page 28: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

Distribution of gray‐levels can be judged by measuring a histogram:g g For B‐bit image, initialize q=2B counters with 0 Loop over all pixels x y Loop over all pixels x,y When encountering gray level f(rk)=i, increment co nter rincrement counter rk

Histogram can be interpreted as an estimate of h b bili d i f i ( df) f hthe probability density function (pdf) of the underlying random process.

You can also use fewer, larger bins to trade off amplitude resolution against sample size.

28 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 29: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

Histogram on the right corresponds to the image on the left. It is a statistical measure of the occurrence of different color levels.

29 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 30: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

R h l i f f f h i Represents the relative frequency of occurrence of the various gray levels in the image For each gray level count the # of pixels having that level For each gray level, count the # of pixels having that level Can group nearby levels to form a big bin & count #pixels in it

( From Matlab Image Toolbox Guide Fig.10‐4 )

30 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 31: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram (cont’d)g ( )

Interpretation   Treat pixel values as random variables p Histogram is an estimate of the probability distribution

“Unbalanced” histogram does not fully utilize the dynamic rangeUnbalanced  histogram does not fully utilize the dynamic range Low contrast image ~ histogram concentrating in a narrow luminance rangeu a ce a ge

Under‐exposed image ~ histogram concentrating on the dark side

Over‐exposed image ~ histogram concentrating on the bright side

Balanced histogram gives more pleasant look and reveals rich content

31 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 32: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Example: Balanced and Unbalanced HistogramsHistograms  

Figure is from slides at Gonzalez/ Woods DIP book website (Chapter 3)

32 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 33: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram and Point Operationg p

Relationship Histogramm – Position in image Anges in histogrammwill change image content irreversively Anges in histogramm will change image content irreversively

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations33

Page 34: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

If pixel values are concentrated in the low image densities the image appears dark.

If the intensity values are not spread entirely over the possible intensity interval the image is said to be of low contrast.

34 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 35: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

If the intensity values are spread entirely over the possible intensity interval the image is said to be rich of contrast.y g

35 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 36: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogramg

If the image histogram is concentrated on a small intensity region, the image contrast is poor and the subjective image quality is low.g p j g q y

Image quality can be enhanced by modifying its histogram This Image quality can be enhanced by modifying its histogram. This can be done in two ways:Histogram Normali ation (Stretching) Histogram Normalization (Stretching)

Histogram Equalization

36 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 37: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Color Histogramg

Histograms can be computed for each channel of a color image. 

The luminance channel the average of red, green and blue in this case.

37 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 38: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Photoshop: Image ‐ Adjustments ‐ Levelsp g j

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations38

Page 39: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Normalization

Page 40: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Normalizationg

40 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 41: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Normalizationg

Goal: utilization of the complete gray level rangep g y g

=> linear spreading of gray => linear spreading of gray levels to the complete gray level range

originallevel range

)(I

minmax

min),(),('qqqvuIqvuI

stretched

41 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 42: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Contrast Stretching: Exampleg p

h doriginal stretched

42 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 43: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Contrast Stretching for Low‐Contrast Imagesg g

Stretch the over‐concentrated graylevels in histogram via a nonlinear mappingpp g Piece‐wise linear stretching function

)( qvuImin

minmax

minminmax

),()(),(' pqqqvuIppvuI

43 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 44: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Photoshop: Image ‐ Adjustments ‐ Levelsp g j

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations44

Page 45: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization

Page 46: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalizationg q

Histogram equalization is an approach to enhance a given image. The approach is to design a transformation T(.) such that the gray pp g ( ) g yvalues in the output is uniformly distributed in the interval [0, 1].

We can use the normalised histogram function to compute an intensity transformation function giving a more uniform e s y a s o a o u c o g g a o e u odistribution of the intensities. 

46 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 47: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalizationg q

Histogram equalization algorithm: Let rk , k = 1,2,....,n be the intensities of the image, and let p(rk) be its normalised histogram  function. 

nnrp k

k )(

The intensity transformation function for histogram equalisation is 

k

T )()(

Th t i dd th l f th li d hi t f ti f 1

j

kk rprT1

)()(

That is, we add the values of the normalised histogram function from 1 to k to find where the intensity rk will be mapped. 

Notice that the range of the equalized image is the interval [0,1].

47 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 48: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalizationg q

Let r(x y) be a gray level image whose minimum intensity value is r and Let r(x,y) be a gray‐level image whose minimum intensity value is rmin and maximum intensity value rmax. The dynamic range of the image ∆r is:       ∆r = rmax‐ rmin.

The Probability Function (PF) of the image r(x,y) is p(r = a) = pr(a). With a probability of pr(a) the image takes a gray‐level equal to the value of a.

Histogram equalizationmeans that we need to find a intensity level Histogram equalization means that we need to find a intensity level transforming function T(a) that for the transformed image r‘(x,y) can be computed as ))(()(' yxrTyxr

T(a) is chosen in way that the probability function pr‘ (a) of the transformed image r‘(x,y) has a predefined shape.

)),((),( yxrTyxr

transformed image r (x,y) has a predefined shape.

pr(a) pr‘ (a) 

48 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 49: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

Do histogram equalization on the 5x5 image with integer intensities in the range between one and eight:g g

1   8   4   3   41 1 1 7 81   1   1   7   88   8   3   3   12   2   1   5   21   1   8   5   2

49 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 50: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

1   8   4   3   4

25 values 1/25 = 0 04

1   1   1   7   88   8   3   3   12   2   1   5   2 1/25 = 0.04

Intensity transformation functionNormalised 

histogram functionHistogram function

1   1   8   5   2

16.0)(32.0)(

2

1

rprp

480160320)(32.0)(

2

1

rTrT

yhistogram function

4)(8)(

2

1

rfrf

function

080)(12.0)(16.0)(

3

2

rprprp

680080120160320)(60.012.016.032.0)(

48.016.032.0)(

3

2

rTrTrT

2)(3)(4)(

3

2

rfrfrf

000)(08.0)(08.0)(

5

4

rprprp

)()(

68.008.012.016.032.0)(

5

4

rTrTrT

0)(2)(2)(

5

4

rfrfrf

200)(04.0)(00.0)(

7

6

rprprp

)()()(

7

6

TrTrT

5)(1)(0)(

7

6

frfrf

20.0)( 8 rp )( 8rT5)( 8 rf

50 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 51: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

1   8   4   3   41   1   1   7   88   8   3   3   12   2   1   5   2

Intensity transformation functionNormalised 

histogram function

1   1   8   5   2

160)(32.0)( 1

rprp

Intensity transformation functionhistogram function

480)(32.0)(

2

1

rTrT

080)(12.0)(16.0)(

3

2

rprprp

680)(60.0)(48.0)(

3

2

rTrTrT

000)(08.0)(08.0)(

5

4

rprprp

760)(76.0)(68.0)(

5

4

rTrTrT

200)(04.0)(00.0)(

7

6

rprp

001)(80.0)(76.0)(

7

6

TrTrT

20.0)( 8 rp 00.1)( 8 rT

51 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 52: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

32% of the pixels have intensity r1. We expect them to cover 32% f h ibl i i i320)( rT320)( rp of the possible intensities.

48% f th i l h i t it600)(48.0)(32.0)(

2

1

TrTrT

120)(16.0)(32.0)(

2

1

rprprp

48% of the pixels have intensity r2or less. We expect them to cover 48% of the possible intensities.760)(

68.0)(60.0)(

4

3

TrTrT

080)(08.0)(12.0)(

4

3

rprp

p

60% of the pixels have intensity r376.0)(76.0)(

6

5

rTrT

00.0)(08.0)(

6

5

rprp

p y 3or less. We expect them to cover 60% of the possible intensities.00.1)(

80.0)(

8

7

rTrT

20.0)(04.0)(

8

7

rprp

……………………………

52 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 53: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

53 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 54: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

54 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 55: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

55 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 56: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

Original Goal: Equal Distribution of gray levels over the 

Original

g ycomplete gray level range g

=> Contrast is enhanced at maxima and a a a a dweakened at minima Equalized

56 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 57: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

Original image and its histogram

57 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 58: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Histogram Equalization Exampleg q p

Histogram equalized image and its histogram

58 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 59: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Comments

Histogram equalization may not always produce desirable results, particularly if the given histogram is very narrow. It can produce p y g g y pfalse edges and regions. It can also increase image “graininess” and “patchiness.”p

59 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 60: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Comments

60 Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations

Page 61: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations61

Page 62: Einführung Visual Computing€¦ · Point Operations Point Operations perform a mapping of the pixel values without changgging the size, ggy,eometry, or local structure of the image

Photoshop: Image ‐ Adjustments ‐ Levelsp g j

Robert Sablatnig, Computer Vision Lab, EVC‐11: Point Operations62