Current Issue Cover
使用线段表实现线段编码与种子填充快速算法

陆宗骐, 朱 煜(华东理工大学信息科学与工程学院,上海 200237)

摘 要
在图像处理中常用水平线段集表示区域,提出了一种采用线段表结构来表示区域,并给出使用线段表改进传统像素标记与种子填充算法的快速算法。该算法中,线段表的每个表项对应一条水平线段,它包含L、xL、xR、y和F 5个参数,即表示上下线段连通关系的标记,左、右端点的x坐标,线段的y坐标与表示线段特征或类型的标志。具有相同标记的线段表表项构成连通区域。以线段表为基础,水平与垂直方向的连通检测可分别进行,水平方向可通过行程编码实现,垂直方向则通过比较上下线段的端点坐标来确定。线段编码是像素标记的改进,由行程编码、线段标记、统一标记与标记排序4个步骤组成。采用线段表结构后,线段编码中利用桶排序,种子填充新算法中,利用队列结构并避免重复扫描来提高效率,与轮廓填充算法相比较效率都可提高近一倍。
关键词
Fast Algorithm of Line Segment Encoding and Seed Filling Based on Line Segment Table

LU Zongqi, ZHU Yu(The School of Information on Science and Engineering, East China University of Science and Technology, Shanghai 200237)

Abstract
Horizontal line can be used to precisely describe the shape of a certain region. Line segment table is the data structure of line. In this paper, a fast algorithm of line segment coding and seed filling based on line segment table is proposed. Every element of the table describes a horizontal line. The five parameters of the table are L, xL, xR, y and F. They denote the symbol of relationship of up and down rows, the x coordinates of left and right end, the y coordinate of the row and a flag for line type respectively. Base on line segment table, the connectivity of rows and columns can be calculated conveniently. Fast algorithm of line segment encoding follows the steps of line searching, labeling and sorting. The fast algorithm achieved by the concept of line segment table is 1/2 faster than contour filling. Results show that the data structure of line segment table is much more effective and flexible for data storage and data processing.
Keywords

订阅号|日报