1 Star 0 Fork 0

弦余/Matlab图像处理大作业

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MyEncode.m 302 Bytes
一键复制 编辑 原始数据 按行查看 历史
弦余 提交于 2022-05-31 21:08 +08:00 . 初始化
function [M, N, out, dict] = MyEncode(I)
I=im2uint8(I);
[M,N] = size(I);
I1 = I(:);
P = zeros(1,256);
%获取各符号的概率;
for i = 0:255
P(i+1) = length(find(I1 == i))/(M*N);
end
k = 0:255;
dict = huffmandict(k,P); %生成字典
enco = huffmanenco(I1,dict); %编码
out=enco;
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xianyu39/matlab-image-processing-work.git
git@gitee.com:xianyu39/matlab-image-processing-work.git
xianyu39
matlab-image-processing-work
Matlab图像处理大作业
master

搜索帮助