Binarization algorithm for ancient book images based on connected component analysis
摘要
针对中文古籍图像常遇到的阴影分布不均和复杂多样的背景干扰问题,本文提出了一种基于连通域过滤的古籍图像二值化方法.该方法主要包括三个步骤:一是生成原图的连通域掩膜图像.对原图进行对比度和二值化等处理,再利用膨胀及闭运算生成连通域掩膜图像,以保留更多的文本细节;二是过滤噪点连通域图像.通过分析和深入挖掘文本连通域和噪点连通域特征的差异,计算连通中心区域与边缘区域的加权平均灰度值,设计了一种过滤噪点连通域图像的算法,以减少古籍图像背景噪点对文字修复的影响;三是文本连通域的清晰化.采用OTSU算法对噪点连通域过滤后的图像进行二值化处理,以得到清晰化的文本连通域图像.在DIBCO2017 数据集、H-DIBCO2018 数据集和自建的三个古籍数据集上,与多种不同的文字修复方法进行了对比实验,验证了所提方法在精度(Precision)、失真率度量(DRD)和峰值信噪比(PSNR)三个指标上均最优.实验结果和具体示例均说明了所提方法在去除噪声和阴影方面表现明显,并有效提高了文本区域的提取精度,表明所提方法具有应用价值.
To address the issues of uneven shadow distribution and complex and diverse background interference commonly encountered in Chinese ancient book images,this paper proposed a binarization method for ancient book images based on connected component filtering.The method mainly consisted of three steps.First,a connected component mask image of the original image was generated.By applying contrast adjustment and binarization to the original image,and then using dilation and closing operations,a connected component mask image was generated to preserve more text details.Second,noise connected component images were filtered.By analyzing and deeply mining the differences in features between text connected components and noise connected components,and calculating the weighted average gray values of the central and edge regions of connected components,an algorithm for filtering noise connected component images was designed to reduce the impact of background noise in ancient book images on text restoration.Third,text connected components were clarified.The OTSU algorithm was used to perform binarization on the image after noise connected component filtering,so as to obtain clarified text connected component images.On the DIBCO2017 dataset,the H-DIBCO2018 dataset,and three self-built ancient book datasets,comparative experiments were conducted with various text restoration methods,verifying that the proposed method achieved the best performance in terms of Precision,distance reciprocal distortion(DRD)and peak signal-to-noise ratio(PSNR).Both the experimental results and specific examples demonstrated that the proposed method performed significantly better in removing noise and shadows,effectively improved the extraction accuracy of text regions,and showed that the proposed method had practical application value.