matlab closes when using Huffman encoding

1 visualización (últimos 30 días)
Pat
Pat el 24 de Dic. de 2012
I have a vector of size 65536x1
i am performing compression of image i used code
symbols = unique(YourVector(:));
counts = hist(YourVector(:), symbols);
p = double(counts) ./ sum(counts);
[dict,avglen] = huffmandict(symbols,p)
comp = huffmanenco(sig,dict)
but i get error
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.
Error in ==> huffmandict>insertMaxVar
i changed value from 500 to 4000,but my matlab closes

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Dic. de 2012
You have a routine which is calling itself, such as would happen if you accidentally named your .m file the same as the name of a routine that is used by huffmandict . What name did you give to the .m file for the code you show above?
  7 comentarios
Pat
Pat el 24 de Dic. de 2012
size(comp)
ans =
461689 1
size(img)
ans =
256 256
how to display comp image since sizeis dfferent..
Walter Roberson
Walter Roberson el 24 de Dic. de 2012
comp is not an image. comp is compressed data. You would have to decompress it to display anything.

Iniciar sesión para comentar.

Categorías

Más información sobre Denoising and Compression en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by