粒子群圆检测算法
2018-02-01李福庆苏湛
李福庆+苏湛


摘要:
针对基于霍夫变换类圆检测算法计算量大、耗时长等问题,提出了一种基于粒子群算法的圆检测算法。该算法通过对图像进行灰度化、滤波去噪与边缘检测等预处理获取边缘图像后,再从中随机选取两点之中点作为初始粒子位置,通过设置最大迭代次数与阈值克服粒子陷入局部最优问题及判断是否检测到圆。对比粒子群圆检测算法与Open CV 3.0中霍夫变换圆检测算法实验数据,结果表明,粒子群圆检测算法在同样检测背景下,检测效果相同,所需时间最短。
关键词:
粒子群算法;霍夫变换;圆检测;适应度;惯性因子;收敛因子
DOIDOI:10.11907/rjdk.172238
中图分类号:TP312
文献标识码:A文章编号文章编号:16727800(2018)001006004
Abstract:In this paper, a circle detection algorithm based on particle swarm optimization (PSO) is proposed to solve the problems of large computation and long time consuming in Hough transform based circle detection algorithm. Firstly, preprocessing to obtain the edge image by grayscale image, filter denoising and edge detection. Then, the midpoint between the two points is randomly selected from the obtained edge image as the position of the initial particle. By setting the maximum number of iterations and the threshold to overcome the problem of local optimum particle and determine whether the circle is detected. Finally, the experimental results of particle swarm circle detection algorithm and Hough transform circle detection algorithm in OpenCV 3.0 are compared. The contrast experiment shows that the algorithm has the same detection effect and the shortest time required under the same detection background.
Key Words:particle swarm optimization (PSO); hough transform; circle detection; fitness; inertia factor; convergence factor
0引言
圓检测快速高效,广泛应用于胚胎检测、焊盘检测、油桶检测、虹膜检测等方面[14]。最常用且经典的圆检测算法有霍夫变换(HT)[5]与最小二乘法[6],其中霍夫变换有很高的鲁棒性,为最受欢迎圆检测算法之一。但霍夫变换检测需耗费大量存储空间构建三维累加器存储圆的半径与中心等特征参数,计算量大、速度慢制约了它的推广[78]。虽然现在有许多改进算法,但改进后HT亦需进行参数空间累计,计算量与存储空间有较大提升需求[911]。相对霍夫变换算法,智能算法中启发式优化算法结合圆特征,能够快速检测最佳目标圆,运算量小,不需要耗费更多内存空间。如AyalaRamirez等[12]使用了遗传算法,Cuevas等[13]使用了人工免疫系统(AIS)。上述方法各有优点,但有共同缺点为运算复杂。尤其是GA与AIS等算法,需要完成交叉变异免疫等操作,相对于圆检测显得臃肿,文献[12,13]实验数据也证明了这一点。……
