基于GPU加速的Otsu图像阈值分割算法实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在数字图像处理的应用领域中,经常需要对图像目标进行提取识别,如人脸识别、文字识别、指纹识别、车牌识别、基于内容的图像检索等,图像分割则是图像识别预处理阶段至关重要的步骤。图像阈值分割是最常见的图像分割处理方法。传统的图像阈值分割算法是利用图像的灰度特征,通过自适应选择的最优分割阈值来实现图像分割。其中,最大类间方差法(Otsu)与物体和背景的像素分布模型无关,整体分割效果较好,广泛用于天文、军事、道路交通、医学图像及刑事侦破等领域。
     然而在机场安检,车牌识别,军事侦察,医学诊断等实时性要求高和图像处理操作数据量大的领域,Otsu图像阈值分割算法计算速度还达不到实时性要求。针对这个问题,有学者利用模糊集和灰度直方图相似性来缩短Otsu阈值的查找时间,也有学者利用竞选算法来优化Otsu法搜索图像的全局阈值,虽然这些改进Otsu图像阈值分割算法,取得了一定的加速效果,可是由于还是CPU中的串行计算方法,加速效果有限。
     为了解决上述问题,本文通过研究Otsu图像阈值分割算法和GPU的并行计算框架编程,提出一种基于GPU加速的Otsu图像阈值分割算法。该方法针对Otsu图像阈值分割算法在CPU中串行方法实现速度较慢,数据运算量大,或者采取折衷的求次优阈值算法等问题,利用GPU并行框架结构和向量并行计算能力,将CPU中串行的Otsu图像阈值分割算法运算过程转化为GPU中的并行处理纹理渲染过程,不但去除了Otsu图像阈值分割算法在CPU和GPU中数据多次传递的延时问题,而且相对Otsu图像阈值分割算法在CPU的处理步骤,GPU中减少了渲染处理步骤,使Otsu图像阈值分割算法在GPU中并行实现,数据运算速度加快。同时,保留了Otsu算法阈值的最优解。
     本文的创新点是将CPU中算法的串行思路转变到GPU中算法的并行思路,在考虑了Otsu图像阈值分割算法满足可并行化的条件,充分利用GPU中纹理的RBGA四个通道,分别存储所需要的并行数据,并且一遍渲染操作就完成了所有数据的运算,节省了大量的时间。
     实验结果表明:在普通PC机上对1600×1200像素大小图像的阈值分割,符合机场安检、车牌识别、医学诊断等领域的实时要求。同时,GPU中Otsu图像阈值分割的工作为其它图像分割方法在GPU中实现,提供了一种可行的途径。
