Reconstruction with Object Mask in PhotogrammetrySession Fails .

Reconstruction with Object Mask in PhotogrammetrySession Fails and doesn't complete because of alignment and object masks with thing segmentation even after increasing the mask region . Also the PhotogrammetrySample hangs with EXC_BREAKPOINTwhen I usePhotogrammetrySession(input: [PhotogrammetrySample])withobjectMask set and the Apple Developer Forums report crashes (“HelloPhotogrammetry” / sample+mask), and (EXC_BREAKPOINT` was being observed at ~4 GB) with freezing the execution and Xcode interface

It's hard to provide guidance without more information. For example, is this iOS or macOS? Which versions? Which device?

If you are seeing breakpoints at 4GB on an iPhone using the Sequence input to the session, you are likely facing memory issues by trying to hold all images in memory at once during the reconstruction, which will not work on iPhone since the algorithm needs significant memory itself. Since you mention that you're using [PhotogrammetrySample] as the input, I anticipate this is the case. You will need to use a lazy Sequence iterator so only one image is loaded at a time for this to work. Please see https://developer.apple.com/documentation/realitykit/photogrammetrysession/init(input:configuration:)-7glmh#discussion for more information.

You may also be having issues in alignment due to the masks not being the same orientation as the original images, or are in the wrong format. You can check the logs to see if any errors are reported.

Finally, my recommendation would be to capture a feedback report and submit it with the image and mask data so that our engineers can take a look and try to guide you. You can post the bug ID here for reference as well.

Reconstruction with Object Mask in PhotogrammetrySession Fails .
 
 
Q