FRIENDz

FAILURE IS THE SIGN OF SUCCESS!!

Optimized Quantizer with Matlab Program

PDF Optimized Quantizer:
In the case of uniform quantizers, the pdf of the analog sample was assumed to beuniform, and therefore, we obtained the closed form solutions for optimal decision regions and output levels. Moreover, the intervals between any two consecutive decision regions as well as the intervals between any two consecutive output levels were constant. When the pdf of the input analog samples is not uniform, then the quantization steps are not constant and the optimal solutions are obtained by solving the transcendental equations (2.31). This results in a nonuniformquantizer and is referred to as pdf optimized quantizer.
Using Lloyd’s algorithm, we design the quantizers for 3 and 5 bpp. The requantized images at 3 and 5 bpp are shown in Figures 1.a,b, respectively. There are some improvements in the flat areas compared with that of the corresponding uniform quantizer. The SNR values are 20.1 and 33.68 dB for 3 and 5 bpp, respectively, for the nonuniformquantizer, whereas they are 17.3 and 29.04 dB, respectively, for the uniform quantizer. Figure 1.c shows a plot of the decision regions versus output levels of the nonuniformquantizer for

Uniform Quantizer with Matlab Program

Uniform Quantizer
When the pdf of the analog sample is uniform, the decision intervals and output levels of the Lloyd–Max quantizer can be computed analytically as shown below.In this case, the decision intervals are all equal as well as the intervals between the output levels and the quantizer is called a uniform quantizer.
We will use the Barbara image for this example. Since this image is rather large in size, we will crop it to a smaller size. Figure 1.a is the cropped original 8-bpp image, and Figures 1.b,c correspond to the requantized images at 3 and 5 bpp, respectively. We see that flat areas appear very patchy especially in the 3-bpp imageas compared with the 5-bpp image. Because of the large quantization step size, a large neighborhood of pixels gets quantized to the same level and this makes the image look patchy in the flat areas.

Non-rectangular Sampling Grids


So far our discussion has been on image sampling on a rectangular grid. This is the most commonly used sampling grid structure because many display systemssuch as TV use raster scanning, that is, scanning from left to right and top to bottom. Also, most digital cameras have their sensors built in rectangular grid arrays.However, it is possible to use nonrectangular grids, such as hexagonal sampling grid, to acquire a digital image. An advantage of using hexagonal sampling grid is that the acquired image has 13.4% less data than that acquired using the rectangular sampling grid [2]. It has also been found that edge detection is more efficient with hexagonally sampled images. Hexagonal sampling is used widely in machine vision and biomedicalimaging.
            Although the compression standards such as Moving Picture Experts Group (MPEG) use rectangular grid structure for coding still and moving imagesespecially for motion estimation and compensation, it may be more efficient to employ hexagonal grids for such purposes for better accuracy in motion estimation and higher compression ratio.

Nonideal Sampling using Matlab

Nonideal Sampling
Practical sampling devices use rectangular pulses of finite width. That is, the samplingfunction is an array of rectangular pulses rather than impulses. Therefore, the sampling function can be written as
where p (x, y) is a rectangular pulse of finite extent and of unit area. Then the sampling process is equivalent to convolving the continuous image with the pulse p (x, y) and then sampling with a Dirac delta function .The net effect of sampling with a finite-width pulse array is equivalent to prefilteringthe image with a lowpass filter corresponding to the pulse p (x, y) followed by ideal sampling. The lowpass filter will blur the image. This is the additional distortion to the aliasing distortion that we discussed above. To illustrate the effect the nonideal sampling has on the sampled image.

SAMPLING A CONTINUOUS IMAGE

Aliasing Distortion
            Sampling theorem guarantees exact recovery of a continuous image, which is lowpassand band limited to frequencies FxS/2 and FyS/2, from its samples taken atFxS and FyS samples per unit distance. If the sampling rates are below the Nyquistrates, namely, FxS and FyS, then the continuous image cannot be recovered exactlyfrom its samples by filtering and so the reconstructed image suffers from a distortionknown as aliasing distortion. This can be inferred from Figure 1. Figure 1.ashows the Fourier transform of a continuous lowpass image with cutoff frequenciesof fxC and fyC in the two spatial directions. Figure 1 b shows the Fourier transformof the sampled image, where the sampling frequencies equal twice the respectivecutoff frequencies. It is seen from Figure 1 b that there is no overlap of the replicasand that the Fourier transform of the sampled image is identical to that of the continuous image in the region [(− fxC , fxC ) ×(− fyC , fyC)], and therefore, it can be recovered by filtering the sampled image by an ideal lowpass filter with cutofffrequencies equal to half the sampling frequencies.

Video Compression using Matlab

Video Compression
So far our discussion on compression has been on still images. These techniques tryto exploit the spatial correlation that exists in a still image. When we want to compressvideo or sequence images we have an added dimension to exploit, namely, thetemporal dimension. Generally, there is little or very little change in the spatial arrangementof objects between two or more consecutive frames in a video. Therefore,it is advantageous to send or store the differences between consecutive frames rather
than sending or storing each frame. The difference frame is called the residual or differential frame and may contain far less details than the actual frame itself. Dueto this reduction in the details in the differential frames, compression is achieved. Toillustrate the idea, let us consider compressing two consecutive frames

IMAGE AND VIDEO COMPRESSION TECHNIQUES

Still Image Compression
Let us first see the difference between data compression and bandwidth compression.
Data compression refers to the process of reducing the digital source data to a desired
level. On the other hand, bandwidth compression refers to the process of reducing the
analog bandwidth of the analog source. What do we really mean by these terms? Here
is an example. Consider the conventional wire line telephony. A subscriber’s voice
is filtered by a lowpass filter to limit the bandwidth to a nominal value of 4 kHz. So,
the channel bandwidth is 4 kHz. Suppose that it is converted to digital data for longdistance
transmission. As we will see later, in order to reconstruct the original analog
signal that is band limited to 4 kHz exactly, sampling theory dictates that one should
have at least 8000 samples per second. Additionally, for digital transmission each
analog sample must be converted to a digital value. In telephony, each analog voice
sample is converted to an 8-bit digital number using pulse code modulation (PCM).