In digital image processing applications, it is often necessary to extract and recognize the image target, such as face recognition, character recognition, fingerprint recognition, license plate recognition and content-based image retrieval, image segmentation is the crucial step in image recognition pre-processing stag. Image Threshold segmentation is the most common image segmentation approach. The traditional image threshold segmentation algorithm achieves image segmentation through adaptive selection of the optimal threshold by using gray-scale image features. Among them, the largest between-class variance (Otsu) has nothing to do with the object and background pixel distribution model, has better overall segmentation result, is widely used in astronomy, military, road transport, medical imaging, forensic and other fields.
     However, in several applications which have large volumes of image processing data and require real-time image processing operations such as the airport security checks, license plate recognition, military reconnaissance, medical diagnostics, computing speed of Otsu image segmentation algorithm has not yet reached real-time requirements. To address this issue, several algorithms have been proposed, such as using fuzzy sets and histogram similarity to shorten time of finding the Otsu threshold, using election algorithm to optimize global threshold of Otsu search image method. Although these improved Otsu image threshold segmentation algorithms achieved a certain acceleration effect, the acceleration effect is limited because of the serial method in CPU.
     In order to solve the problems mentioned above, this paper presents a GPU-based Otsu image threshold segmentation acceleration algorithm by studying the Otsu threshold image segmentation algorithm and the parallel framework for GPU programming,. The algorithm transforms serial processing method of the Otsu threshold image segmentation algorithm in the CPU into parallel processing texture rendering process in the GPU through using the GPU parallel frame structure and vector parallel computing capabilities to overcome that the Otsu threshold image segmentation algorithm is serially achieve very slowly in the CPU, that the amount of data operations is very large and seeking the compromised second-best threshold algorithm. This algorithm not only eliminates the latency of data transmission of the Otsu threshold image segmentation algorithm in the CPU and the GPU, but also reduces rendering processing steps in GPU compared with the Otsu threshold segmentation algorithm steps in the CPU, so that the Otsu image threshold segmentation algorithm is achieved in the GPU parallel and faster, and retaining the optimal threshold of Otsu algorithm. The innovation of this paper is transforming the serial algorithm in the CPU into parallel algorithm in the GPU, considering the Otsu image threshold segmentation algorithm can be parallelized to meet the space conditions, taking advantage of four channels in GPU texture RBGA to storage the parallel data respectively. And the one side of the rendering operation to complete all the data operations saves a lot of time.
     The experimental results show that: in general PC, the threshold segmentation of a image of 1600×1200 pixels can meet the real-time requirements of the airport security checks, license plate recognition, medical diagnostics and other areas. At the same time, Otsu image threshold segmentation algorithm in GPU has provided a viable approach for other image segmentation algorithms in GPU.
