Size increases after encoding

2 Ansichten (letzte 30 Tage)
FIR
FIR am 25 Dez. 2012
Finally i got through the problem in huffman encoding,but the size after encoding increases,please help
A=imread('imagcp.bmp');
A=A(:);
YourVector=double(A);
symbols = unique(YourVector(:));
counts = hist(YourVector(:), symbols);
p = double(counts) ./ sum(counts)
[dict,avglen]=huffmandict(symbols,p);
comp=huffmanenco(A,dict);
numel(comp)
ans =
167343
>> numel(A)
ans =
65536

Antworten (1)

Walter Roberson
Walter Roberson am 25 Dez. 2012
Remember, comp is representing binary, and so is 1 bit per element, whereas your original data is at least 8 bits per element.
  6 Kommentare
FIR
FIR am 26 Dez. 2012
walter can you please help me in giving the code for restoring image content

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Denoising and Compression finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by