Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphics II Image Processing I. Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University.

Similar presentations


Presentation on theme: "Graphics II Image Processing I. Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University."— Presentation transcript:

1 Graphics II Image Processing I

2 Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University of Louisiana at Lafayette. I’d like to thank Assoc. Prof. Dr. William Bares who create such a good work on these lecture notes.

3 Digitization Multimedia data captured from "real-world" formats such as printed photographs, audio tapes, video tapes, or live video cameras must be digitized or converted from their original analog form into digital form for computer processing. Digitizing hardware devices such as scanners or digital cameras form a digital representation of an analog source by sampling the value of the analog source over a discrete number of evenly spaced sample points.

4 Sampling Resolution and Sampling Rate Images Flatbed color scanners can digitize printed images at sampling resolutions typically ranging from 75 dots per inch (DPI) to 2400 dots per inch. The sampling points are distributed evenly in both horizontal and vertical dimensions. For example, if a 4" x 5" photograph is scanned at a 300 DPI sampling resolution, then 1,800,000 (4" x 5" x 300 x 300) sample points are scanned.

5 Sampling Resolution and Sampling Rate Video Video digitizers capture S-VHS video signals for a full-size frame at 704 x 482 points. Video sequences require the capture of one full frame every 30th of a second. Audio The intensity of an analog audio source is sampled over time, typically at rates of 11 kHz, 22 kHz, or 44 kHz (1 kHz = 1,000 times per second).

6 Quantization Each sampled value is represented by a fixed number of bits. Audio samples are either 8 or 16 bits and image or video sample points can range from 1 to 48 bits per point. A sample represented by n bits can assume one of 2 n discrete values. Quantization is the process of mapping an analog value to one of a fixed number of discrete values.

7 Quantization Reconstruction is the conversion of a digitized sample value back into an analog value. A corresponding mapping is defined to map each discrete quantized value into an analog value. However, the reconstructed analog value may not be identical to the original analog sample value thereby introducing quantization error.

8 Quantization Errors absoluteError = reconstructedValue - originalAnalogValue relativeError = (reconstructedValue - originalAnalogValue) / originalAnalogValue

9 Example of Quantization Digitize the given signal represented by f(x) = 0.25 * x 2 for sample point x = 3. Digital code Quantization of Analog ValuesReconstructed Analog Value ------------------------------------------------------------------------------- 000[ 0.0, 1.0 )0.5 001[ 1.0, 2.0 )1.5 010[ 2.0, 3.0 )2.5 011[ 3.0, 4.0 )3.5 100[ 4.0, 5.0 )4.5 101[ 5.0, 6.0 )5.5 110[ 6.0, 7.0 )6.5 111[ 7.0, 8.0 )7.5

10 What is the value of the analog signal at sample point x = 3.0? f(3.0) = 0.25 * 32 = 2.25 What digitized code value is used to represent the analog sample value? 010 Give the analog value reconstructed from the digitized value. 2.5 What is the absolute quantization error? | 2.5 - 2.25 | = 0.25 What is the relative quantization error? | 2.5 - 2.25 | / 2.25 = 0.11

11 Color Quantization (a) 24-bit Color Image(b) Quantized down to 2-bit per pixel CLUT Red to white color ramp quantized to 4 colors

12 Color Quantization The color quantization process entails the following two steps: 1) Analyze the original 24-bit RGB image to determine the palette colors. The popularity algorithm determines the set of palette colors based on the N most frequently appearing color values in the images, where N is the number of colors in the palette. 2) For each pixel of the original image, determine the best matching palette color. One typical method is to select the palette color having the smallest difference from the original color value.

13 Color Quantization Example, Original color value = (100,20,40) Palette color value = (90,25,50) Difference = |100-90| 2 + |20-25| 2 + |40-50| 2

14 Dithering The process of simply replacing a 24-bit pixel value with the nearest matching palette color can result in distinctly sharp transition from one palette color to the next as shown in figure. Error diffusion dithering 4-color image

15 Random Dither Apply a random function to determine the quantized color values. For example, an analog value of 3.25 between discrete quantized values 3 and 4 can be quantized to 3.25% of the time and to 4.75% of the time. Quantized Color Value = floor( original color value + random)

16 Ordered Dither Fast approximation to random dither that uses repeated patterns in place of a call to a random number generator. Its’ more efficient than random dither but does introduce some noticeable artifacts due to the repeated pattern. Quantized Color Value = floor(original color value + Pattern(x mod 8)) where Pattern(0..7) = {1/16,9/16,5/16,13/16,3/16,11/16,7/16,15/16} x = X-Coordinate of pixel to be dithered

17 Error Diffusion Dither Distributes the error between the actual value and the quantized value to nearby pixels. Error = 0; For (x=0;x<NumPixels;x++) { QuantizedValue(x) = floor(originalColorValue(x) + error); Error += originalColorValue(x) – QuantizedValue(x); }


Download ppt "Graphics II Image Processing I. Acknowledgement Most of this lecture note has been taken from the lecture note on Multimedia Technology course of University."

Similar presentations


Ads by Google