引文
[1]曾庆渝.视频分割算法研究及实践[D].浙江:浙江大学信息学院,2005.
    [2]Marques J S,Jorge P M.Visual inspection of a combustion process in a thermoelectric plant[J].Signal Precessing,2000,80:1577-1589.
    [3]Tian L F,Slaughter D C,Environmentally adaptive segmentation algorithm for outdoor image segmentation[J].Computers and Electronics in Agriculture,1998,21:153-168.
    [4]薛景浩,章毓晋,林行刚.SAR图像基于Rayleigh分布假设的最小误差阈值化分割[J].电子科学学刊,1992,21(2):219-225.
    [5]Tian B,Shaikh M A,Azimi-Sadjadi M R,et al.A study of cloud classification with neural networks using spectral and textural features[J].IEEE Trans Neural Networks,1999,10(1):138-151.
    [6]陈哲,冯天.基于小波分形特征提取的图像分割方法[J].中国图象图形学报,1999,4(12):1072-1077.
    [7]Y Zhang,M Brady,S Smith.Segmentation of brain MR images through a hidden Markov random field model and the expectationmaximization algorithm[J].IEEE Transactions on Medical Imaging,20(1):45-57,2001.
    [8]Zavaljevski A,Dhawan A P,Gaskil M,et al.Multi-level adaptive segmentation of multi-parameter MR brain images[J].Computerized Medical Image and Graphics,2000,24:87-98.
    [9]Marie-Pierre D J,Sridhar L,Anil K J.Vehicle segmentation and classification using deformable templates[J].IEEE Trans Pattern Analysis and Machine Intelligence,1996,18(3):293-308.
    [10]曹亮.基于Otsu理论的图像分割算法研究[D].武汉:武汉理工大学,2008.
    [11]Pal N R,Pal S K,A review on image segmentation techniques[J].Pattern Recognition,1993,26(9),1277-1294.
    [12]Fu K S,Mui J K,A survey on image segmentation[J].Pattern Recognition,1981,13-16.
    [13]章毓晋.图像分割[M].北京:科学出版社,2001.
    [14]任明武,杨静宇,孙涵.一种基于边缘模式的直方图构造新方法[J].计算机研究与发展,2001,38(8):972-976.
    [15]Orlando J,Tobias Rui Seara.Image Segmentation by Histogram Thresholding Using Fuzzy Sets[J].IEEE Transations on Image Processing,2002.12,12(11).
    [16]杜健辉,吕文阁,侯梦华.基于竞选算法的Otsu阈值快速确定方法[J].机电工程技术,2007,第3期,第36卷.
    [17]赵雪松,陈淑珍.综合全局二值比与边缘检测的图像分割方法[J].计算机辅助设计与图形学学报,2001,13(2):118-121.
    [18]CHEN Zi kuan,TAO Yang,CHEN Xin,etal.Wavelet Based Adaptive Thresholding Method for Image Segmentation[J].Optical Engineering,2001,40(5):868-874.
    [19]赵立初,王积分.基于小波分析的图像自适应阈值选择[J].模式识别与人工智能,1999,12(1):79-84.
    [20]冯斌,王璋,孙俊.基于量子粒子群算法的Otsu图像阈值分割[J].计算机工程与设计,2008,第13期,第29卷.
    [21]何庆元,韩长久.基于粒子算法的Otsu法图像阈值分割[J].桂林电子科技大学学报,2006,26(5):356-358.
    [22]Zhang Y J.A Survey on Evaluation Methods for Image Segrnentation[J].Pattem Reeognition,1996,29(8):1335-1346.
    [23]Mardia k v,Hainsworth T J.A spatial thresholding method for Image segmentation[J].IEEE Trans Patern Analysis and Machine Interlligence,1988,10:919-237.
    [24]靳宏磊,朱蔚萍,李立源,等.二维灰度直方图的最佳分割方法[J].模式识别与人工智能,1999,12(3):329-33.
    [25]刘文萍,吴立德.图像分割中阈值选取方法比较研究[J].模式识别与人工智能,1997.
    [26]Michael HF Wilkinson.Optimizing Edge Detectors for Robust Automatic Threshold Selection:Coping with Edge Curvature and Noise[J].Graphical Model and Image Processing,1998,9(5):385-401.
    [27]应骏,叶秀清,顾伟康.一个基于知识的边沿提取算法[J].中国图像图形学报,1999,4(3):239-24.
    [28]章毓晋.图像处理工程[M].北京:清华大学出版,2002.
    [29]Doyle W.Operation Useful for Similarity-Invariant Pattern Recognition[J].Journal of the ACM,1962,9(2):259-267.
    [30]Lee S,Chung S.A Comparative Performance Study of Several Global Thresholding Techniques for Segmentation[J].Computer Vision Graphics and Image Processing,1990,52:171-190.
    [31]Tsai W H.Moment-Preserving Thresholding:A New Approach[J].Computer Vision Graphics and Image Processing,1985,29:377-393.
    [32]NOBU YUKI O A.Threshold Selection Method from Gray-Level Histograms[J].IEEE Trans on System Man and Cybernetics,1979,9(1):62-66.
    [33]Kittler J,Illingworth J.Minimum Error Thresholding[J].Pattern Recognition,1986,19:41-47.
    [34]Cho S,Haralick R,Yi S.Improvement of Kittler and Illingworth's Minimum Error Thresholding[J].Pattern Recognition,1989,22:609-617.
    [35]Rosenfeld A,De La Torte P.Histgram Concavity Analysis as an Aid in Threshold Selection[J].IEEE Trans on Systems Man and Cybernetics,1983,13:231-235.
    [36]Pun T.A New Method for Gray-Level Picture Thresholding Using the Entroy of the Histgran[J].Signal Processing,1980,2:223-237.
    [37]Kapur J,Sahop P,Wong A.A New Method for Grey-Level Picture Thresholding Using the Entropy of the Histogram[J].Computer Vision Graphics and Image Processing,1985,29:210-239.
    [38]Kapur J N.Maximum Entropy Models in Science and Engineering[M].Wiley Eastern:New Delhi,1989.
    [39]王德才,杨关胜,孙玉萍.精通DirectX 3D图像与动画程序设计[M].北京:人民邮电出版社,2008.
NGLC 2004-2010.National Geological Library of China All Rights Reserved.
Add:29 Xueyuan Rd,Haidian District,Beijing,PRC. Mail Add: 8324 mailbox 100083
For exchange or info please contact us via email.