- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的应用程序中,我需要准确检测图像的脸部,但我没有得到准确的输出。我使用了 coreimage 框架。我在其他地方没有得到右眼位置、左眼位置和嘴部位置,甚至也没有检测到微笑。
这是我的示例代码。
- (void)drawRect
{
CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:[NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh forKey:CIDetectorAccuracy]];
CIImage *img=[CIImage imageWithCGImage:imageView.image.CGImage];
NSArray* features = [detector featuresInImage:img];
for (CIFaceFeature *feature in features)
{
CGRect faceRect = feature.bounds;
UIView* face = [[UIView alloc] initWithFrame:faceRect];
[face setBackgroundColor:[[UIColor yellowColor] colorWithAlphaComponent:0.4]];
[imageView addSubview:face];
if(feature.hasLeftEyePosition)
{
UIView* eye = [[UIView alloc] initWithFrame:CGRectMake(feature.leftEyePosition.x,feature.leftEyePosition.y, 20, 20)];
[eye setBackgroundColor:[[UIColor blueColor] colorWithAlphaComponent:0.2]];
[eye setCenter:feature.leftEyePosition];
[mainView addSubview:eye];
}
if(feature.hasRightEyePosition)
{
UIView* eye = [[UIView alloc] initWithFrame:CGRectMake(feature.rightEyePosition.x, feature.rightEyePosition.y, 20, 20)];
[eye setBackgroundColor:[[UIColor redColor] colorWithAlphaComponent:0.2]];
[eye setCenter:feature.rightEyePosition];
[mainView addSubview:eye];
}
if(feature.hasMouthPosition)
{
UIView* mouth = [[UIView alloc] initWithFrame:CGRectMake(feature.mouthPosition.x, feature.mouthPosition.y, 20, 20)];
[mouth setBackgroundColor:[[UIColor greenColor] colorWithAlphaComponent:0.2]];
[mouth setCenter:feature.mouthPosition];
[mainView addSubview:mouth];
}
if(feature.hasSmile)
{
NSLog(@"you are smiling");
}
}
}
最佳答案
在y轴上翻转图像以匹配核心图像使用的坐标系,以便获得准确的位置
关于ios - 如何在 iOS 中使用核心图像准确检测图像中的人脸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19944723/
我正在寻找一种用C# 编写的人脸、情感和语音识别方法。对于人脸识别,我早期使用的是 Emgu CV,它不准确,而且在弱光条件下性能非常低。我还需要找到用户的情绪。不管是悲伤还是快乐。但我发现使用 Em
我正在尝试使用 Apple 的 ARKit 3.0(Reality Kit)设置面部 anchor 但失败了。1. 以前只支持前置摄像头。现在还是这样吗?2.如何让Reality Kit的ARView
当我调试人脸 API 时抛出以下错误。 UnknownHostException@830035410936}“java.net.UnknownHostException:无法解析主机“api.proj
用例如下 我们的系统中有面孔列表 用户将上传一张图片 我们希望显示与上传图像匹配的面孔列表,例如置信度 >0.8 现在查看how to ,我的理解如下 使用人脸检测API,我们需要首先上传所有图像,包
用例如下 我们的系统中有面孔列表 用户将上传一张图片 我们希望显示与上传图像匹配的面孔列表,例如置信度 >0.8 现在查看how to ,我的理解如下 使用人脸检测API,我们需要首先上传所有图像,包
我正在寻找一种完美的方法来平滑二进制图像的边缘。问题是二值图像似乎是一个阶梯状的边界,这对我进一步的掩蔽过程来说非常不愉快。 我附加了一个原始二进制图像,该图像将被转换为平滑边缘,并且我还提供了预期的
我需要一个 java 库来确定哪个图像是“人体”;这是一张“人脸”;这是一个“动物”;这是一个“风景”等等。 有这样的东西吗? 谢谢 最佳答案 我不认为那里有什么方便的东西。特别是因为你在这里有非常广
自从过去 2 天以来,我一直在努力弄清楚出了什么问题?我正在使用 Microsoft 认知服务开发用于人脸识别的 Cordova android 应用程序。为了拍摄图像,我使用了 Cordova Ca
我是一名优秀的程序员,十分优秀!