Image Processing. Processing Digital Images digital images are often processed using “digital...

Post on 17-Dec-2015

229 views 1 download

Tags:

Transcript of Image Processing. Processing Digital Images digital images are often processed using “digital...

Image ProcessingImage Processing

Processing Digital Images

• digital images are often processed using “digital filters”

• digital filters are based on mathematical functions that operate on the pixels of the image

MotionMotionFilterFilter

2 Classes of Digital Filters

• Global filters transform each pixel uniformly according to the function regardless of its location in the image

• Local filters transform a pixel depending upon its relation to surrounding ones

Global Filters

Brightness and Contrast control

• Histogram thresholding

• Histogram stretching or equalization

• Color corrections

• Inversions

Contrast and Brightness functions

• like the knobs on your TV set

Input Image Scale

Out

put I

mag

e S

cale

Input Image ScaleO

utpu

t Im

age

Sca

le

Contrast

Knob

Brightnesss

Knob

Contrast and Brightness functions

• like the knobs on your TV set

Input Image Scale

Out

put I

mag

e S

cale

Increase Increase

Slope Contrast

Input Image ScaleO

utpu

t Im

age

Sca

le

Contrast

Knob

Brightnesss

Knob

Contrast and Brightness functions

• like the knobs on your TV set

Input Image Scale

Out

put I

mag

e S

cale

Increase Increase

Slope Contrast

Input Image ScaleO

utpu

t Im

age

Sca

le

Increase Increase

Offset Brightness

Contrast

Knob

Brightnesss

Knob

Increasing Contrast

How Contrast Functions Work

• Index into the Input Array

of brightness (index = brightness)

• Get the corresponding

brightness value from

the Output Array

• What does this function do?

Brightness

Input Output0 01 12 23 34 45 56 6. .. .

255 255

What would this function do?Brightness

Input Output0 01 02 13 14 35 36 4. .. .

255 255

Increasing Brightness

What would this function do?Brightness

Input Output0 81 92 103 114 125 136 14. .. .

255 255

Contrast & Brightness Demo

• Photoshop– Image->Adjust->Brightness/Contrast– Image->Adjust->Curves (more advanced)

Global Filters

• Brightness and Contrast controlHistogram thresholding

• Histogram stretching or equalization

• Color corrections

• Inversions

Histogram Thresholding

• thresholding creates a binary image by converting pixels according to a threshold value

Thresholding Demo

• Photoshop– Image->Adjust->Threshold

Global Filters

• Brightness and Contrast control

• Histogram thresholdingHistogram stretching or equalization

• Color corrections

• Inversions

Histogram Stretching

The Algorithmfor Histogram Stretching

Find darkest pixel = D

Find lightest pixel = L

Let max possible pixel value = M

Then the new value for every pixel in the image

is:

New pixel value = x M(Old pixel value – D) (L – D)

Histogram Equalization

Can you read this?

Histogram Equalization

Now can you read this?

Histogram Equalization Demo

• Photoshop– Image->Adjust->Equalize– Image->Adjust->Levels (more advanced)

Global Filters

• Brightness and Contrast control

• Histogram thresholding

• Histogram stretching or equalizationColor corrections

• Inversions

Color Corrections

• Making changes to the colors in an image

- Hue shifting

- Pseudo coloring

• Performed by manipulation of re-mapping functions

Hue-shifting

• Hue-shifting is used to modify the color makeup of an image

Hue-shifting Demo

• Photoshop– Image->Adjust->Hue/Saturation

Pseudo-coloring

• Pseudo-coloring can be used to add color to grayscale images

• Different colors are assigned to each level of gray

Pseudo-coloring Demo

• Photoshop– Image->Adjust->Gradient Map

Global Filters

• Brightness and Contrast control

• Histogram thresholding

• Histogram stretching or equalization

• Color correctionsInversions

Inversions

Inversion Demo

• Photoshop– Image->Adjust->Invert

Review

• Global Filters- Contrast & Brightness Control

- Thresholding- Histogram stretching & equalization

- Color corrections- Inversion