Xcode AR参考图像过于相似



我有一个增强现实应用程序,可以在图像上播放视频,它运行得很好,但当我接近50多张图像时,我开始在一些图像上出错,"AR参考图像"x"与"y"过于相似"我很恐慌,因为我需要尽快完成这项工作,而这个错误毫无原因地随机出现。在链接的图片中,参考图像显然在任何方面都不相似,当我甚至更改其中一张图片的名称时,它首先会自行解决,直到在不同的参考图像上出现更多相同错误的问题。如果有人有任何理论或问题,请在这里发表!非常感谢任何能在这个问题上发光发热的人!

图片上有错误的AR参考图像文件夹的图像:https://i.stack.imgur.com/gxv8r.jpg

更新:将每个图像都更改为数字1-39,并且上一张图片中出现错误的图像仍然存在错误,因此它一定与图片本身有关。尽管如此,我还是很困惑。尝试删除每个参考图像并重新加载完全相同的图像,在给出每个图像的物理尺寸后,仍有2张图像出现相同的错误。

有没有可能在出现此错误的情况下将此更新上传到苹果,并允许其通过?我把测试上传到我的设备上,测试了所有有错误的图像,它们都按预期工作。我目前没有办法解决一个看起来很肤浅的问题。再次感谢!

ARReference图像是根据这些图像创建的,即使人眼看到的图像完全不同,在解析后,也可能是检测到的结构过于相似(因为它不是在寻找精确的像素图像,而是给定图像的特征(。这就是为什么你的问题出现在图像数量增加之后(类似特征的可能性更大(。因此,你最好的选择可能是减少使用图像,或者如果不可能,更改图像,直到所有警告消失。

如果你不同时使用这些图像(相同的AR会话(,比如你的应用程序中可能有某种选择,你可以尝试使用一个简单的图像资产目录,并从代码中加载这些参考图像。我使用这种方法是因为我们的应用程序下载了标记的简单图像,并且我用程序创建了参考图像。

private func startTracking(WithMarkerImage marker: UIImage) {
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = [.horizontal, .vertical]

var orientation: CGImagePropertyOrientation!

switch marker.imageOrientation {
case .up:
orientation = CGImagePropertyOrientation.up
case .down:
orientation = CGImagePropertyOrientation.down
case .left:
orientation = CGImagePropertyOrientation.left
case .right:
orientation = CGImagePropertyOrientation.right
case .upMirrored:
orientation = CGImagePropertyOrientation.upMirrored
case .downMirrored:
orientation = CGImagePropertyOrientation.downMirrored
case .leftMirrored:
orientation = CGImagePropertyOrientation.leftMirrored
case .rightMirrored:
orientation = CGImagePropertyOrientation.rightMirrored
}

let referenceImage = ARReferenceImage(marker.cgImage!, orientation: orientation, physicalWidth: 0.15)

configuration.detectionImages = [mareferenceImageker]
configuration.environmentTexturing = .none
configuration.isLightEstimationEnabled = true

_arSession.run(configuration, options:  [.removeExistingAnchors, .resetTracking])
}

最新更新