Face detection and recognition using OpenCV
-
Upload
andrew-babiy -
Category
Technology
-
view
2.744 -
download
17
description
Transcript of Face detection and recognition using OpenCV
![Page 2: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/2.jpg)
Бабий А.С. - [email protected]
Какие задачи возникают при распознавании лиц?
Определение лиц в
кадре\изображенииОпределение
ключевых точек
Нормализация
лица
Извлечение
ключевых признаков
Сопоставление с
базой ключевых
признаков
изображение
результат сопоставления
![Page 3: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/3.jpg)
Бабий А.С. - [email protected]
Особенности реализации систем распознавания лиц
Тип сценария
Кооперация
Отсутствие кооперации
Тип сопоставления
один к одному
один ко многим
Исходные данные
одна камера
решения с несколькими камерами, NIR
Обучающая выборка
![Page 4: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/4.jpg)
Бабий А.С. - [email protected]
Карта подходов и методов для определения лиц
Определение лица
Методы основанные на частных признаках (Feature-based methods)
Методы основанные на обобщенных признаках (Appearance based methods)
Контурный анализ, классификация цвета кожи, поиск\распознавание анатомических признаков
Используют мета-алгоритм AdaBoost, RealBoost ….и «слабые» классификаторы
для построения «сильных» классификаторов.Локальные признаки:- HAAR-Like features- LBP- Gaussians fields
Конкретная задача позволяет комбинировать подходы
![Page 5: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/5.jpg)
Бабий А.С. - [email protected]
HAAR like features, LBP
Haar like features[1, 5]
Local binary patterns[2]
![Page 7: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/7.jpg)
Бабий А.С. - [email protected]
Нормализация лица
Active Shape Model[4] Active Appearance Model[10,6]
![Page 8: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/8.jpg)
Бабий А.С. - [email protected]
Распознавание лиц. EigenFace[7]
- Нормализация- Определение главных компонент, т.е. фактическиимеющих наибольшую вариативность(дисперсию)(PCA)
- Вычисление расстояния Мехаланобиса для
Поиска ближайшего элемента
![Page 9: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/9.jpg)
Бабий А.С. - [email protected]
FisherFace –Распознавание с использованием ЛДА[8]
- Нормализация- Определение «набора линий»которые лучше всего разделяют классы
Поиска ближайшего элемента
отталкиваясь от найденных
разделителей(дискриминант)
![Page 10: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/10.jpg)
Бабий А.С. - [email protected]
Local binary patterns histograms[5]
-Используются локальныепризнаки
-Разделяем на M областей-Строим гистограммы
-Полученные векторагистограмм сравниваем
![Page 11: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/11.jpg)
Бабий А.С. - [email protected]
Какие методы могут использоваться для решения конкретной задачи[9]
http://robinhsieh.com/?p=156
Например, отчет победителя Utechzone Machine Vision Prize
![Page 12: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/12.jpg)
Бабий А.С. - [email protected]
Используем OpenCV
Определение лица:
/** Global variables */String face_cascade_name = "lbpcascade_frontalface.xm l";CascadeClassifier face_cascade;…….//-- 1. Load the cascadeif( !face_cascade.load( face_cascade_name ) )
printf("--(!)Error loading\n"); return -1; };…..face_cascade.detectMultiScale( frame_gray, faces, 1 .1, 2, 0, Size(80, 80) );
samples/ObjectDetection2.cpp
![Page 13: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/13.jpg)
Бабий А.С. - [email protected]
OpenCV CascadeClassifier.detectMultiscale - параметры
image – Matrix of the type CV_8U containing an image where objects are detected.
objects – Vector of rectangles where each rectangle contains the detectedobject.
scaleFactor – Parameter specifying how much the image size is reduced at each image scale.
minNeighbors – Parameter specifying how many neighbors each candidate rectangle should have to retain it.
flags – Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.
minSize – Minimum possible object size. Objects smaller than that are ignored.
maxSize – Maximum possible object size. Objects larger than that are ignored.
![Page 14: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/14.jpg)
Бабий А.С. - [email protected]
FaceRecognizer
FaceRecognizer::trainFaceRecognizer::updateFaceRecognizer::predictFaceRecognizer::saveFaceRecognizer::load
Методы :
Конструкторы
createEigenFaceRecognizer(int num_components=0, doub le threshold=DBL_MAX)
createFisherFaceRecognizer(int num_components=0, dou ble threshold=DBL_MAX )
createLBPHFaceRecognizer(int radius=1, int neighbors= 8, int grid_x=8, int grid_y=8, double threshold=DBL_MAX)
![Page 15: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/15.jpg)
Бабий А.С. - [email protected]
Базы изображений
http://www.cl.cam.ac.uk/research/dtg/attarchive/pub/data/att_faces.zipThe Database of Faces
Yale Facedatabase A
http://cvc.yale.edu/projects/yalefaces/yalefaces.html
Yale Face Database B
http://vision.ucsd.edu/~leekc/ExtYaleDatabase/ExtYaleB.html
The extended Yale Face Database B contains 16128 images of 28 human subjects under 9 poses and 64 illumination conditions.
The Yale Face Database A (size 6.4MB) contains 165 grayscale images in GIFformat of 15 individuals.
The Database of Faces, formerly The ORL Database of Faces, containsten different images of each of 40 distinct subjects
![Page 16: Face detection and recognition using OpenCV](https://reader034.fdocuments.net/reader034/viewer/2022050815/54825a27b47959190d8b479f/html5/thumbnails/16.jpg)
Бабий А.С. - [email protected]
Литература
1)Haar Feature-based Cascade Classifier for Object Detectio nhttp://docs.opencv.org/modules/objdetect/doc/cascade_classification.html2)Face Recognition with OpenCVhttp://docs.opencv.org/modules/contrib/doc/facerec/facerec_tutorial.html#fisherfaces3)Huang, C., Ai, H., Li, Y., Lao, S.: High-performanc e rotation invariant multiview face detec-tion. IEEE Trans. Pattern Anal. Mach. Intell. 29(4), 671–686 (2007)4)An Introduction to Active Shape Models. Tim Cooteshttp://personalpages.manchester.ac.uk/staff/timothy.f.cootes/Papers/asm_overview.pdf5)Face Detection using Haar Cascadehttp://docs.opencv.org/trunk/doc/py_tutorials/py_objdetect/py_face_detection/py_face_detection.html6)Gaze tracking based on active appearance model and multiple support vector regression on mobiledeviceshttp://opticalengineering.spiedigitallibrary.org/article.aspx?articleid=10893017)Распознавание изображений. Алгоритм Eigenfacehttp://habrahabr.ru/post/68870/8)Fisherfaceshttp://www.bytefish.de/blog/fisherfaces/9)Utechzone Machine Vision Prizehttp://robinhsieh.com/?p=15610)Active Apperance models. T.F. Cooteshttp://www.cs.cmu.edu/~efros/courses/AP06/Papers/cootes-eccv-98.pdf