Tuesday, October 30, 2007

Basic image compression technologies

1 . Block Truncation Coding (link)
  1. divide image into 4x4 or 8x8 blocks
  2. Calculate the average gray level of the block
  3. use a threshold to get binary block b and mu, ml (greater and less then th)
  4. The encoder writes mu, ml and b to a file
  5. In the decoder, an image block is reconstructed by replacing the 1's with mu and the 0's by ml.
2. Gaussian Pyramids (link): Each level in the pyramid is 1/4 of the size of previous level.
  1. low-pass filter the image,
  2. down-sampling image,
  3. up-sampling image,
  4. low-pass filter again.
3. Singular Value Decomposition (link). A = USV^T, U and V are orthogonal matrices (left/right singular vectors), and S is a diagonal matrix (contains the singular values). The size of U S V is m \times m, mxn, nxn, respectively.
This method approximated the mxn image by using far fewer entries than in original matrix. By using the rank of a matrix, we remove the redundant information. Matlab code:
dvalue= im2double(imread('map.bmp'));
[u,s,v] = svds(dvalue, singvals); %ex. singvals=20
im = (u * s * transpose(v));

where 'svds(A,k)' computes the k largest singular values and associated singular vectors of matrix A.

4. DCT: former post on DCT and JPEG compression

No comments:

Post a Comment