将侧面图像与其正面图像对齐
我有一张头像:
还有一张正面图像:
输出:将侧面与正面对齐.
想法:我只需要知道我可以采取哪些 3 个共同点,这将在两个面上都可见,然后使用 affineTransform 并显示对齐的轮廓面
Idea: I just need to know which 3 common points I can take,which will be visible on both faces and then use affineTransform and display the aligned profile face
OR any other **simple method** of doing so
开发环境.:c++和opencv 2.4.2
development envi.:c++ and opencv 2.4.2
我尝试了什么:
- haarcascade 特征检测(两个图像中的共同检测点=眼睛);它不会检测到正面的耳朵
- OpenCV:移位/对齐人脸图像相对于参考图像(图像配准)(我收到错误消息)
- haarcascade feature detection(common detection point in both images=eye) ; it wont detect ear in frontal face
- OpenCV: Shift/Align face image relative to reference Image (Image Registration) (I get error message)
推荐答案
正如@bytefish 这里所讨论的,找到给定图像中眼睛的准确位置绝非易事.在 OpenCV 中用于寻找眼睛的 Haar-cascades 产生了太多的误报而无用,而且这种方法对图像旋转不具有鲁棒性.
As discussed here by @bytefish, finding the accurate position of the eyes in a given image is far from trivial. The Haar-cascades for finding the eyes in OpenCV produce too many false positive to be useful, moreover this approach won't be robust to image rotation.
您需要可靠的头部姿势估计来对齐人脸图像.这里有两个最健壮的(代码可用):
You'll need a robust head pose estimation for aligning face images. Here are two most robust ones (with code available):
Gary B. Huang, Vidit Jain 和 Erik Learned-Miller.复杂图像的无监督联合对齐. 计算机视觉国际会议 (ICCV),2007.(项目页面),(PDF 在线可用), (源码)
Gary B. Huang, Vidit Jain, and Erik Learned-Miller. Unsupervised joint alignment of complex images. International Conference on Computer Vision (ICCV), 2007. (Project page), (PDF Online available), (Source code)
X.朱, D.拉马南.野外人脸检测、姿势估计和地标定位计算机视觉和模式识别 (CVPR) 普罗维登斯,罗德岛,2012 年 6 月.(项目页面), (PDF在线可用),(源代码)
X. Zhu, D. Ramanan. Face Detection, Pose Estimation and Landmark Localization in the Wild Computer Vision and Pattern Recognition (CVPR) Providence, Rhode Island, June 2012. (Project page), (PDF Online available), (Source code)
例如,使用第二篇论文中描述的方法,您将获得更强大的功能,如下图所示.反过来,这些强大的功能将确保产生更强大的人脸对齐性能.
For example, using the method described in the second paper, you will get more robust features like that are shown in the following images. And these robust features will, in turn, ensure to generate more robust face alignment performance.
相关文章