-1

如链接https://www.mathworks.com/matlabcentral/answers/uploaded_files/40966/salt_and_pepper_noise_removal_color.m中所述, 可以通过在空间域中应用 rgb 图像的每个通道来应用 2D 过滤器。如下:

% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);

% Median Filter the channels:
redMF = medfilt2(redChannel, [3 3]);
greenMF = medfilt2(greenChannel, [3 3]);
blueMF = medfilt2(blueChannel, [3 3]);

在频域的情况下如何对 rgb 图像应用过滤器?

4

1 回答 1

0

定义您的采样频率;定义你的截止频率;

创建您的过滤器 - 例如 butterworth

fc = 1;
fs = 10;
[b,a] = butter(6,fc/(fs/2));

对每个通道应用过滤器

dataOut = filter(b,a,double((rgbImage(:,:,1))));
于 2017-01-13T10:34:42.563 回答