【圖像去噪】基于中值、均值、維納、小波多種濾波實現圖像去噪含Matlab源碼
1 簡介
通過對含高斯噪聲的圖像進行分析和研究,采用中值、均值、維納、小波來進行圖像去噪。
2 部分代碼
function vector = huffdecode(zipped, info, image)
% 函數對輸入矩陣vector進行Huffman解碼,返回解壓后的圖像數據
if ~isa(zipped, 'uint8')
? ?error('input argument must be be a uint8 vector');
end
%產生0,1序列,每位占一個字節(jié)
len = length(zipped);
string = repmat(uint8(0), 1, len.*8);
bitindex = 1:8;
for index = 1:len
? ?string(bitindex + 8.*(index-1)) = uint8(bitget(zipped(index), bitindex));
end
string = logical(string(:)');
len = length(string);
string ((len-info.pad+1):end)=[];
len = length(string);
%開始解碼
weights = 2.^(0:51);
vector = repmat(uint8(0), 1, info.length);
vectorindex = 1;
codeindex = 1;
code = 0;
for index = 1:len
? ?code = bitset(code, codeindex, string(index));
? ?codeindex = codeindex+1;
? ?byte = decode(bitset(code, codeindex), info);
? ?if byte > 0
? ? ? ?vector(vectorindex) = byte-1;
? ? ? ?codeindex = 1;
? ? ? ?code = 0;
? ? ? ?vectorindex = vectorindex + 1;
? ?end
end
vector = reshape(vector, info.rows, info.cols);
%函數decode返回碼字對應的符號
function byte = decode(code, info)
byte = info.huffcodes(code);
3 仿真結果

4 參考文獻
[1]彭姝姝. 基于均值濾波和小波變換的圖像去噪[J]. 現代計算機, 2019(12):6.
博主簡介:擅長智能優(yōu)化算法、神經網絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。
部分理論引用網絡文獻,若有侵權聯系博主刪除。
