ios - CIDetectorMinFeatureSize 和 CIDetectorAspectRatio 键如何用于 CIDetector?

标签 ios objective-c core-image quartz-core

在为面部或矩形识别设置 CIDetector 时,应该如何使用 CIDetectorMinFeatureSizedescription at Apple什么都没告诉我:

A key used to specify the minimum size that the detector will recognize as a feature.

The value for this key is an NSNumber object ranging from 0.0 through 1.0 that represents a fraction of the minor dimension of the image.

文档说它的范围是从 0.0 到 1.0,然后我查看了 session 514 的 WWDC 幻灯片,他们将值设置为“100”...?

这对我来说就像(未记录的?)CIDetectorAspectRatio 一样 secret 。

假设我要检测一张 30cm x 21cm 且纵横比为 1.4 的 A4 纸 - 我应该为这两个键设置什么?

最佳答案

CIRectangleDetector 使用 CIDetectorAspectRatio 来约束搜索。在您的示例中,CIDetectorAspectRatio 键的值应为@(1.43)。

CIDetectorMinFeatureSize 也用于约束搜索。只会返回大于输入图像大小的指定分数的矩形

关于ios - CIDetectorMinFeatureSize 和 CIDetectorAspectRatio 键如何用于 CIDetector?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27257963/

相关文章:

ios - 红色分隔线未出现在 UITableViewCell 中的自定义标题下

ios - AVAudioRecorder/AVAudioSession 与 Apple Airpods

ios - 秒表故障

ios - 如何在 uiimage 中找到特定颜色并更改该颜色

ios - 我可以提交带有自签名 SSL 证书的 iOS 应用程序吗?

ios - 使用 UTC 时间获取 [NSDate 日期]

objective-c - 重新显示窗口后未调用 NSWindow windowDidResignKey

iOS - 创建核心图像过滤器循环时保留原始图像

ios - 将 CIFilter 应用于 OpenGL 渲染到纹理

ios - Objective-C:生成括号的问题