Start a new topic

Wikitude create image overlay on scanned image

Wikitude create image overlay on scanned image


I want to show one image on top of target image after successful image recognition from wikitude cloud.Is it possible using native android sdk for wikitude?or should I have  to implement cloud recognition from wikitude using java script and android studio? how can I achieve same?I am confused for javascript and native android interaction for cloud recognition.Please post some demo code from which I can start.Thanks in advance.

Hi,

I think that as a first step you need to start with the following documentation in order to understand the differences between Javascript API and Native provided here. If you do not have a lot of experience in programming then I suggest you start with Javascript API and reference to the samples we have. In addition, regarding Cloud Recognition you can have a look at the following example here. If you wish to continue with Native then you may refer to the documentation here.

I hope this helps.

I have already seen documentation for cloud recognition using java script api. How can I implement same in android studio? Where can I write that code in my android Activity?i.e

init: function initFn() {
this.createTracker();
this.createOverlays();
}

 where can I write this code in my android Activity class?
 

- Creating the tracker:

In your Activity class:

private WikitudeSDK _wikitudeSDK;
private CloudTracker _cloudTracker;

 

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
_wikitudeSDK = new WikitudeSDK(this);
WikitudeSDKStartupConfiguration startupConfiguration =
new WikitudeSDKStartupConfiguration(
<YOUR_LICENSE_KEY>, CameraSettings.CameraPosition.BACK, CameraSettings.CameraFocusMode.CONTINUOUS);
_wikitudeSDK.onCreate(getApplicationContext(), this, startupConfiguration);
_cloudTracker = _wikitudeSDK.getTrackerManager().create2dCloudTracker(<YOUR_AUTHENTIFICATION_TOKEN>, <YOUR_TARGET_COLLECTION_ID>);
_cloudTracker.registerTrackerEventListener(this);
}

 

- Creating the overlays:

Using the Wikitude native SDK requires you to do your own rendering. Contrary to the Javascript SDK the native SDK itself does not provide any facilities for displaying augmentations or loading the content related thereto. Therefore if you wish to draw an image augmentation on top of the recognized target you will have to implement the required procedures yourself.

 

I would like to highlight that all this information is readily available on the native SDK documentation pages Eva provided previously. I kindly recommned you have a look at them again as well as the example code distributed with the SDK package. The OnClickCloudTrackingActivity.java particularly should provide useful insights.

 

Additionally, to address something you mentioned previously, there is no interaction between the JS SDK and the native SDK; they are mutually exclusive. Should you be using the JS SDK, you can use Javascript to implement you AR experiences, should you be using the native SDK you cannot.
Login or Signup to post a comment