how can we recover huffman encoded image?

3 ビュー (過去 30 日間)
Anu  Sri
Anu Sri 2018 年 9 月 16 日
再開済み: Anu Sri 2018 年 9 月 18 日
i have written the following code for encoding and decoding but i am unable to obtain the recovered image.can anyone please help??
data=double(data);
symbols= unique(data);
counts = hist(data,symbols);
p = counts / sum(counts);
dict = huffmandict(symbols,p);
comp = huffmanenco(data,dict);
datanew= huffmandeco(comp,dict);

採用された回答

Walter Roberson
Walter Roberson 2018 年 9 月 17 日
You need to reshape datanew to the original image size, and you need to cast() it back to the original data type. Probably
uint8(reshape(datanew, size(data)))
  14 件のコメント
Walter Roberson
Walter Roberson 2018 年 9 月 18 日
Why are you coding all of that directly when qt3ddecom will do most of that for you ?
You should be calling vec2mat(valRGB1, 2) to reconstruct your valRGB .
Anu  Sri
Anu Sri 2018 年 9 月 18 日
Its done..thankyou for your support!!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by