Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

retrieving image after encoding

Asked by FIR on 26 Dec 2012
my code is 
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);
I want to dispaly image after encoding,plz help

0 Comments

FIR

Tags

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 26 Dec 2012
Accepted answer

"comp" is not something that can be displayed. You need to do a huffman decoding of "comp" with "dict" in order to restore the image.

7 Comments

FIR on 27 Dec 2012

ok walter thanks

FIR on 27 Dec 2012

walter but why the size increases after encoding

Walter Roberson on 27 Dec 2012

Each element of the output represents one bit. The original data was 8 bits per element.

Walter Roberson

Contact us