image processing - How to store the Huffman codes with low volume in matlab? -



image processing - How to store the Huffman codes with low volume in matlab? -

what best way store huffman code in matlab? example:

letters = [1:6]; % distinct symbols info source can produce p = [.5 .125 .125 .125 .0625 .0625]; % probability distribution [dict,avglen] = huffmandict(letters,p); % huffman code. sig = randsrc(1,20,[letters; p]) % create info using p. comp = huffmanenco(sig,dict) % encode data. -> save('file.mat','comp','dict'); -> clear all; -> load('file.mat'); deco = huffmandeco(comp,dict) % decode encoded signal.

but save function not store info in low volume. i've used dlmwrite function stored volume high. in other techniques, such huffman code in jpeg images, how storage done? know, huffman code used in jpeg image compression. how huffman codes in [imwrite(mat,'mat.jpeg')] stored on disk?

a couple of things. first, shoudl seek create bigger info amount. 20 low number see difference (but see it).

then, problem info type. if @ variable called comp , output of huffman encoding, contains 0s , 1s, binary. however, in matlab, storing double, hence using 32 bits describe 1 bit.

try, before saving, this:

comp=logical(comp);

it should trick ;)

matlab image-processing huffman-coding

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -