计算机与现代化 ›› 2012, Vol. 1 ›› Issue (200): 196-04.doi: 10.3969/j.issn.1006-2475.2012.04.053

• 图像处理 • 上一篇    下一篇

大规模等值线图任意多边形裁剪算法

周清平1,陈学工2   

  1. 1.中南大学软件学院,湖南 长沙 410083; 2.中南大学信息科学与工程学院,湖南 长沙 410083
  • 收稿日期:2011-11-24 修回日期:1900-01-01 出版日期:2012-04-16 发布日期:2012-04-16

Algorithm for Contour Clipping Against General Polygon

ZHOU Qing-ping1, CHEN Xue-gong2   

  1. 1. School of Software, Central South University, Changsha 410083, China;2. School of Information Science and Engineering, Central South University, Changsha 410083, China
  • Received:2011-11-24 Revised:1900-01-01 Online:2012-04-16 Published:2012-04-16

摘要: 给出一种大规模等值线图任意多边形窗口的快速裁剪算法。首先进行传统算法的外包围盒裁剪,然后针对外包围盒创建一种约束网格结构,然后利用网格对等值线进行快速预裁剪,最后通过行扫描算法对等值线进行定位并进行局部细节裁剪得到最终裁剪结果。通过约束网格可以实现以行扫描的方式快速判断点的内外属性,而且基本能确定实际相交的线段时才进行求交运算,减少了大量的求交运算。另外,算法能有效地处理各种特殊裁剪多边形嵌套情况,克服了以往算法对裁剪多边形的约束条件。经过大量的实验,证明本文算法非常高效且稳定。

关键词: 等值线, 包围盒, 约束网格结构, 线段求交

Abstract: This paper presents a new fast algorithm for contour clipping against general complex polygon windows. Firstly, the new algorithm builds the bounding box of the clipping polygons and creates the constraint grid structure. And the algorithm uses the grid structure to pre-clip the contours quickly. Through linked structure to clip the contours, it can get the final clipping result. This paper can realize the method of row scanning to judge the inside and outside attribute by building the linked structure and reduce the counts of segments intersection. Through many experiments, the new algorithm is proved to be very effective and stable.

Key words: contours, bounding box, constraint grid structure, segments intersection