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.
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
Updated: July 18, 2022.
Apple has promised that starting from ARKit 5.0 you'll be able to simultaneously track up to 100 images.
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];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With