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

📄 sobel.m

📁 用所写算子进行边缘检测
💻 M
字号:
image = imread('testpat1.png');
image1=suanzi(image,0.2);
image2=suanzi(image,0.5);
image3=suanzi(image,0.9);
subplot(221)
imshow(image);
subplot(222)
imshow(image1);
subplot(223)
imshow(image2);
subplot(224)
imshow(image3);
%function y=sobel(image ,th)
%[nx,ny]=size(image);
%image=double(image);
%h=[1 2 1;0 0 0;-1 -2 -1];
%Gx=filter(h,image);
%Gy=filter(h',image);
%F=abs(Gx)+abs(Gy);
%th_F=double(F)/255;
%for i=1:nx
   % for j=1:ny
        %if th_F(i,j)<th;
          %  th_F(i,j)=0;
        %else
           % th_F(i,j)=1;
       % end
   % end
%end

⌨️ 快捷键说明

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