TP-traitement-audio-visuel/TP10/debruitage.m

19 lines
354 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
function Y_debruite = debruitage(Y_sb, Y_b)
mu = mean(Y_b, 2);
sigma = std(Y_b, 1, 2);
alpha = 2;
masque = abs(Y_sb - mu) > abs(alpha * sigma);
masque = double(masque);
masque = imgaussfilt(masque, 5);
masque(masque == 0) = 0.01;
% imagesc(masque);
% axis xy;
% colorbar;
Y_debruite = Y_sb .* masque;
end