漫水填充法需要人工选择初始种子点。基于漫水填充法的实时彩色目标识别方法,首先通过直方图阈值法实现了初始种子点的自动选取,并设置了去噪邻域窗,以防止不属于目标区域的像素点被选为初始种子点。从初始种子点出发,使用漫水填充法,得到一组互无交集的连通区域及其外接矩形。然后,利用各连通区域外接矩形几何中心之间的距离,对连通区域进行归类。合并属于同一类的所有区域即得到完整的目标区域。实验表明:改进算法能很好地识别颜色特征突出的目标,对光照变化具有较强的鲁棒性,能完成实时彩色目标识别任务,与使用广泛的直方图阈值分割法相比,它能更加准确地对目标进行识别。
This paper proposed a real-time color object recognition method based on flood fill algorithm.In the traditional flood fill algorithm,initial seed pixels should be planted manually.To avoid this,the histogram-based thresholding method was utilized.In addition,a neighborhood window denoising mechanism was presented in order to prevent pixels outside the object areas from being selected as seed points.Applying flood fill algorithm at initial seeds,a class of connected areas separated from each other,together with the corresponding enclosing rectangles,were obtained.By calculating the distance between centers of any two enclosing rectangles,previous connected areas were divided into several classes.Object areas were then segmented by just combining connected areas in the same class.Experiment results indicate that the proposed method has a good performance in real-time recognition of objects with salient color characteristics,and is robust to illumination.Compared with the widely used histogram-based thresholding,the flood fill based method performs much better.