JPEG Image compression using Huffman encoding and decoding
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone,
i would need some help, im trying to encode a JPEG Image using Huffman coding. i know Matlab has huffmanenco, huffmandict functions. i tried both methods, doesn't work, because the problem is :
Matlab read Images as Matrix. While the function huffmanenco & huffmandict only accept inputs in vector. So it gives me the error saying : "Input must be a Vector" or sort like that.
I also found this : http://www.mathworks.com/matlabcentral/answers/2158 which leads me here : http://www.mathworks.com/matlabcentral/fileexchange/26384-ppt-for-chapter-9-of-matlabsimulink-for-digital-communication
But it doesn't work as well. or at least i still dont know the input for codewords.
im still working on it.
anyone can help ?
댓글 수: 2
omar
2012년 12월 7일
(zigzag scan) this function transforms the matrix to vector but this is not it's main purpose which is to to group low frequency coefficients in top of vector.you cannot find this function in matlab directly here u are go to that link http://www.mathworks.com/matlabcentral/fileexchange/15317-zigzag-scan/content/zigzag/zigzag.m
copy this code i a new m-file and save it and then add it's path to matlab path now u can use zigzag function
Walter Roberson
2012년 12월 7일
zigzag is not relevant for huffman encoding. huffman encoding depends upon actual probability distribution, by analyzing all occurrences of the symbols, and so is not sensitive to the order of the symbols.
답변 (2개)
Walter Roberson
2012년 12월 5일
So reshape() the matrix as a vector. Include the array sizes in what you send. At the decoding stage, decode the vector, extract the array sizes, and reshape() what is left according to the sizes.
댓글 수: 0
Said BOUREZG
2015년 2월 27일
Here in my code you can find the steps to compress it's not a Jpeg but it have the same idea and I use the Huffman coding, take a look and I'm here if you want any explication: DCT Based on Image Compression
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Source Coding에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!