Current Issue Cover
形状角计算改进及其在矩形目标识别中的应用

孟伟荣, 李辉, 方黎勇, 白金平(电子科技大学航空航天学院, 成都 611731)

摘 要
目的 在轮廓特征识别中,形状角理论已经被证明为一种有效方法.形状角的计算精度和时间开销取决于轮廓上各离散点处切线方向的计算效率.现有基于Vialard算法的切线方向计算方法在处理矩形轮廓时步骤烦琐且存在较大的误差,导致使用形状角识别矩形时效率不高.针对此问题,提出一种基于傅里叶拟合的离散点切线方向计算方法.方法 首先对离散点进行极坐标转化,然后使用傅里叶级数拟合整个轮廓,最后再对拟合之后的曲线求导,从而计算出轮廓上各点的切线方向.结果 在本文所给出的实例中,本文方法计算平均耗时为1.5775 s,传统方法平均耗时为156.155 s,且计算结果更加精确.结论 本文方法可以避免Vialard算法及其衍生方法在处理矩形轮廓时产生的过度迭代的问题,时间复杂度降低两个数量级,结果更加准确.最后,将所提的改进形状角计算方法应用矩形轮廓识别中,通过实例分析,验证了该方法的准确性和可靠性.
关键词
Improved shape angle computation and its application in detection of rectangular

Meng Weirong, Li Hui, Fang Liyong, Bai Jinping(School of Aeronautics and Astronautics, University of electronic science and technology of China, Chengdu 611731, China)

Abstract
The fast recognition and classification of objects with rectangular shapes are an essential component in the automatic detection of printed circuit board (PCB) defects, such as through automatic optical inspection or automatic X-ray inspection. The image obtained generally covers only a certain part of a PCB that contains rectangular shapes. The amount, positions, orientations, and exact shapes are almost undetermined. Most traditional algorithms for rectangular region detection are based on the Hough transform or on its derivations. In these approaches, each potential region must be voted on in a 2D or 3D domain. This process increases time complexity and lowers computation speed. By contrast, shape angle theory is an effective method for detecting rectangular regions in contour inspection. Objective Shape angle theory can avoid the inaccuracy and computational inefficiency induced by Hough transform. The accuracy and time complexity of shape angle calculation depend on the efficiency of the tangent calculation at discrete points on the contour. This calculation is currently performed using either Vialard's algorithm or its derived methods. These procedures can be complicated and inaccurate when applied to rectangles with relatively smooth edges.Method A new method based on Fourier fitting has been proposed in this paper to solve this problem. A polar coordinate system transform is first applied to the discrete points. Then, Fourier series are used to fit envelopes and to calculate the derivative of the envelope function to obtain the tangent. Result The integrated chip FUSION 878A is derived from a gray-scale image to verify the accuracy and reliability of this method. The average computing time of the proposed method is 1.5775 s. By contrast, the traditional approach reports an average computing time of 156.155 s. The proposed method avoids iterations in handling rectangle contours. Therefore, time complexity is significantly reduced by two orders of magnitude. Moreover, the proposed method generated a precise outcome. Conclusion The improved approach is applied to rectangle region detection problems. Experimental results indicate the acceptable accuracy and reliability of this algorithm. The following conclusions are drawn: 1) the proposed method exhibits little time complexity when calculating the tangent vector of the rectangle contour. The findings of both experiments and theoretical analysis suggest that specifically, time complexity is reduced from O(n3) to O(n). 2) We examine the effects of breadth-to-length ratio and rectangle dimensions on shape angle. Understanding these effects can provide reference information for template selection and data matching in industrial applications. 3) This approach improves on the shape angle method and can effectively classify rectangles in images by implementing rectangle detection based on shape angle theory.
Keywords

订阅号|日报