Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 = [ARImageTrackingConfiguration new];  
configuration.trackingImages = [ARReferenceImage referenceImagesInGroupNamed:@"AR Resources" bundle:nil];  
configuration.maximumNumberOfTrackedImages = 100;  
[self.sceneView.session runWithConfiguration:configuration]; 

Is anyone able to confirm what I'm seeing? I need to be able to track a larger number of images/markers and was excited when I saw this offered in the ARKit 3 announcement.

Would be great if someone is able to replicate this so I know I'm not imagining things ^^

I hope this isn't an Apple limitation, the 3DS could detect and track more than 4 images over 8 years ago.

like image 794
CodemanDoEl Avatar asked Jun 29 '19 09:06

CodemanDoEl


2 Answers

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

like image 183
CodemanDoEl Avatar answered Nov 08 '22 11:11

CodemanDoEl


Updated: July 18, 2022.

ARKit 6.0+

Apple has promised that starting from ARKit 5.0 you'll be able to simultaneously track up to 100 images.

ARKit 4.0 and earlier

In ARKit 4.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];
}
like image 3
Andy Jazz Avatar answered Nov 08 '22 11:11

Andy Jazz