Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Processing and Sampling

Similar presentations


Presentation on theme: "Image Processing and Sampling"— Presentation transcript:

1 Image Processing and Sampling
Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006

2 Overview Image representation Halftoning and dithering
What is an image? Halftoning and dithering Trade spatial resolution for intensity resolution Reduce visual artifacts due to quantization

3 What is an Image? An image is a 2D rectilinear array of pixels
Continuous image Digital image

4 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!

5 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!

6 Image Acquisition Pixels are samples from continuous function
Photoreceptors in eye CCD cells in digital camera Rays in virtual camera

7 Image is reconstructed
Image Display Re-create continuous function from samples Example: cathode ray tube Image is reconstructed by displaying pixels with finite area (Gaussian)

8 Image Resolution Intensity resolution Spatial 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 Width x Height Depth Rate NTSC 640 x Workstation x Film 3000 x Laser Printer 6600 x Resolutions Typical

9 Sources of Error Intensity quantization Spatial aliasing
Not enough intensity resolution Spatial aliasing Not enough spatial resolution Temporal aliasing Not enough temporal resolution

10 Overview Image representation Halftoning and dithering
What is an image? Halftoning and dithering Reduce visual artifacts due to quantization

11 Quantization Artifacts due to limited intensity resolution
Frame buffers have limited number of bits per pixel Physical devices have limited dynamic range

12 Uniform Quantization P(x, y) = trunc(I(x, y) + 0.5) I(x,y) P(x,y)
(2 bits per pixel)

13 Uniform Quantization Images with decreasing bits per pixel:
256 bpp bpp bpp 2 bpp Notice the quantization error, most noticeable in the 8 and 2 bpp images – large flat areas with no detail 8 bits 4 bits 2 bits 1 bit

14 Reducing Effects of Quantization
Halftoning Classical halftoning Dithering Error diffusion dither Random dither Ordered dither

15 Classical Halftoning Use dots of varying size to represent intensities
Area of dots proportional to intensity in image I(x,y) P(x,y)

16 Classical Halftoning Newspaper image from North American Bridge Championships Bulletin, Summer 2003

17 Halftone patterns Use cluster of pixels to represent intensity
Trade spatial resolution for intensity resolution Figure from H&B

18 Dithering Distribute errors among pixels
Exploit spatial integration in our eye Display greater range of perceptible intensities Uniform quantization discards all errors i.e. all “rounding” errors Dithering is also used in audio, by the way

19 Floyd-Steinberg dithering
Any “rounding” errors are distributed to other pixels Specifically to the pixels below and to the right 7/16 of the error to the pixel to the right 3/16 of the error to the pixel to the lower left 5/16 of the error to the pixel below 1/16 of the error to the pixel to the lower right Assume the 1 in the middle gets “rounded” to 0

20 Error Diffusion Dither
Spread quantization error over neighbor pixels Error dispersed to pixels right and below  +  +  +  = 1.0 Figure from H&B

21 Floyd-Steinberg dithering
Floyd-Steinberg dithering is a specific error dithering algorithm Uniform Quantization (1 bit) Floyd-Steinberg Dither (1 bit) Floyd-Steinberg Dither (1 bit) (pure B&W) Original (8 bits)

22 Random Dither P(x, y) = trunc(I(x, y) + noise(x,y) + 0.5)
Randomize quantization errors Errors appear as noise I(x,y) P(x,y) I(x,y) P(x,y) P(x, y) = trunc(I(x, y) + noise(x,y) + 0.5)

23 Random Dither Original (8 bits) Uniform Quantization (1 bit) Random

24 Ordered Dither i = x mod n j = y mod n e = I(x,y) - trunc(I(x,y))
Pseudo-random quantization errors Matrix stores pattern of thresholds i = x mod n j = 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))

25 Ordered Dither Bayer’s ordered dither matrices
Reflections and rotations of these are used as well

26 Ordered Dither Original (8 bits) Uniform Quantization (1 bit)
4x4 Ordered Dither (1 bit)

27 Dither Comparison Original (8 bits) Random Dither (1 bit) Ordered
Floyd-Steinberg Dither (1 bit)

28 Color dithering comparison
Original image Web-safe palette, no dithering Web-safe palette, FS dithering Optimized 256 color palette Optimized 16 color palette Optimized 16 color palette FS dithering No dithering FS dithering

29 Summary Image representation Halftoning and dithering
A pixel is a sample, not a little square Images have limited resolution Halftoning and dithering Reduce visual artifacts due to quantization Distribute errors among pixels Exploit spatial integration in our eye Sampling and reconstruction Reduce visual artifacts due to aliasing Filter to avoid undersampling Blurring is better than aliasing


Download ppt "Image Processing and Sampling"

Similar presentations


Ads by Google