光电工程, 2013, 40 (7): 83, 网络出版: 2013-08-01
高分辨率PCB裸板图像轮廓快速DP曲线抽稀
A Fast DP Polyline Simplification Algorithm for High-resolution PCB Bare Board Image Contours
PCB裸板图像 曲线抽稀 道格拉斯 -普克 距离度量 PCB bare board image polyline simplification Douglas-Peucker distance measure
摘要
在线高精度 PCB裸板缺陷 AOI检测系统中待处理的高分辨率图像高达 60 000×60 000以上, 为提高处理速度, 需提取图像轮廓并进行 DP曲线抽稀从而减少处理数据量。点到线段的距离度量是影响 DP曲线抽稀方法效率的决定因素之一, 本文提出一种高效的分区距离度量计算方法, 首先以曲线首尾端点连线为基准 X轴建立新的旋转直角坐标系, 逐点计算各点在新坐标系下的坐标值, 然后以此坐标值进行分区及距离度量计算, 在 I区和 III区采用曼哈顿距离、在 II区则依然采用垂直距离。与 Dan Sunday所提分区距离度量方法相比, 本文方法充分利用了前一点的距离度量计算结果, 对点进行分区判断的方式更为简洁、高效, 在基本保持 I、III分区各点距离度量计算量的前提下, 大幅减少了比重最高的 II区点的距离度量计算量。实验结果表明, 本文改进距离度量计算的 DP曲线抽稀方法有效提高了高分辨率 PCB裸板图像轮廓的曲线抽稀效率。
Abstract
The high-resolution PCB bare board images in online high-precision AOI detection system are up to 60000× 60000 or more. In order to improve processing speed, image contours extraction and DP polyline simplification are used to reduce the amount of processing data. Distance measure of point to segment is one of determinants which affect the efficiency of DP algorithm. A new method to compute distance is proposed. Firstly, a rotating coordinate is established based on the two endpoints of curve, in which the new coordinate value is computed for each point and used to divide the points into three zones and calculate distance, and Manhattan distance is adopted in zone I and III, perpendicular distance in zone II. Compared with Dan Sunday’s method, the proposed method takes full advantage of the computation result of the previous point, and the way to divide the points is more concise and efficient, the distance metric calculation amount for points in zone I and III basically keeps, but the amount for points in zone II which own highest proportion reduces significantly. Experimental results show that the improved distance measure method can improve the efficiency of DP polyline simplification algorithm for high resolution PCB bare board image contours.
胡涛, 任仙怡, 张基宏. 高分辨率PCB裸板图像轮廓快速DP曲线抽稀[J]. 光电工程, 2013, 40(7): 83. HU Tao, REN Xianyi, ZHANG Jihong. A Fast DP Polyline Simplification Algorithm for High-resolution PCB Bare Board Image Contours[J]. Opto-Electronic Engineering, 2013, 40(7): 83.