Вы находитесь на странице: 1из 39

Graphics

Image Processing

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Overview

Image Representation

What is an image?

Halftoning and Dithering

CGVR

Trade spatial resolution for intensity resolution


Reduce visual artifacts due to quantization

Sampling and Reconstruction

Key steps in image processing


Avoid visual artifacts due to aliasing

cgvr.korea.ac.kr

Graphics Lab @ Korea University

What is an Image?

CGVR

An image is a 2D rectilinear array of pixels

Continuous image

cgvr.korea.ac.kr

Digital image

Graphics Lab @ Korea University

What is an Image?

CGVR

An image is a 2D rectilinear array of pixels

Continuous image

cgvr.korea.ac.kr

Digital image

Graphics Lab @ Korea University

What is an Image?

CGVR

An image is a 2D rectilinear array of pixels

Continuous image

Digital image
A pixel is a sample, not a little square!!

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Image Acquisition

CGVR

Pixels are samples from continuous function

Photoreceptors in eye
CCD cells in digital camera
Rays in virtual camera

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Image Display

CGVR

Re-create continuous function from samples

Example: cathode ray tube

Image is reconstructed
by displaying pixels with
finite area (Gaussian)
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Image Resolution

Intensity resolution

Each pixel has only Depth bits for colors/intensities

Spatial resolution

CGVR

Image has only Width x Height pixels

Temporal resolution

Monitor refreshes images at only Rate Hz

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Sources of Error

Intensity quantization

Not enough intensity resolution

Spatial aliasing

CGVR

Not enough spatial resolution

Temporal aliasing

Not enough temporal resolution

E
2

I x, y Px, y

x, y

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Overview

Image Representation

What is an image?

Halftoning and Dithering

CGVR

Trade spatial resolution for intensity resolution


Reduce visual artifacts due to quantization

Sampling and Reconstruction

Key steps in image processing


Avoid visual artifacts due to aliasing

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Quantization

CGVR

Artifact due to limited intensity resolution

Frame buffers have limited number of bits per pixel


Physical devices have limited dynamic range

255 150
255 255
150 150
75
255 255
150 150
75 750
255 150
255 255
150 150
75 750
255 150
255 255
150 150
75 750
255 150
255 255
150 150
75 750
255 150 75 0
cgvr.korea.ac.kr

75
750

750
750

750
0

0
Blue channel

Green channel

Red channel
Graphics Lab @ Korea University

Uniform Quantization

CGVR

Px, y truncI x, y 0.5

I(x, y)

P(x, y)
2 bits per pixel
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Uniform Quantization

CGVR

Image with decreasing bits per pixel:

8 bits

4 bits

2 bits

1 bit

Notice contouring
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Reducing Effects of Quantization

Halftoning

CGVR

Classical halftoning

Dithering

Random dither
Ordered dither
Error diffusion dither

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Classical Halftoning

CGVR

Use dots of varying size to representation


intensities

Area of dots proportional to intensity in image

I(x, y)

cgvr.korea.ac.kr

P(x, y)

Graphics Lab @ Korea University

Classical Halftoning

CGVR

Newspaper image
From New York Times 9/21/99
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Halftone Patterns

CGVR

Use cluster of pixels to represent intensity

Trade spatial resolution for intensity resolution

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Halftone Patterns

CGVR

How many intensities in a n x n cluster?

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Dithering

CGVR

Distribute errors among pixels

Exploit spatial integration in our eye


Display greater range of perceptible intensities

Original
(8 bits)
cgvr.korea.ac.kr

Uniform
Quantization
(1 bit)

Floyd-Steinberg
Dither
(1 bit)
Graphics Lab @ Korea University

Random Dither

CGVR

Randomize quantization errors

Errors appear as noise

Px, y truncI x, y noisex, y 0.5


cgvr.korea.ac.kr

Graphics Lab @ Korea University

Random Dither

Original
(8 bits)

cgvr.korea.ac.kr

Uniform
Quantization
(1 bit)

CGVR

Random
Dither
(1 bit)

Graphics Lab @ Korea University

Ordered Dither

CGVR

Pseudo-random quantization errors

Matrix stores pattern of thresholds


j = x mod n
i = y mod n
e = I(x, y) trunc(I(x, y))
if( e > D(i, j) )
P(x, y) = ceil(I(x, y))
else
P(x, y) = floor(I(x, y))

cgvr.korea.ac.kr

3 1
D2

0
2

Graphics Lab @ Korea University

Ordered Dither

Original
(8 bits)

cgvr.korea.ac.kr

Uniform
Quantization
(1 bit)

CGVR

Ordered
Dither
(1 bit)

Graphics Lab @ Korea University

Error Diffusion Dither

CGVR

Spread quantization error over neighbor pixels

Error dispersed to pixels right and below

+ + + = 1.0
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Error Diffusion Dither

Original
(8 bits)

cgvr.korea.ac.kr

Random
Dither
(1 bit)

Ordered
Dither
(1 bit)

CGVR

Floyd-Steinberg
Dither
(1 bit)

Graphics Lab @ Korea University

Overview

Image Representation

What is an image?

Halftoning and Dithering

CGVR

Trade spatial resolution for intensity resolution


Reduce visual artifacts due to quantization

Sampling and Reconstruction

Key steps in image processing


Avoid visual artifacts due to aliasing

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Sampling and Reconstruction

CGVR

Sampling

Reconstruction

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Sampling and Reconstruction

cgvr.korea.ac.kr

CGVR

Graphics Lab @ Korea University

Aliasing

In general:

CGVR

Artifacts due to under-sampling or poor


reconstruction

Specifically, in graphics:

Spatial aliasing
Temporal aliasing

Under-sampling
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Spatial Aliasing

CGVR

Artifacts due to limited spatial resolution

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Spatial Aliasing

CGVR

Artifacts due to limited spatial resolution

Jaggies
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Temporal Aliasing

CGVR

Artifacts due to Limited Temporal Resolution

Strobing
Flickering

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Temporal Aliasing

CGVR

Artifacts due to Limited Temporal Resolution

Strobing
Flickering

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Temporal Aliasing

CGVR

Artifacts due to Limited Temporal Resolution

Strobing
Flickering

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Temporal Aliasing

CGVR

Artifacts due to Limited Temporal Resolution

Strobing
Flickering

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Antialiasing

Sample at higher rate

CGVR

Not always possible


Doesnt always solve problem

Pre-filter to form bandlimited signal

Form bandlimited function (low-pass filter)


Trades aliasing for blurring
Must consider
sampling theory!

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Sampling Theory

CGVR

How many samples are required to represent a


given signal without loss of information?

What signals can be reconstructed without loss


for a given sampling rate?

cgvr.korea.ac.kr

Graphics Lab @ Korea University

Sampling Theorem

CGVR

A signal can be reconstructed from its samples,


if the original signal has no frequencies above
the sampling frequency Shannon

The minimum sampling rate for bandlimited


function is called Nyquist rate

A signal is bandlimited if its highest


frequency is bounded.
The frequency is called the bandwidth.
cgvr.korea.ac.kr

Graphics Lab @ Korea University

Image Processing

Quantization

CGVR

Filtering

Blur
Uniform quantization
Detect edge
Random dither
Ordered dither
Floyd-Steinberg dither Warping
Scale
Pixel operations
Rotate
Warps
Add random noise
Add luminance
Add contrast
Combining
Add saturation
Morphs

cgvr.korea.ac.kr

Composite
Graphics Lab @ Korea University

Вам также может понравиться