?? hough變換過程.m
字號:
%見課本403,hough變換的全過程,涉及到hough,houghpeaks,houghlines三個函數的調用
close all;clear;clc;
a=imread('d:\test.bmp');
a=a(:,:,1);
f=edge(a,'prewitt');
[H,theta,rho]=hough(f,1);
imshow(theta,rho,H,[],'notruesize'),axis on, axis normal
[r,c]=houghpeaks(H,18);
hold on;
plot(theta(c),rho(r),'linestyle','none','marker','s','color','w');
lines=houghlines(f,theta,rho,r,c);
figure;imshow(f),hold on
for k=1:length(lines)
xy=[lines(k).point1;lines(k).point2]
plot(xy(:,2),xy(:,1),'LineWidth',4,'Color',[.6,.6,.6]);
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -