190 likes | 316 Views
Read spectral data. From www.ee.unlv.edu/~regent/SPACE/DATA Download multispectral data: mutispectral_data.mat Download hyperspectral spectral data: hyperdata.mat Display bands: Example : I=uint8(data(:,:,1)); %read first band figure, imshow(I);. Assignment:
E N D
Read spectral data • From www.ee.unlv.edu/~regent/SPACE/DATA • Download multispectral data: mutispectral_data.mat • Download hyperspectral spectral data: hyperdata.mat • Display bands: Example: I=uint8(data(:,:,1)); %read first band figure, imshow(I); Assignment: 1.Display spectral signature of the pixel at (30, 40)
Scalar Quantization Dr.E.Regentova
Quantization • To represent a large set of values with a much smaller set • Encoder mapping • The encoder divides the range of source into a number of intervals. • Each interval is represented by a distinct codeword. • Decoder mapping • For each received codeword the decoder generates a reconstruct value. • The set of output can be scalars or vectors • Type of quantizers: scalar and vector
Definition of Scalar Quantization • M-level quantizer is typically characterized by M+1 decision levels, or boundaries, b0,b1, ... , bM, and by M reconstruction levels y0,y1, ... yM-1. • The bi’s divide the range of data under quantization into k consecutive intervals [b0,b1) [b1,b2) ... [bM-1 bM). • Each yi is in [bi,bi+1), and can be viewed as the ”centroid” of its interval.
Quantizing a number yi means locating the interval [bi,bi+1) that contains yiand replacing it by index i. • Dequantization (in reconstruction) is the process of replacing each index i by the value ri. This approximates every original number that was in interval [bi,bi+1) by the centroid ri.
MSQE - mean-square quantization error If the quantization operation is Q If the input is modeled by a random variable X with pdf f(x)
Code rate • The selection of number of intervals M depends on R to be achieved. • For the fixed-length code, decision and reconstruction levels are obtained by minimizing MSE for the given R.
Types of Scalar Quantizers • Uniform Quantizers : All intervals are the same size, except for 2 outer intervals • All the decision intervals are of equal size= (bM-b0)/M • bi=b0+i ▪ • The reconstruction levels ri are the centers of the intervals • ri=(bi+bi+1)/2
Midrise(left) and midthread(right) quantizers M=8 M=7 • - Midrize quantizer • Zero is not one of the output levels • M-is even • Midtread quantizer • zero is one of the output levels • M is odd
Non-uniform Qunatizers • Either the decision intervals are not of equal size • Or the reconstruction levels are not the centers of their intervals Midrise: M=8
Quantization Error: q=x-Q(x) uniform error
Quantization Error: q=x-Q(x) nonuniform error
Application • Prediction based coding: for coding the prediction error • Uusually non-uniform quantizer because of the distribution (modeled as Gaussian) • Transform based coding (DCT and DWT) • JPEG • JPEG2000
Assignment • PCM-Pulse Code Modulation • positive prediction errors are encoded as 1; negative as -1. • Thus only one bit is used • Implement PCM on a pout.tif image.