Cloud Recognition
Related Documentations |
---|
Target Manager |
Recommended Conditions for Target Images |
Tracker Coordinate System in Unity |
You can recognize and track 2D images registered on MAXST Developer Site to enhance the 3D content, video images, and Chroma key images.
Make Image Tracker Scene
Set Cloud SecretID / SecretKey
Add / Replace Target Image
Start / Stop Tracker
Use Tracking Information
Change Tracking Mode
Make Cloud Tracker Scene
Install [MAXST AR SDK for Unity.][MAXST AR SDK for Unity]
Create a new scene.
Delete the Main Camera that exists by default and add 'Assets > MaxstAR > Prefabs > ARCamera, ImageTrackable' to the scene.
※ If you build, you should add [License Key][License Key] to ARCamera.
Create an empty object and add 'Assets > MaxstARSamples > Scripts > ImageTrackerSample' as a component.
Create a cube as a child of CloudTrakable and adjust its size and position.
The cube will be augmented by illuminating the target image to the camera after Play.
Set Cloud SecretID / SecretKey
If you want to use cloud target, you have to enter SecretID and SecretKey before start the tracker.
>CloudTrackerSample.cs
void Start() { ... TrackerManager.GetInstance().setCloudRecognitionSecretIdAndSecretKey("32b41d66c3924477955...", "c40d6fbca31e4d03baa6..."); TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_CLOUD_RECOGNIZER); ... }
Add / Replace Target Image
There are two ways of trackign taret images. First, you can track all the target images that you've uploaded on the cloud. Second, you can define the target images that you want to use as target.
Start / Stop Tracker
Refer to the following code to start / stop the cloudtracker.
>CloudTrackerSample.cs
void Start() { ... TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_CLOUD_RECOGNIZER); ... } void OnApplicationPause(bool pause) { ... TrackerManager.GetInstance().StopTracker(); ... } void OnDestroy() { ... TrackerManager.GetInstance().StopTracker(); TrackerManager.GetInstance().DestroyTracker(); }
Use Tracking Information
Refer to the following code to use the tracking information.
>CloudTrackerSample.cs
void Update() { ... TrackingState state = TrackerManager.GetInstance().UpdateTrackingState(); TrackingResult trackingResult = state.GetTrackingResult(); if(trackingResult.GetCount() > 0) { Trackable trackable = trackingResult.GetTrackable(0); if(cloudTrackablesMap.ContainsKey(trackable.GetCloudName())) { foreach (var cloudTrackable in cloudTrackablesMap[trackable.GetCloudName()]) { cloudTrackable.OnTrackSuccess(trackable.GetId(), trackable.GetName(), trackable.GetPose()); } } else { if(cloudTrackablesMap.ContainsKey("_MaxstCloud_")) { foreach (var cloudTrackable in cloudTrackablesMap["_MaxstCloud_"]) { cloudTrackable.OnTrackSuccess(trackable.GetId(), trackable.GetName(), trackable.GetPose()); } } } } }
Change Tracking Mode
5 Tracking Modes of Cloud Tracker: NORMAL_TRACKING, EXTENDED_TRACKING, MULTI_TRACKING, JITTER_REDUCTION_ACTIVATION, JITTER_REDUCTION_DEACTIVATION
- NORMAL_TRACKING: Defaul Setting.
TrackerManager.GetInstance().SetTrackingOption(TrackerManager.TrackingOption.NORMAL_TRACKING);
- EXTENDED_TRACKING: Traceable even at the far distance from the target image.
TrackerManager.GetInstance().SetTrackingOption(TrackerManager.TrackingOption.EXTEND_TRACKING);
- MULTI_TRACKING: Possible to recognize and track up to three target images at the same time.
TrackerManager.GetInstance().SetTrackingOption(TrackerManager.TrackingOption.MULTI_TRACKING);
- 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);