使用CIDetector的人脸检测问题 [英] Face Detection issue using CIDetector

查看:151
本文介绍了使用CIDetector的人脸检测问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款应用程序,我必须检测左眼,右眼和嘴巴的位置。
我的 self.view imageView imageView c $ c>包含一个脸部图像,现在我想获得双眼和嘴巴坐标。我已经看过2-3个示例代码,但是所有代码都大致相同,我们必须反转我的视图以匹配我不想要的坐标,因为我的视图有一些其他控件。还有一件事他们都在使用

I'm working on an app in which i have to detect left eye, right eye, and mouth position. I have an imageView on my self.view and imageView contains a face image, now I want to get both eyes and mouth coordinates. I have seen 2-3 sample codes for this but all are approximately same in all codes we have to invert my view for matching the coordinates which I don't want because my view have some other controls. And one more thing they all are using

UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"image.png"]];

但是我的 imageView 有框架我不能用图像初始化它。当我这样做时,我发现faceFeature的眼睛和嘴巴坐标错误。

but my imageView has frame and i cant init it with image. When I do so I found faceFeature's eyes and mouth coordinates wrong.

我从此示例代码但在此视图中,其视图正在反转其 Y 坐标。

I had started my code from this sample code but in this also view is being invert its Y coordinate.

任何人都可以帮助我如何在 UIImageView 的图像中检测到眼睛和嘴巴的位置而不会反转我的 self.view

Can any one help me how can i detect the face eyes and mouth position on UIImageView's image without invert my self.view.

如果我的问题不够明确,请告诉我。

Please let me know if my question is not clear enough.

推荐答案

完成了工作! - 编辑了这个类,让faceContainer包含所有的face对象(嘴和眼睛),然后旋转这个容器就可以了。显然这很粗糙,但确实有效。这是一个链接, http://www.jonathanlking.com/download/AppDelegate.m。然后用它替换示例代码中的app delegate。

Worked it out! - edited the class to have a faceContainer which contains all of the face objects (the mouth and eyes), then this container is rotated and thats all. Obviously this is very crude, but it does work. Here is a link, http://www.jonathanlking.com/download/AppDelegate.m. Then replace the app delegate from the sample code with it.

- 旧帖子 -

-- OLD POST --

有一个看看这个 Apple文档,并从此苹果谈话<一>。此外,您应该观看演讲,因为它有一个演示您正在尝试实现的内容,它被称为在iOS和Mac OS X上使用核心图像,并且是此处

Have a look at this Apple Documentation, and slide 42 onwards from this apple talk. Also you should probably watch the talk as it has a demo of what you are trying to achieve, it's called "Using Core Image on iOS & Mac OS X" and is here.

这篇关于使用CIDetector的人脸检测问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