【发布时间】:2017-02-07 12:23:17
【问题描述】:
我正在使用来自 Catchoom CraftAR 的设备图像识别,并使用 Github https://github.com/Catchoom/craftar-example-ios-on-device-image-recognition 上提供的示例。
图像识别有效,我想使用 matchBoundingBox 在所有 4 个角上绘制一些正方形。不知何故,我正在做的计算不起作用,我基于这篇文章:
方形视图被添加到扫描覆盖中,这就是我计算添加 4 个视图的点的方式:
CraftARSearchResult *bestResult = [results objectAtIndex:0];
BoundingBox *box = bestResult.matchBoundingBox;
float w = self._preview.frame.size.width;
float h = self._preview.frame.size.height;
CGPoint tr = CGPointMake(w * box.topRightX , h * box.topRightY);
CGPoint tl = CGPointMake(w * box.topLeftX, h * box.topLeftY);
CGPoint br = CGPointMake(w * box.bottomRightX, h * box.bottomRightY);
CGPoint bl = CGPointMake(w * box.bottomLeftX, h * box.bottomLeftY);
x 位置看起来非常接近,但 y 位置完全关闭并且看起来像镜像。
我正在 iOS 10 iPhone 6s 上进行测试
我错过了什么吗?
【问题讨论】:
标签: ios iphone augmented-reality image-recognition bounding-box