Only able to detect and track up to 4 images at a time with ARKit 3.0

后端 未结 2 1859
北恋
北恋 2021-01-18 06:26

Using the code below I\'m only able to detect and track up to 4 images at any one time when using ARKit.

ARImageTrackingConfiguration *configuration = [ARIma         


        
相关标签:
2条回答
  • 2021-01-18 07:08

    Updated: February 08, 2020.

    At the moment in ARKit 3.0 and ARKit 2.0 you can simultaneously track up to 4 images. Not more than four.

    Even though ARKit 3.0 official documentation says that .maximumNumberOfTrackedImages instance property could be equals to 100, this hundred of images is just a total number of tracked images in a session. Apple software engineers limited image tracking feature to four images at a time. This makes sense because tracking more than four images at a time is very CPU- and GPU-expensive.

    Also, you can read about it here.

    - (void)viewWillAppear:(BOOL)animated {
    
        [super viewWillAppear:animated];
    
        ARWorldTrackingConfiguration *config = [ARWorldTrackingConfiguration new];
        config.detectionImages = [ARReferenceImage referenceImagesInGroupNamed:@"Resources" bundle:nil];
    
        config.maximumNumberOfTrackedImages = 100;       // in ARKit 3.0
        // config.maximumNumberOfTrackedImages = 25;     // in ARKit 2.0
    
        [self.sceneView.session runWithConfiguration:config];
    }
    
    0 讨论(0)
  • 2021-01-18 07:13

    Found the official answer in a comment made to ARImageTrackingConfiguration:

    @discussion Image tracking provides 6 degrees of freedom tracking of known images. Four images may be tracked simultaneously.
    

    EDIT: Found in ARConfiguration.h, line 336

    0 讨论(0)
提交回复
热议问题