フィルターのクリア

how to compress an image using huffman coding ?

1 回表示 (過去 30 日間)
Islam Abu Tabikh
Islam Abu Tabikh 2019 年 5 月 12 日
img= imread('C:\Users\Islam\Desktop\ball2.jpg');
Image = rgb2gray(img);
Image = Image(:);
[N M] = size(Image)
Count = zeros(256,1)
for i = 1:N
for j = 1:M
Count(Image(i,j)+1)=Count(Image(i,j)+1)+1;
end
end
prob = Count/(M*N)
symbols = 0:255;
[dict,avglen] = huffmandict(symbols,prob);
comp = huffmanenco(Image,dict)
imshow(img);

回答 (0 件)

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by