Hi !! I have a tiff image, which i have altered to get another matrix say a .Now, I want to compress and decompress it.
1 次查看(过去 30 天)
显示 更早的评论
nayana
2013-1-5
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 个评论
nayana
2013-1-6
I have tried the file in this link http://www.mathworks.in/matlabcentral/fileexchange/19870-adaptive-huffman-coding
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
Walter Roberson
2013-1-6
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
2013-1-7
编辑:nayana
2013-1-7
@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!!
nayana
2013-1-7
编辑:Walter Roberson
2013-1-7
@ 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.
Walter Roberson
2013-1-7
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
2013-1-8
编辑:nayana
2013-1-8
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
nayana
2013-1-9
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???
Walter Roberson
2013-1-9
Make sure you write a multiple of 8 bits, as files can only store multiples of 8 bits.
回答(1 个)
Jan
2013-1-5
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Import, Export, and Conversion 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)