Hi !! I have a tiff image, which i have altered to get another matrix say a .Now, I want to compress and decompress it.

i want to compress my matrix(large size) a by using Huffman coding and then decode it again to get the original matrix a. can u post links of any coding u might know that solves my problem

14 comentarios

Jan
Jan el 5 de En. de 2013
Editada: Jan el 5 de En. de 2013
What have you tried so far and which problems have occurred? Did you ask your favorite search engine already?
I got the result but my encoded output is uint8 class and of 110458233 bytes where as my original image is 839640 bytes and of uint16 type, so my question is did it really get compressed as the bytes are more in encoded image than in original
The output stores only 1 bit per array element; the input had 16 bits per array element. You should be able to calculate from there.
nayana
nayana el 7 de En. de 2013
Editada: nayana el 7 de En. de 2013
@walter Roberson, Thanks a lot for your help.Actually i am new to mat lab. so i could not figure this out... As you said the output stores less bits per each array element but on whole total no of bits of output is more than total bits of input.so can u clarify whether its compressed or not pls!!
Please show size() and class() of your input image.
@ walter Roberson
size of input image is 1x419820 and of uint16 type
whereas
output image is of 1x110458233 size and uint8 type
so can i say it as compressed image???
You must have done something wrong with your compression.
@ walter Roberson
i have used code in this link http://www.mathworks.in/matlabcentral/fileexchange/19870-adaptive-huffman-coding and even other codes but whatever i try output size is more than input.
can u please suggest me some coding to compress an array, where i am storing all the coordinate values and intensity values of an image in that array.
Why are you storing all the coordinate values? Is your image not defined over a regular grid? Why not at most store the first coordinate and the last coordinate for each of the two dimensions, if the coordinates are equally spaced?
nayana
nayana el 8 de En. de 2013
Editada: nayana el 8 de En. de 2013
I need to compress such array, that's the job my professor gave to me.anyway i just want output size to be decreased,if 5 elements are there i want it to take it as 5 bits ,but since its of type uint8 its taking 1 byte. i want to convert it into a suitable format so that it will take only 1 bit or something less than 1 byte... By storing the output it in a text file or any other file or by changing its format, if its possible to reduce size, can u please suggest me
fwrite() each of the uint8 that encodes a bit; use 'ubit1' precision.
Thank you.Its working but after storing output into file when i try to read it, the size of the result is one less than that of input.. Do u have an idea about this???
Make sure you write a multiple of 8 bits, as files can only store multiples of 8 bits.

Iniciar sesión para comentar.

Categorías

Más información sobre Denoising and Compression en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 5 de En. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by