⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 amedfilt2image.m

📁 This file contains the material presented as the first Embedded MATLAB webinar on the MathWorks web
💻 M
字号:
%% Image Processing (Adaptive Median vs Median Filters)


%% Read Input Image and display
im = imread('soccerimg.tif');
figure; 
subplot(221);
imagesc(im); colormap(gray(256)); axis image
title('Original Image')


%% Add Noise 
% We need to corrupt our test image with noise to test the performance of 
% the filters
im_noise = single(imnoise(im,'salt & pepper',.2))./256; %imnoise(im,'speckle'); %imnoise(im,'gaussian',0,0.005);
F = fimath(...
'RoundMode', 'Nearest',...
'OverflowMode', 'wrap',...
'ProductMode', 'KeepLSB', 'ProductWordLength', 16,...
'SumMode', 'KeepLSB', 'SumWordLength', 16,...
'CastBeforeSum', true);

im_fixpt = fi(im_noise,0,8,8,F);


%% Filter Noise
% We use a median filter of smax size and an adaptive median filter with
% the same maximum window size.
subplot(223)
imagesc(im_noise); colormap(gray(256)); axis image
title('Noisy Image');
subplot(222)
imagesc(mymedfilt2(im_noise)); colormap(gray(256)); axis image
title('Median Filtered Image');
subplot(224)
imagesc(amedfilt2(im_noise)); colormap(gray(256)); axis image
title('Adaptive Median Filtered Image');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -