Introduction - If you have any usage issues, please Google them yourself
function [hough_space,hough_circle,para] = hough_circle(BW,step_r,step_angle,r_min,r_max,p)
input
BW:二值图像;
step_r:检测的圆半径步长
step_angle:角度步长,单位为弧度
r_min:最小圆半径
r_max:最大圆半径
p:阈值,0,1之间的数
output
hough_space:参数空间,h(a,b,r)表示圆心在(a,b)半径为r的圆上的点数
hough_circl:二值图像,检测到的圆
para:检测到的圆的圆心、半径
[m,n] = size(BW)
size_r = round((r_max-r_min)/step_r)+1
size_angle = round(2*pi/step_angle)
hough_space = zeros(m,n,size_r)