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 - 在 Sprite Kit 中为场景设置通用尺寸

iOS 8 beta 5 Game Center Sandbox 无法识别我的应用

iphone - 如何在 iPhone 应用程序中使用 ABAddressBookRef?

iOS 12 CIKernel 过滤器崩溃

objective-c - 核心图像 CIImage 8 位灰度

ios - 如何在单元格中显示 UIImage 数组?

ios - 强制声音警报到扬声器

objective-c - Objective-C 中的 instanceRespondToSelector 和 respondsToSelector 有什么区别?

iphone - 监听器/观察器方法通知模型更改的优缺点

ios - iOS 实时摄像头馈送的 Swift 直边检测