- divide image into 4x4 or 8x8 blocks
- Calculate the average gray level of the block
- use a threshold to get binary block b and mu, ml (greater and less then th)
- The encoder writes mu, ml and b to a file
- In the decoder, an image block is reconstructed by replacing the 1's with mu and the 0's by ml.
- low-pass filter the image,
- down-sampling image,
- up-sampling image,
- low-pass filter again.
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