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裸板缺陷AOI检测系统中待处理的高分辨率图像高达60000×60000以上,为提高处理速度,需提取图像轮廓并进行 DP 曲线抽稀从而减少处理数据量。点到线段的距离度量是影响 DP 曲线抽稀方法效率的决定因素之一,本文提出一种高效的分区距离度量计算方法,首先以曲线首尾端点连线为基准X轴建立新的旋转直角坐标系,逐点计算各点在新坐标系下的坐标值,然后以此坐标值进行分区及距离度量计算,在I区和III区采用曼哈顿距离、在II区则依然采用垂直距离。与Dan Sunday所提分区距离度量方法相比,本文方法充分利用了前一点的距离度量计算结果,对点进行分区判断的方式更为简洁、高效,在基本保持I、III分区各点距离度量计算量的前提下,大幅减少了比重最高的II区点的距离度量计算量。实验结果表明,本文改进距离度量计算的DP曲线抽稀方法有效提高了高分辨率PCB裸板图像轮廓的曲线抽稀效率。
展开▼