function [ output_args ] = Untitled4( input_args )
close all
clear all
I=imread('PeppersRGB.bmp');
%读取图像
I1=im2double(I);
%将彩图序列变成双精度
I2=rgb2gray(I1);
%将彩色图变成灰色图
[thr, sorh, keepapp]=ddencmp('den','wv',I2);
I3=wdencmp('gbl',I2,'sym4',2,thr,sorh,keepapp);
%小波除噪
I4=medfilt2(I3,[9 9]);
%中值滤波
I5=imresize(I4,0.2,'bicubic');
%图像大小
BW1=edge(I5,'sobel');
%sobel图像边缘提取
BW2=edge(I5,'roberts');
%roberts图像边缘提取
BW4=edge(I5,'log');
%log图像边缘提取
BW5=edge(I5,'canny');
%canny图像边缘提取
h=fspecial('gaussian',5);
%高斯滤波
BW6=edge(I5,'zerocross',[ ],h);
%zerocross图像边缘提取
figure;
subplot(1,3,1);
imshow(I2);
title('原图');
subplot(1,3,2);
imshow(BW1);
title('Sobel算子<span style="font-family: Arial, Helvetica, sans-serif;">');</span>
subplot(1,3,3);
imshow(BW2);
title('Roberts算子');
end
MATLAB的Roberts算子与Sobel算子
最新推荐文章于 2024-06-15 18:03:12 发布