Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS6825: Digital images How are DIGITAL images created. How are DIGITAL images created. Previous lecture we discussed how ANALOG images are created Previous.

Similar presentations


Presentation on theme: "1 CS6825: Digital images How are DIGITAL images created. How are DIGITAL images created. Previous lecture we discussed how ANALOG images are created Previous."— Presentation transcript:

1

2 1 CS6825: Digital images How are DIGITAL images created. How are DIGITAL images created. Previous lecture we discussed how ANALOG images are created Previous lecture we discussed how ANALOG images are created

3 2 Making Digital images 1. Sampling image into pixels---- "picture element" 1. Sampling image into pixels---- "picture element" 2. Quantize the pixel value to make discrete or finite 2. Quantize the pixel value to make discrete or finite

4 3 Sampling – the first step Model sensor “array” for a 2D camera, as a 2D array as shown on right. Model sensor “array” for a 2D camera, as a 2D array as shown on right. We use rectangles even though the actual shape is not exactly this. We use rectangles even though the actual shape is not exactly this. Some researches use more complicated sesnor array models …but, 2D array works adequately for many applications Some researches use more complicated sesnor array models …but, 2D array works adequately for many applications

5 4 SAMPLING in more detail 1. fit a grid over the image pixel location (r,c)=(row,column) pixel location (r,c)=(row,column) 2.Get value of pixel Pixel(r,c) =(R,G,B) Pixel(r,c) =(R,G,B) R = ∫ ∫ red(x,y) dx dy R = ∫ ∫ red(x,y) dx dy (over pixel area) (over pixel area) red(x,y) = function of red spectral energy at each contiguous point in your sensor red(x,y) = function of red spectral energy at each contiguous point in your sensor

6 5 Resolution, Size of Image Image size = (rows)*(colomns) Image size = (rows)*(colomns) Resolution = size of image = #pixels Resolution = size of image = #pixels low resolution ---> # of pixels is small low resolution ---> # of pixels is small high resolution ----> # of pixels is big high resolution ----> # of pixels is big HOW DO YOU SELECT A RESOLUTION? HOW DO YOU SELECT A RESOLUTION? if grid is too large you will get jagged edgesif grid is too large you will get jagged edges This is called Aliasing.This is called Aliasing. No AliasingAliasing

7 6 QUANTIZATION Convert continuous values to discrete e.g. 1.222 -> 1.0 Convert continuous values to discrete e.g. 1.222 -> 1.0 Instead of infinite colors we have a finite number of colors. Instead of infinite colors we have a finite number of colors. Remember in computers we store things in bits. Remember in computers we store things in bits. Cat image at 24 bits / pixel (over 16 million colors) 8 bits each field – 8 /red, 8/green, 8/blue Cat image at 4 bits / pixel (only 16 colors)

8 7 How to QUANTIZE Simple Quantization scheme: Simple Quantization scheme: The rule to convert If Z k-1 <= pixel (r,c) <= Z k If Z k-1 <= pixel (r,c) <= Z k then new pixel (r,c) = Qk then new pixel (r,c) = Qk Z i = decision level (i = 0 to N) Z i = decision level (i = 0 to N) Q k = quantization level (k = 0 to M) Q k = quantization level (k = 0 to M)

9 8 More Quantization We can have more complicated quantization schemes as indicated by the figures here and the quantization boundaries in the red-green space We can have more complicated quantization schemes as indicated by the figures here and the quantization boundaries in the red-green space Image with no blue values only red and green The color space above produced by Photoshop Using 16-colors only, shows partitioning of space

10 9 More Quantization We can have more complicated quantization schemes as indicated by the figures here and the quantization boundaries in the red-green space We can have more complicated quantization schemes as indicated by the figures here and the quantization boundaries in the red-green space Image with no blue values only red and green The color space above produced by Photoshop Using 16-colors only, shows partitioning of space

11 10 With Our Simple Step Function Conversion – how select Q’s & Z’s The goal is to choose Q's & Z's to minimize error produced from quantization, E where The goal is to choose Q's & Z's to minimize error produced from quantization, E where E = Expected value{(pixel- newpixel)*(pixel-newpixel )} = mean squared error = mean squared errorNote: error= (pixel value - new value) expected value = a type of average or mean If we try to minimize this error this leads to the following equation If we try to minimize this error this leads to the following equation Qk= (Z k+1 + Z k ) / 2 So, Steps to follow are: So, Steps to follow are: choose Z k calculate Q's via above equation CALLED “ UNIFORM QUANTIZATION” as it splits up the space uniformly (evenly).

12 11 So, how do we choose Z’s? Basically, it is function of image content Basically, it is function of image content You want more levels (Z values) in greyvalue or color ranges in which much of the image pixels fall. You want more levels (Z values) in greyvalue or color ranges in which much of the image pixels fall.

13 12 Loss in making a Digital Image? Loss from sampling? Loss from sampling? Not if choose the correct number of samples.Not if choose the correct number of samples. Over-Sampling = when you have more samples than you needOver-Sampling = when you have more samples than you need Under-Sampling = not enough samples are usedUnder-Sampling = not enough samples are used Loss from quantization? Loss from quantization? Always unless your analog image miraculously happens to only have values at the quantization levels.Always unless your analog image miraculously happens to only have values at the quantization levels. Ok samplesUnder sampled 256 levels8 levels

14 13 How to choose the number of samples (pixels) You need 2 times the Nyquest rate. You need 2 times the Nyquest rate. Nyquest rate= function of highest frequency in the image Nyquest rate= function of highest frequency in the image highest frequency in image = function of fastest varying spatial patter in the image = f(how fast things change)highest frequency in image = function of fastest varying spatial patter in the image = f(how fast things change)

15 14 Conclusion Discussed 2 steps involved in creating a digital image from an analog image: Sampling + Quantization. Discussed 2 steps involved in creating a digital image from an analog image: Sampling + Quantization. Discussed schemes for both Sampling and Quantization. Discussed schemes for both Sampling and Quantization. Discussed how to avoid loss of information in Sampling and that you always loose information in the Quantization process. Discussed how to avoid loss of information in Sampling and that you always loose information in the Quantization process.


Download ppt "1 CS6825: Digital images How are DIGITAL images created. How are DIGITAL images created. Previous lecture we discussed how ANALOG images are created Previous."

Similar presentations


Ads by Google