丁業(yè)兵
摘要:人臉檢測是人臉識別等人臉信息處理系統(tǒng)中的關(guān)鍵問題?;趯W習的方法中,Adaboost算法的級聯(lián)檢測器結(jié)構(gòu)計算效率高,可以有效檢測圖像中的人臉。應(yīng)用開源計算機視覺庫(OpenCV) 開發(fā)了人臉檢測系統(tǒng),該系統(tǒng)給出了直觀的人機交互界面,先裝載人臉檢測分類器,再運用Adaboost算法檢測圖像中出現(xiàn)的人臉,并用橢圓框標示人臉。文中介紹了Adaboost目標檢測算法和系統(tǒng)實驗結(jié)果,實驗結(jié)果表明,在OpenCV基礎(chǔ)上,采用Adaboost算法可以快速、準確的實現(xiàn)人臉檢測。
關(guān)鍵詞:圖像;人臉檢測;Adaboost算法;OpenCV;人機交互
中圖分類號:TP317.4 文獻標識碼:A 文章編號:1009-3044(2018)27-0167-03
Face detection Based on Adaboost algorithm and OpenCV
DING Yebing
(Department of Communication Engineering, Anhui Post and Telecommunication College, Hefei 230031, China)
Abstract:Face detection is the key issues in face recognition and other face information processing system. The cascade detector structure of Adaboost algorithm calculation efficiency, it can effectively detect the face in image. Face detection system with Open Source Computer Vision Library (OpenCV) is developed, the system has intuitive human-compute interaction interface, first, load the face detection classifier, and then, using Adaboost algorithm to detect face in images, and ellipses labeled faces. This paper introduced the Adaboost target detection algorithm and experimental results of the system. The experimental results show that the Adaboost algorithm can quickly, accurately realize the face detection using OpenCV.
Key words:Image; face detection; Adaboost algorithm; OpenCV; human-compute interaction interface
人工智能正在深刻改變?nèi)祟惖纳詈蜕a(chǎn),人臉檢測是人工智能領(lǐng)域的發(fā)展方向之一。人臉檢測是人臉識別,表情、性別識別等人臉信息處理的關(guān)鍵技術(shù)。圖像人臉檢測有基于知識的方法和基于學習的方法兩種?;谥R的方法是根據(jù)人臉特定的先驗知識,如面部器官的位置關(guān)系等進行人臉檢測,簡單易行,但容易漏檢和誤檢;基于學習的方法是通過學習人臉和非人臉樣本,獲得分類器來進行人臉檢測,性能取決于學習算法,能檢測復雜環(huán)境下的人臉。Adaboost(adaptive boosting)方法[1-3]是基于學習的方法,借助Harr特征[4],將一組弱分類器自適應(yīng)的提升為強分類器,級聯(lián)檢測效率較高,也可用于其它目標檢測中。
Open CV是一種開源計算機視覺庫,用C++語言[5]編寫,主要應(yīng)用于計算機視覺和數(shù)字圖像處理方面,實現(xiàn)了很多通用的算法,接口豐富,為應(yīng)用開發(fā)提供了極大的方便。
在VC++平臺基礎(chǔ)上,結(jié)合Open CV圖像函數(shù)庫[6],裝載Adaboost算法離線學習的人臉檢測分類器,面向?qū)ο螅_發(fā)了人臉檢測系統(tǒng)。該系統(tǒng)操作簡單,既可以對輸入圖像中的人臉進行檢測,也可以對視頻中的人臉進行動態(tài)檢測,檢測結(jié)果準確,效率高。
1 Adaboost算法
Adaboost算法運用離線學習的分類器進行人臉檢測,基于Harr矩形特征積分圖進行級聯(lián)檢測,算法計算效率高,檢測速度快[7-8]。
基本Harr矩形特征有二矩形特征、三矩形特征、四矩形特征,如圖1所示,二矩形特征(a)和(b)是白色矩形中的像素值與黑色矩形中的像素值之差,三矩形特征(c)是兩個白色矩形中的像素值與一個黑色矩形中的像素值之差,四矩形特征(d)是兩個白色矩形中的像素值與兩個黑色矩形中的像素值之差。擴展的Harr特征有邊緣特征、線性特征、中心特征,分別從圖像邊緣、線性、中心方面增強了Harr基本特征的表示能力。
4 結(jié)論
本文主要論述了Adaboost算法原理,并運用OpenCV函數(shù)和C++編程語言,以VC++為平臺開發(fā)了人臉檢測系統(tǒng)。實驗結(jié)果表明,此人臉檢測系統(tǒng)可以對靜態(tài)圖像和動態(tài)視頻中的人臉進行檢測,檢測效果準確可靠。
Adaboost人臉檢測算法的檢測效果較強的依賴于離線學習的分類器,也就是說分類器的好壞決定了人臉檢測結(jié)果的準確性。通過學習正面人臉或側(cè)面人臉,同時轉(zhuǎn)載兩種分類器,則既能檢測出圖像中的正面人臉也可以檢測出側(cè)面人臉,減少漏檢率,提高檢測正確率。
參考文獻:
[1] Freund Y, Schapire R E.A Decision-theoretic Generalization of Online Learning and an Application to Boosting [J].Journal of Computer and System Sciences, 1997, 55(1):119-139.
[2] Viola P, Jones M. Rapid objects detection using a boosted cascade of simple features [C]//Proceedings of IEEE Computer Society Conference on Computer Vision and Pattern Recognition, Kauai, Hawaii, 2001,12:12-14.
[3] Mohan A, Papageorgiou C, PoggioT. Example-based object detection in images by components [J].IEEE Transactions on Pattern Analysis and Machine Intelligence, 2001, 23(4):349-361.
[4] Rainer Lienhart, Jochen Maydt. An Extended Set of Harr-like Features for Rapid Object Detection[C]// IEEE ICIP 2002, 2002, l (1):900-903.
[5] 朱振元,朱承. 數(shù)據(jù)結(jié)構(gòu)—C++語言描述[M].北京:清華大學出版社,2007:10-18.
[6] 章毓晉,賈彗星,李樂,等.基于子空間的人臉識別[M].北京:清華大學出版社,2009:47-61..
[7] 于世琪,劉瑞禎,譯.Gary Bradski, Adrian Kaebler. 學習OpenCV [M].北京:清華大學出版社,2009:8-28.
[8] 李晶皎,王愛俠,張廣淵,等譯.Sergios Theodoridis,Konstantinos Koutroumbas.模式識別[M].第三版.北京:電子工業(yè)出版社,2006:1-4.
[通聯(lián)編輯: ]