1
如何使用霍夫变换查找二进制图像中的所有行(下面的示例)? 图片中包含圆圈和对角线和垂直线在二进制图像中查找直线和圆圈
figure, imshow(imadjust(mat2gray(H)),[],'XData',theta,'YData',rho,'InitialMagnification','fit');
xlabel('\theta (degrees)'), ylabel('\rho');
axis on, axis normal, hold on;
colormap(hot);
P = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));
x = theta(P(:,2));
y = rho(P(:,1));
plot(x,y,'s','color','black');
lines = houghlines(closeBW,theta,rho,P,'FillGap',5,'MinLength',7);
会有什么行给我们?
请显示您的原始图像的链接 – lennon310
你是如何定义变量(?或函数?)theta和rho? – Floris
你已经提出了一些代码,但是究竟是什么问题。请具体说明问题。 – chappjc