Tuesday, August 21, 2012

SOCIS - part 2

This is the second part of my log on the SOCIS project.

Signal-to-noise ratio and bitrate

We recall from the previous post, that compression can be either lossy or lossless. Regardless of the type of compression used, it's obvious that the compressed file has a smaller size than the original. Size, of course, is measured in units of information (bits, bytes multiples of these). A hyperspectral image is made up of bands, each band contains pixels and each pixel is a value which can be represented using a certain number of bits. The size of the image can be computed as: number of bands * number of pixels per band * number of bits per pixel. We call the last value bitrate (measured in bpppb - bits per pixel per band).
Signal-to-noise ratio (SNR) is a measure of the amount of useful information. It is measured in decibels (dB).
It is useful to plot SNR versus bitrate to see how different transforms and compression methods behave. These are called rate-distortion plots, and we can see one in the figure below.

The 3 cases which can be seen in the plot are: lossy compression using BIFR (Band-Independent Fixed Rate) with no prior transform applied to the image, lossy compression using BIFR with POT applied to the image and finally lossy compression using waterfill with POT applied to the image. Band-Independent Fixed Rate means that the bitrate is equally split among bands, while in the waterfill case the bitrate is for the entire image with all the bands.
We notice that the greatest performance comes when using POT with waterfill. This can also be seen when plotting SNR versus band number number for each bitrate. These plots can be found here [1] and for peak SNR here [2].


POT artifacts at low bitrates

As mentioned in the previous post, when using POT, at low bitrates certain artifacts can appear in the lossy compressed images because of the transform's line-based approach. The main focus of this projects is to try to reduce these artifacts.
The image I've been working with so far is a hyperspectral image of Mount St. Helens that came from the Hyperion sensor of the Earth-Observing 1 (EO1) mission. The image, along with others can be found here: [3]. In the figure below we can see this image (I've roughly extracted the bands for red, green and blue to create an RGB image):

The image has a height of 3242 pixels, a width of 256 pixels and 242 spectral bands. Now let's look at a comparison of a lossy compressed version of this image at a low bitrate of 0.2 bpppb:

The leftmost image is the original. The image in the middle is for the case in which we used POT and BIFR. We immediately notice the artifacts and poor quality. The rightmost image is from the case in which we used POT and waterfill and we see that in this case the quality is much better, yet it's the same bitrate. This is as expected from the rate-distortion plot we saw earlier. There are however artifacts in the third image as well and we can better see them if we apply a sharpening filter.


Side information

When talking about image compression, we obviously need a means to reverse the process. The images we've just seen are not "compressed files" but rather the result of decompressing the compressed file and removing the POT. How can we remove the POT? Well, if we understand what the POT does to the original image, it's only a matter of applying these steps in reverse. First each bandline is adjusted so that it has a zero-mean. That just means that we subtract the mean from each bandline. Then it applies a rotation matrix to pairs of bandlines (vectors). The rotation matrix has a specific form and depends on one parameter called t, which varies from each pair of bandlines. Thus, if we would know all of the t parameters and all of the means we could reverse the POT. Luckily these values are stored in a file called the side information file. The t parameters are stored as half floats (16 bits) and the means as shorts (16 bit integers).
It is useful to plot these values, especially the t parameter and observe the variance of it's variation across multiple lines. I have plotted the means and the t parameter for the previous image for the first 500 lines (height 500):


On the x axis we have band numbers and on the y axis image line number.

No comments:

Post a Comment