PhotogrammetrySession(input: [PhotogrammetrySample]) Hangs or terminates

Providing a response and feedback to this: https://origin-devforums.apple.com/forums/thread/827311 and https://developer.apple.com/forums/thread/827043?page=1#889020022

I have a created a feedback/bug report with ID FB22823733

Feedback Report: I have created a feedback report as well like recommended with this ID: FB22823733, with more elaborate images of my implementation, also see here

More clarity:

Yes, this is for an iOS app(iOS 18+) but testing and debugging on Xcode(MacOS 15.7.7, M4 24GB), which traps or hangs on getting to [PhotogrammetrySample] even while using the lazy sequence and the contentsOf as specified in your docs. I also tried using the PhotogrammetrySession folder run but its still failed with : CoreOC.PhotogrammetrySession.Error 6 and I understand to mean alignment failed.

What can be done or do you guys expose any functions that can be used to aid, or handle these internally, can't find any internally.

The ObjectMasks are actually segmentation masks from an ML algorithm .

To replicate try calling PhotogrammetrySession(input: [PhotogrammetrySample]) with contentsOf as captured on your documentation, even with like 30 image set or is there something I'm missing.

Hello @Axuby:

Thank you for filing this feedback.

You can see the status of your feedback in Feedback Assistant. There, you can track if the report is still being investigated, has a potential identifiable fix, or has been resolved in another way. The status appears beside the label "Resolution." We're unable to share any updates on specific reports on the forums.

For more details on when you'll see updates to your report, please see What to expect after submission.

While we await a response to this FB, I wanted to collect a few potentially helpful resources from related posts on this topic (827043, 827311).

First, it's important to confirm the device in use. Both Scanning objects using Object Capture and Creating 3D objects from photographs describe the hardware that supports photogrammetry, and provide illustrative sample code.

Next, we'd like to confirm that your application adheres to the guidance in that sample code. Can you please confirm that you're gating behavior behind PhotogrammetrySession.isSupported?

Finally, we'd like to confirm the pixel format used with your objectMask is supported. What format are you working with?

Thanks,

Steve

Yes, the testing device here is the iPhone 16 Pro, which more than satisfies the requirements shared screenshots of my implementation on ID FB22823733

Device: the test is on . iPhone 16 Pro(iOS 18). On-device Object Capture runs only when PhotogrammetrySession.isSupported is true at reconstruct time.

isSupported: Yes. Before creating any PhotogrammetrySession, I call guard PhotogrammetrySession.isSupported else { … return } in our reconstruction entry point (PhotogrammetryQuickLookViewModel.reconstruct).

objectMask format: For sample-based input I use CVPixelBuffer with kCVPixelFormatType_OneComponent8, matching the color image width and height, IOSurface-backed, binarized 0/255. For our default masked pipeline we use directory input with 8-bit grayscale {stem}_mask.png and {stem}_mask.tif sidecars and PhotogrammetrySession.Configuration.isObjectMaskingEnabled = true, per Object Capture folder guidance.

Thanks for sharing this additional detail, @Axuby.

Please remember to attach a sysdiagnose to this feedback as described here.

We'd also like to know if you can successfully reconstruct on a folder of just images (i.e., without masks) in your folder. This basic check can tell if it is a fundamental issue with the hardware / software version.

Using custom provided masks is an advanced pathway that is tricky to get right, so it would be helpful to understand if the reconstruction works at all on the dataset, prior to introducing this additional complexity.

It would be helpful if you could also add this detail to the Feedback in question. Thank again.

Yes, I can reconstruct without masks, but with masks it fails with the Core.OC 6 error. Also I attached the snippets and screenshots on the Feedback ID FB22823733. Even followed the async method descirbed in one of your wwdc videos for masked reconstruction but it still hung or broke. .

PhotogrammetrySession(input: [PhotogrammetrySample]) Hangs or terminates
 
 
Q