在为面部或矩形识别设置 CIDetector 时,应该如何使用 CIDetectorMinFeatureSize
? description 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/