Try MAXST AR Fusion Tracker Now ✨

QR Code Tracker Uwp Tutorial

1. Overview
2. Uwp Development
2.1 Start / Stop Tracker
2.2 Use Tracking Information
2.3 Change Tracking Mode
3. Reference
3.1 API Reference
3.2 Sample


1. Overview

Start developing MAXST ARSDK QR Code Tracker on Uwp Platform. Refer to QR Code Tracker Introduction for detailed information.

Refer to Tracker Coordinate System to better understand 3D coordinate system of QR Code Tracker.

Prerequisites
QR Code Tracker Introduction
Tracker Coordinate System

2. Uwp Development

Start developing on Android Studio using Java. Please refer to Requirements & Supports to find out which devices are supported.

ARSDK has to properly integrate on Android Activity. Refer to Life Cycle documents for detail.


2.1 Start / Stop Tracker

To start / stop the tracker, refer to the following code.

※ To change the tracker, destroyTracker() should be called before

QR Code TrackerActivity.Java


    @Override
    protected void onResume() {
        ...
        TrackerManager.getInstance().startTracker(TrackerManager.TRACKER_TYPE_QR_TRACKER);
        ...
    }

    @Override
    protected void onPause() {
        ...
        TrackerManager.getInstance().stopTracker();
        ...
    }


2.2 Use Tracking Information

Refer to the following code to use the tracking information. You can choose the qrcode including the special keyword and augment the content by creating the conditional statement with trackable.getName().

※ startTracker() should be called before

QR Code TrackerRenderer.Java


    @Override
    public void onDrawFrame(GL10 unused) {
        ...
        TrackingState state = TrackerManager.getInstance().updateTrackingState();
        TrackingResult trackingResult = state.getTrackingResult();
        ...
        for (int i = 0; i < trackingResult.getCount(); i++) {
            Trackable trackable = trackingResult.getTrackable(i);
            texturedCube.setProjectionMatrix(projectionMatrix);
            texturedCube.setTransform(trackable.getPoseMatrix());
            texturedCube.setTranslate(0, 0, -0.1f);
            texturedCube.setScale(1.0f, 1.0f, 0.1f);
            texturedCube.draw();
        }
    }


2.3 Change Tracking Mode

2 Tracking Modes of QR Code Tracker:

  • JITTER_REDUCTION_ACTIVATION
  • JITTER_REDUCTION_DEACTIVATION

※ JITTER_REDUCTION_DEACTIVATION is the default

  • JITTER_REDUCTION_ACTIVATION: Jitter reduction.
TrackerManager.getInstance().setTrackingOption(TrackerManager.TrackingOption.JITTER_REDUCTION_ACTIVATION);
  • JITTER_REDUCTION_DEACTIVATION: Disable the jitter reduction option.
TrackerManager.getInstance().setTrackingOption(TrackerManager.TrackingOption.JITTER_REDUCTION_DEACTIVATION);

3. References

These are additional references to develop QR Code Tracker


3.1 API Reference

Following documents explain classes and functions used to run QR Code Tracker.

MaxstAR Class

TrackerManager Class

CameraDevice Class


3.2 Sample

For information regarding sample build and run of QR Code Tracker, refer to Sample

QR Code TrackerActivity.Java

QR Code TrackerRenderer.Java