Marker Tracker

Related documentations
Marker
Tracker Coordinate System

By recognizing and tracking the provided markers, you can augment images, 3D objects or videos especially when there are plenty of targets. 8,192 markers will be provided which were developed by MAXST itself.

Create Instants
Start / Stop Tracker
Use Tracking Information
Change Tracking Mode

Create Instants

>MarkerTrackerViewController.mm

- (void)viewDidLoad
{
    ...
    trackingManager = [[MasTrackerManager alloc] init];
    cameraDevice = [[MasCameraDevice alloc] init];
}

Start / Stop Tracker

To start / stop Tracker after loading the map, refer to the following code.

>MarkerTrackerViewController.mm

- (void)resumeAR
{
    ...
    [trackingManager startTracker:TRACKER_TYPE_MARKER];
}

- (void)pauseAR
{
    [trackingManager stopTracker];
    ...
}

Use Tracking Information

You can get marker information in 'MasTrackable'. Marker Number is setted function 'getId' in 'MasTrackable'.

>ImageTrackerViewController.mm

- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
    ...
    MasTrackingState *trackingState = [trackingManager updateTrackingState];
    MasTrackingResult *result = [trackingState getTrackingResult];
    
    MasTrackedImage *trackedImage = [trackingState getImage];
    [backgroundCameraQuad draw:trackedImage projectionMatrix:[cameraDevice getBackgroundPlaneProjectionMatrix]];

    matrix_float4x4 projectionMatrix = [cameraDevice getProjectionMatrix];
    int trackingCount = [result getCount];
    
    if(trackingCount > 0)
    {
        for (int i = 0; i < trackingCount; i++)
        {
            MasTrackable *trackable = [result getTrackable:i];
            
            recognizeID = [[NSString alloc] initWithFormat:@"%@ %@,", recognizeID, [trackable getId]];
            
            [texturedCube setProjectionMatrix:projectionMatrix];
            [texturedCube setPoseMatrix:[trackable getPose]];
            [texturedCube setTranslation:0.0f y:0.0f z:-0.05f];
            [texturedCube setScale:1.0f y:1.0f z:0.1f];
            [texturedCube draw];
            ...
        }
    }
    ...
}

Change Tracking Mode

4 Tracking Modes of Marker Tracker:

NORMAL_TRACKING, ENHANCED_TRACKING, JITTER_REDUCTION_ACTIVATION, JITTER_REDUCTION_DEACTIVATION

  • NORMAL_TRACKING: Default Setting. Traceable multiple target image.
[trackingManager setTrackingOption:NORMAL_TRACKING];
  • ENHANCED_TRACKING: This feature tracks the marker intensively that recognizes the first.
[trackingManager setTrackingOption:ENHANCED_TRACKING];
  • JITTER_REDUCTION_ACTIVATION: Jitter reduction.
[trackingManager setTrackingOption: JITTER_REDUCTION_ACTIVATION];
  • JITTER_REDUCTION_DEACTIVATION: Disable the jitter reduction option.
[trackingManager setTrackingOption: JITTER_REDUCTION_DEACTIVATION];