如链接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 图像应用过滤器?