1

我正在尝试使用 Apple Creating 3D Objects from Photos 的教程创建一个 USDZ 对象。我在这个示例项目中使用了新的摄影测量会话:摄影测量命令行应用程序

那是代码:

let inputFolderUrl = URL(fileURLWithPath: "/tmp/MyInputImages/")
let url = URL(fileURLWithPath: "MyObject.usdz")
var request = PhotogrammetrySession.Request.modelFile(url: url, 
                                                      detail: .full)
guard let session = try PhotogrammetrySession(input: inputFolderUrl) else {
    return 
    } 

我收到以下错误:

2021-06-12 21:53:56.968490+0200 HelloPhotogrammetry[15294:190841] ERROR cv3dapi.pg: Internal codes (1): 4011
2021-06-12 21:53:56.972113+0200 HelloPhotogrammetry[15294:190841] [Photogrammetry] No SfM map found in native output!
2021-06-12 21:53:56.972909+0200 HelloPhotogrammetry[15294:190841] [Photogrammetry] Got error in completion: reconstructionFailed(RealityFoundation.PhotogrammetrySession.Request.modelFile(url: OutputAR.usdz -- file:///Users/jonasdeichelmann/Library/Developer/Xcode/DerivedData/HelloPhotogrammetry-ghttmmgcrrhywqeebbrstrvxoikh/Build/Products/Debug/, detail: RealityFoundation.PhotogrammetrySession.Request.Detail.medium, geometry: nil), "Reconstruction failed!")
Request modelFile(url: OutputAR.usdz -- file:///Users/jonasdeichelmann/Library/Developer/Xcode/DerivedData/HelloPhotogrammetry-ghttmmgcrrhywqeebbrstrvxoikh/Build/Products/Debug/, detail: RealityFoundation.PhotogrammetrySession.Request.Detail.medium, geometry: nil) had an error: reconstructionFailed("Reconstruction failed!")
Processing is complete!

我正在使用带有 macOS Monterey 12.0 Beta (21A5248p) 和 Xcode 13.0 beta (13A5154h) 的 M1 iMac。

4

1 回答 1

2

tl;dr:尝试另一组图像,您的图像组可能有问题。

除了在一个实例之外,我已经成功地工作了,并且我收到了与您遇到的相同的错误。我认为出于某种原因,它不喜欢我为该特定对象拍摄的一组照片。您可以尝试只为另一个简单对象拍摄几张照片,然后再试一次,看看这是否是您第一次运行的问题。

于 2021-06-15T00:42:42.110 回答