U of U ECE 6532 - Image representation, sampling and quantization

Unformatted text preview:

Image representation, sampling and quantizationAntónio R. C. PaivaECE 6962 – Fall 20081 Image representationImage as a function• An image is a function of the space.• Typically, a 2-D projection of the 3-D space is used, but the image can existin the 3-D space directly.Image as a single-valued function• The function can be single-valuedf : Rm−→ R, m = 2, 3,quantifying, for example, intensity.1Image as a multi-valued function• . . . or, be multi-valued, f : Rm−→ R3, m = 2, 3, in which each corre-sponds to a color intensity.Red Green Blue⇒2-D vs. 3-D images2Images are analog• Notice that we defined images as functions in a continuous domain.• Images are representations of an analog world.• Hence, as with all digital signal processing, we need to digitize our images.2 Digitalization of imagesDigitalization• Digitalization of an analog signal involves two operations:– Sampling, and– Quantization.• Both operations correspond to a discretization of a quantity, but in differentdomains.Sampling• Sampling corresponds to a discretization of the space. That is, of the domainof the function, into f : [1, . . . , N ] × [1, . . . , M ] −→ Rm.3• Thus, the image can be seen as matrix,f =f(1, 1) f(1, 2) · · · f(1, M )f(2, 1) f(2, 2) · · · f(2, M )............f(N, 1) f(N, 2) · · · f(N, M).• The smallest element resulting from the discretization of the space is calleda pixel (picture element).• For 3-D images, this element is called a voxel (volumetric pixel).Quantization• Quantization corresponds to a discretization of the intensity values. That is,of the co-domain of the function.• After sampling and quantization, we get f : [1, . . . , N] × [1, . . . , M] −→[0, . . . , L].• Quantization corresponds to a transformation Q(f)4 levels 8 levels4• Typically, 256 levels (8 bits/pixel) suffices to represent the intensity. Forcolor images, 256 levels are usually used for each color intensity.Digitalization: summary3 Changes in resolutionWhich resolution?• Digital image implies the discretization of both spatial and intensity values.The notion of resolution is valid in either domain.• Most often it refers to the resolution in sampling.– Extend the principles of multi-rate processing from standard digital sig-nal processing.• It also can refer to the number of quantization levels.Reduction in sampling resolution• Two possibilities:5– Downsampling– DecimationIncrease in sampling resolution• The main idea is to use interpolation.• Common methods are:– Nearest neighbor– Bilinear interpolation– Bicubic interpolation6DownsampledNearestBilinear BicubicDecrease in quantization levels7• To mitigate the “false contour” effect we can use dither.– Basically, we add noise before quantization to create a more naturaldistribution of the new intensity values.OriginalUndithered Dithered(Images from Wikipedia.)4 Matlab tutorialReading images• Use imread to read an image into Matlab:» img = imread(’peppers.jpg’,’jpg’);» whosName Size Bytes Classimg 512x512x3 786432 uint88– Format is: A = IMREAD(FILENAME,FMT). Check the help, help imread,for details.– Note that data class is uint8. Convert to double with img = double(img);.This is necessary for arithmetic operations.Displaying images• With Image Processing toolbox: use imshow to display the image.» imshow(img);» imshow(img(:,:,1));% Shows only the red component of the image– The image must be in uint8 or, if double, normalized from 0 to 1.• Without the Image Processing toolbox: use image to display the image.» image(img);– The image must have 3 planes. So, for grayscale images do,» image(repmat(gray_img, [1 1 3]));Saving images• Use imwrite to save an image from Matlab:» imwrite(img,’peppers2.jpg’,’jpg’);» imwrite(img(:,:,1),’peppersR.jpg’,’jpg’);% Saves only the red component of the image– Format is: IMWRITE(A,FILENAME,FMT). Check the help, help imwrite,for details.– The image should be in uint8 or, if double, normalized from 0 to 1.ReadingReading• Sections 2.4 and 2.5 of the


View Full Document

U of U ECE 6532 - Image representation, sampling and quantization

Download Image representation, sampling and quantization
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Image representation, sampling and quantization and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Image representation, sampling and quantization 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?