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

📄 bwl.m

📁 图像像素级边缘检测程序
💻 M
字号:
clear;
figure;
RGB = imread('G:\课题\61.bmp');
I  = rgb2gray(RGB);
imshow(I);

Template1=fspecial('average');
I=filter2(Template1,I)/255;
I=filter2(Template1,I);

BW = edge(I,'sobel'); 

figure;
BW(1:3,1:736)=0;
BW(452:454,1:736)=0;
BW(1:454,1:3)=0;
BW(1:454,734:736)=0;
imshow(BW);

figure;
subplot(1,2,1),imshow(I)
subplot(1,2,2),imshow(BW)

[H,T,R] = hough(BW,'RhoResolution',0.2,'ThetaResolution',1);
%imshow(imadjust(mat2gray(H)),'XData',T,'YData',R,...'InitialMagnification','fit');
%title('Hough transform of gantrycrane.png');
%xlabel('\theta'), ylabel('\rho');
%axis on, axis normal, hold on;

PIC=mat2gray(H);
imwrite(PIC,'G:\课题\pic.bmp')

d1=max(max(PIC));
a1=find(PIC==d1);
b1=round(a1/8633);%列数
c1=mod(a1,8633);  %行数

%again a2=?
%dc=a1;
%db=a2;
%ask=1.2*(dc-db);

⌨️ 快捷键说明

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