【正文】
(4) for I = 1, 2, N, Ri is connected area P (Ri) of all elements in the collection of Ri logical predicate, on behalf of the empty set. The above four conditions respectively called pleteness, independence, similarity, mutual exclusivity, connectivity. Image segmentation is mainly research methodsImage segmentation is an indispensable technology in image processing, since the 1970 s has been attached great importance to by the people, have been proposed so far thousands of various types of segmentation algorithms, but the problem is now proposed segmentation algorithm is mostly aimed at specific problems, not there is a general image segmentation algorithm is suitable for all images, so there exists in recent years, every year there are hundreds of related research report published by the phenomenon. However, has not been set rules, it gives the application of image segmentation technology bring a lot of problems. Therefore, the study of image segmentation are deep, is currently one of the hot topics in the study of image processing. In image processing, image segmentation has an indispensable position in the analysis, it plays the essential role, can be thought of as between the middle tier of lowlevel and highlevel processing. In recent years there are many new ideas, new methods, or improved algorithm. Below a brief overview of some classic traditional methods. Image segmentation is dividing the image into several specific and unique properties of regional extracts interested in technology and process of the target, these features can be extracted pixel gray, color, texture, etc of the target can be a single corresponding area, can also be a corresponding multiple regions.There are many kinds of classification, image segmentation method here will segmentation method summarized into four categories: 。 The other is a first image segmentation into a lot of the consistency of the strong, such as small area pixel gray value of the same area, then according to certain rules to small regional integration into large area, achieve the goal of image segmentation, a typical region growing method such as t. c. Pong put forward based on the surface of the region growing method (facet) model, region growing method often can cause excessive segmentation, is the inherent drawback of the image segmentation into too much area.The definition of image segmentation: image segmentation by collective concept gives a formal definition as follows:To set R represents the entire image, region segmentation can be viewed as R of R into N .The loophole that meet the following five conditions set (a region)(1) for all I and j, I indicates j, with Ri studying Rj indicates\(2) for I = 1, 2 , N, P (Ri) = TRUE。參考文獻(xiàn)[1] 彭建,向軍.一種基于形態(tài)學(xué)的虹膜定位快速算法[J].計(jì)算機(jī)工程與應(yīng)用,2012,48( 4) :193196.[2] 余靜,游志勝.自動(dòng)目標(biāo)識(shí)別與跟蹤技術(shù)研究綜述[J].計(jì)算機(jī)應(yīng)用研究,2005(1):1215.[3] Rafael C Gonzalez,Richard E Woods,Steven L Eddins.?dāng)?shù)字圖像處理[M] .阮秋琦譯.北京電子工業(yè)出版社.[4] 王開(kāi),楊枝靈.VC++數(shù)字圖像獲取處理及實(shí)踐應(yīng)用[M].北京電子工業(yè)出版社. [5] Gonzalez. 數(shù)字圖像處理[M].北京電子工業(yè)出版社,2004.[6] 章毓晉. 圖象處理和分析[M].中國(guó)工業(yè)出版社,2002.[7] 羅玉皓,鄒遠(yuǎn)文,夏勛.運(yùn)用OpenCV 實(shí)現(xiàn)紅外圖像的瞳孔參數(shù)實(shí)時(shí)檢測(cè)[J] .計(jì)算機(jī)與現(xiàn)代化,2013,06007105.[8] 吳樂(lè)正, 吳德正.視網(wǎng)膜電圖學(xué)[J].北京: 科學(xué)出版社,1989.[9] 黎妹紅,張其善.用迭代法求指紋圖像中的閾值[J]. 電子技術(shù)應(yīng)用,2008 (3).[10] 陳凱,劉青. 一種隨機(jī)化的橢圓擬合方法[J].計(jì)算機(jī)工程與科學(xué),2005.[11] 黃坤.軟件交互界面的人機(jī)工程學(xué)研究和評(píng)估[D].上海: 東華大學(xué),2006.[12] 金鍵.駕駛疲勞機(jī)理及饋選模式研究[D].成都: 西南交通大學(xué),2002.[13] 鄭瑩.圖像處理技術(shù)在人眼像差儀中的應(yīng)用研究[D].南京: 南京航空航天大學(xué),2007.[14] 陳山,朱曉芹,李正明,等.灰度分布特征的虹膜定位算法研究[J].計(jì)算機(jī)工程與應(yīng)用,2011,47 ( 15) : 197199, 240.[15] OpenCV.Open Source Computer Vision Library[EB/OL].: / / /,20130131.[16] BRADSKI G,KAEBLER A.學(xué)習(xí)OpenCV[M].于仕琪,劉瑞琪,譯. 北京: 清華大學(xué)出版社,2009.[17] 金鍵. 駕駛疲勞機(jī)理及饋選模式研究[D].成都: 西南交通大學(xué),2002.附錄A 英文附錄The image segmentation technology The present situation and the development of the image segmentation technologyImage segmentation research has decades of history, it not only receive widespread attention and research, a large number of applications in real life. About the principle and method of image segmentation has quite a few conclusions at home and abroad and to speculate, but has been not an image segmentation method applies to all. Exist in the traditional image segmentation method is insufficient, can39。但瞳孔區(qū)域的確定精確度不是太理想,有待提高其瞳孔區(qū)域確定的精確度。首先使用形態(tài)學(xué)開(kāi)運(yùn)算進(jìn)行預(yù)處理,去除睫毛和亮斑的影響且保持原有瞳孔大小,同時(shí)生成縮略圖;然后生成二值閾值化圖像,進(jìn)行水平和垂直投影,找到極值點(diǎn),將其作為種子點(diǎn);最后用區(qū)域生長(zhǎng)算法得到精確的瞳孔區(qū)域。 測(cè)試通過(guò)紅外線(xiàn)下錄制的瞳孔視頻文件作為測(cè)試文件。由于圖片的信息量大故需要占用大量的內(nèi)存,而當(dāng)內(nèi)存過(guò)高時(shí)程序也出現(xiàn)無(wú)響應(yīng)狀態(tài),故需要合理管理內(nèi)存,本文使用動(dòng)態(tài)分配內(nèi)存,而更好的管理內(nèi)存。在縮略圖中找到種子點(diǎn)后,然后將其橫縱坐標(biāo)按照縮小比例進(jìn)行放大,就可以得到在原始圖像中種子點(diǎn)的坐標(biāo)了。由于計(jì)算量大故可以利用圖片縮小來(lái)減少掃描圖片的計(jì)算量,本文利用圖片縮放比例是2:1。//播放}由于用Windows自帶控件實(shí)現(xiàn)視頻的播放是非常方便的,且是快速、安全不易出現(xiàn)異常,故采用此方法來(lái)查看視頻。if(()==IDOK){m_pathname=()。用Windows Medial Player ActiveX控件實(shí)現(xiàn)指定視頻文件的播放具體實(shí)現(xiàn)過(guò)程如下:第一:插入Active 控件,然后就會(huì)出現(xiàn)在空間編輯欄中,:圖 Windows Medial Player 控件第二:添加變量給控件Windows Medial Player為控件類(lèi)CWMPPlayer4,變量為m_player;第三:添加一個(gè)播放文件的按鈕,按鈕響應(yīng)中的代碼實(shí)現(xiàn)播放:CString m_pathname。由于瞳孔的大小被保存到一維數(shù)組中,一維數(shù)組的下標(biāo)就是橫坐標(biāo)值,而對(duì)應(yīng)的數(shù)組內(nèi)容就是瞳孔大小即縱坐標(biāo)值,在畫(huà)曲線(xiàn)圖之前需要初始化坐標(biāo)軸,初始化坐標(biāo)軸的代碼畫(huà)曲線(xiàn)圖的代碼在附錄C中。需注意:在訪問(wèn)像素值時(shí)像素值正常存儲(chǔ)順序是RGB而在OpenCV中的順序是BGR。//種子點(diǎn)的發(fā)現(xiàn)cvFloodFill( Image,centerpoint,cvScalar( 255,255,255, 0) , cvScalar( 50, 50, 50, 0) ,cvScalar( 50, 50, 50, 0) , NULL,8|CV_FLOODFILL_FIXED_RANGE|( 255 8) , NULL) 。//種子點(diǎn)huiduzhidehuoqu(Small,a)。 int **a=imatrix(0,Smallheight,0,Smallwidth)。cvResize( Gray,Small,CV_INTER_CUBIC) 。cvDilate( Gray,Gray, t1, 2) 。 //灰度圖轉(zhuǎn)換IplConvKernel* t1 = cvCreateStructuringElementEx( 9, 9, 5, 5, CV_SHAPE_ELLIPSE) 。IplImage* Gray = cvCreateImage( cvGetSize(Image),IPL_DEPTH_8U, 1) 。本文中的種子點(diǎn)已經(jīng)確定,生長(zhǎng)準(zhǔn)則就是基于灰度差生長(zhǎng)。二值化函數(shù)的詳細(xì)使用法在附錄D中。通過(guò)查看OpenCV使用手冊(cè)可知,OpenCV中腐蝕與膨脹算法的API接口函數(shù)如下:CVAPI(void) cvErode( const CvArr* src, CvArr* dst,IplConvKernel* element CV_DEFAULT(NULL), int iterations CV_DEFAULT(1) );CVAPI(void) cvDilate( const CvArr* src, CvArr* dst,IplConvKernel* element CV_DEFAULT(NULL),int iterations CV_DEFAULT(1) );腐蝕與膨脹算法中在需要?jiǎng)?chuàng)建自己的結(jié)構(gòu)元素來(lái)進(jìn)行腐蝕和膨脹,具體的腐蝕和膨脹函數(shù)的用法在附錄D中。如上圖,盡在最后涂黑的兩個(gè)點(diǎn)與模板原點(diǎn)(標(biāo)十字)的點(diǎn)對(duì)齊,然后卷積后才可以得到三個(gè)‘1’,所以與后是1,其他的與運(yùn)算后都是0。上圖小模板的