QR Code Tracker

Related documentations
Tracker Coordinate System

By recognizing / tracking QR Code, you can augment various contents. You can augment the information of QR Code used in real life, the URL link button using this information, the 3D model, or image. QR Code Model 2 or higher is supported.

Start / Stop Tracker
Use Tracking Information
Change Tracking Mode

Start / Stop Tracker

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


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

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

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().


    QrCodeTrackerRenderer.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();
        }
    }

Change Tracking Mode

2 Tracking Modes of QR Code Tracker:

JITTER_REDUCTION_ACTIVATION, JITTER_REDUCTION_DEACTIVATION

  • JITTER_REDUCTION_ACTIVATION: Default Setting. 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);