06 Image

Post on 05-Apr-2018

217 views 0 download

transcript

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 1/39

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Image Processing 

고려대학교 컴퓨터 그래픽스 연구실 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 2/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Overview 

Image Representation What is an image?

Halftoning and Dithering 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

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 3/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

What is an Image? 

An image is a 2D rectilinear array of pixels

Continuous image Digital image

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 4/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

What is an Image? 

An image is a 2D rectilinear array of pixels

Continuous image Digital image

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 5/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

What is an Image? 

An image is a 2D rectilinear array of pixels

Continuous image Digital image

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

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 6/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Image Acquisition 

Pixels are samples from continuous function Photoreceptors in eye

CCD cells in digital camera

Rays in virtual camera

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 7/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Image Display 

Re-create continuous function from samples Example: cathode ray tube

Image is reconstructedby displaying pixels withfinite area (Gaussian)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 8/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Image Resolution 

Intensity resolution Each pixel has only “Depth” bits for colors/intensities 

Spatial resolution

Image has only “Width” x “Height” pixels  Temporal resolution

Monitor refreshes images at only “Rate” Hz 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 9/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Sources of Error 

Intensity quantization Not enough intensity resolution

Spatial aliasing

Not enough spatial resolution Temporal aliasing

Not enough temporal resolution

 y x

 y xP y x I  E ,

22,,

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 10/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Overview 

Image Representation What is an image?

Halftoning and Dithering 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

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 11/39

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 12/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Uniform Quantization 

5.0,trunc, y x I  y xP

I(x, y)

P(x, y)

2 bits per pixel

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 13/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Uniform Quantization 

Image with decreasing bits per pixel:

8 bits 4 bits 2 bits 1 bit

Notice contouring

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 14/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Reducing Effects of Quantization 

Halftoning Classical halftoning

Dithering Random dither

Ordered dither

Error diffusion dither

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 15/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Classical Halftoning 

Use dots of varying size to representationintensities

Area of dots proportional to intensity in image

I(x, y) P(x, y)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 16/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Classical Halftoning 

Newspaper image

From New York Times 9/21/99

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 17/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Halftone Patterns 

Use cluster of pixels to represent intensity Trade spatial resolution for intensity resolution

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 18/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Halftone Patterns 

How many intensities in a n x n cluster?

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 19/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Dithering 

Distribute errors among pixels Exploit spatial integration in our eye

Display greater range of perceptible intensities

Original

(8 bits)

UniformQuantization

(1 bit)

Floyd-SteinbergDither

(1 bit)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 20/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Random Dither 

Randomize quantization errors Errors appear as noise

5.0,noise,trunc, y x y x I  y xP

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 21/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Random Dither 

Original

(8 bits)

UniformQuantization

(1 bit)

RandomDither(1 bit)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 22/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Ordered Dither 

Pseudo-random quantization errors Matrix stores pattern of thresholds

20

132 D

 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))

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 23/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Ordered Dither 

Original

(8 bits)

UniformQuantization

(1 bit)

OrderedDither(1 bit)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 24/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Error Diffusion Dither 

Spread quantization error over neighbor pixels Error dispersed to pixels right and below

α 

α + β + γ + δ = 1.0

δ γ  β  

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 25/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Error Diffusion Dither 

Original

(8 bits)

OrderedDither(1 bit)

RandomDither(1 bit)

Floyd-SteinbergDither(1 bit)

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 26/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Overview 

Image Representation What is an image?

Halftoning and Dithering 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

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 27/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Sampling and Reconstruction 

Sampling

Reconstruction

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 28/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Sampling and Reconstruction 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 29/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Aliasing 

In general: Artifacts due to under-sampling or poor

reconstruction

Specifically, in graphics:

Spatial aliasing

Temporal aliasing

Under-sampling

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 30/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Spatial Aliasing 

Artifacts due to limited spatial resolution

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 31/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Spatial Aliasing 

Artifacts due to limited spatial resolution

 “Jaggies”  

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 32/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Temporal Aliasing 

Artifacts due to Limited Temporal Resolution Strobing

Flickering 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 33/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Temporal Aliasing 

Artifacts due to Limited Temporal Resolution Strobing

Flickering 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 34/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Temporal Aliasing 

Artifacts due to Limited Temporal Resolution Strobing

Flickering 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 35/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Temporal Aliasing 

Artifacts due to Limited Temporal Resolution Strobing

Flickering 

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 36/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Antialiasing 

Sample at higher rate Not always possible

Doesn’t always solve problem 

Pre-filter to form bandlimited signal

Form bandlimited function (low-pass filter)

Trades aliasing for blurring

Must considersampling theory!

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 37/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Sampling Theory 

How many samples are required to represent agiven signal without loss of information?

What signals can be reconstructed without lossfor a given sampling rate?

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 38/39

CGVR

GraphicsLab@KoreaUniversitycgvr.korea.ac.kr

Sampling Theorem 

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 bandlimitedfunction is called “Nyquist rate” 

 A signal is bandlimited if its highestfrequency is bounded.

The frequency is called the bandwidth.

7/31/2019 06 Image

http://slidepdf.com/reader/full/06-image 39/39

CGVR

Image Processing 

Quantization Uniform quantization

Random dither

Ordered dither

Floyd-Steinberg dither

Pixel operations Add random noise

Add luminance

Add contrast

Add saturation

Filtering Blur

Detect edge

Warping Scale

Rotate

Warps

Combining Morphs

Composite