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.
Start / Stop Tracker
After setting the markers, refer to the following code to start / stop the tracker.
MarkerTrackerActivity.java @Override protected void onResume() { ... TrackerManager.getInstance().startTracker(TrackerManager.TRACKER_TYPE_MARKER); ... } @Override protected void onPause() { ... TrackerManager.getInstance().stopTracker(); ... }
Use Tracking Information
Refer to the following code to use the tracking information. You can choose the marker and augment the content by creating the conditional statement with trackable.getID ().
MarkerTrackerRenderer.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.05f); texturedCube.setScale(1.0f, 1.0f, 0.1f); texturedCube.draw(); } }
Set Target Marker
Once you enter the target marker size (m) and call the addTrackerData, you can track the marker in real scale. Refer to the following code to set a target marker.
MarkerTrackerActivity.java @Override protected void onCreate(Bundle savedInstanceState) { TrackerManager.getInstance().addTrackerData("All : 1.3, id0 : 0.5, id1 : 0.5, id3 : 0.4, id10 : 1.5", true); TrackerManager.getInstance().loadTrackerData(); }
Change Tracking Mode
2 Tracking Modes of Marker 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);