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
Updated: February 08, 2020
.
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];
}
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