【问题标题】:IOS Face Detection - Detect Eye widthIOS 人脸检测 - 检测眼睛宽度
【发布时间】:2015-04-23 00:21:47
【问题描述】:

我正在使用 CIFaceFeature 来检测眼睛坐标。从眼睛坐标中,我将眉毛图像添加到脸部。但这对我来说是静态的。它不适合所有的人脸。有什么方法可以得到眼宽吗? `

for (CIFaceFeature *faceFeature in features) {
            // Draw a highlight around the subject's face.

            CGRect faceRect = faceFeature.bounds;
CGPoint leftPoint = [self leftEyePositionForImage:self.imageView.image inView:self.imageView.bounds.size];
            CGPoint rightPoint = [self rightEyePositionForImage:self.imageView.image inView:self.imageView.bounds.size];
}

我的代码和上面一样。获得眼睛中心点后,我在该中心点上方添加 UIImageview。

【问题讨论】:

    标签: ios iphone ipad


    【解决方案1】:

    我在我的应用程序中使用它。这样做的方法是使用已知大小的参考面,并使用毕达哥拉斯定理 (a2 + b2 = c2) 获得眼睛之间的距离。

    一旦你知道 N 的距离需要一个特定尺寸的图像,你可以确定如果距离是 1.5 倍,那么眉毛图像的尺寸也需要增加该数量。

    您还可以通过在眼点上使用 atan2 来获得面部角度,从而获得眉毛的旋转。

    【讨论】:

      猜你喜欢
      • 2013-12-26
      • 2014-06-27
      • 2013-12-30
      • 1970-01-01
      • 1970-01-01
      • 2012-09-21
      • 2012-03-20
      • 2012-08-27
      • 2016-10-08
      相关资源
      最近更新 更多