Vuforia Engine provides the Model Targets Test app to assist in evaluating Model Targets. This application is distributed as a precompiled Android APK package that you can install on your own device.
Model Targets Test App
The Model Targets Test App (vuforia-unity-android-modeltargetstest-X-Y-Z.apk) is intended:
- to allow developers to quickly evaluate the capabilities of the Model Target detection and tracking feature of Vuforia Engine,
- to enable developers to test if their custom Model Targets can be tracked and detected with good performance,
- to allow developers to quickly evaluate the functionality of Model Targets with multiple objects and/or multiple Guide Views in Vuforia Engine, and
- to enable developers to test if their custom Model Targets with multiple objects and/or multiple Guide Views can be recognized, tracked, and detected with good performance.
It comes with a built-in Model Target database containing one Advanced Model Target (NASA Viking Lander), with a 360˚ Advanced Guide View. It also allows you to load your own databases of any type from the device's SD card. Download the .apk package from Vuforia Developer Tools.
A 3D model of the Viking Lander that is suitable for 3D printing is distributed along with the Model Target Native Sample. See Printing and Assembling the Viking Lander for more information.
Installing the App
You can install the app
vuforia-unity-android-modeltargetstest-X-Y-Z.apk on a device by connecting the device to a PC with a USB cable, and then using the Android Debug Bridge (ADB).
- Connect the device to the developer desktop environment using a USB cable.
- Open a Cygwin bash shell or Windows Command Line and execute:
you will see:
List of devices attached
If the device list is empty, or a given device is not listed, kill the ADB server by executing:
- To install the application, navigate to the folder containing the downloaded APK (in our example,
C:\Temp) and install APK using
$ cd /cygdrive/c/temp
$ adb install vuforia-unity-android-modeltargetstest-X-Y-Z.apk
As an alternative approach, you can copy the APK to your device's Download folder and install it from a File Manager application directly on the device.
Testing the Example CAD Object
The test app includes a preinstalled Advanced Model Target database. It comprises of the NASA Viking Lander, which is available as a free download from NASA's website. You will need to make a 3D print of this model if you want to try it yourself. For more information, see Printing and Assembling the Viking Lander.
NOTE: it is important that the scale of the 3D-printed object matches the scale of the Model Target. Please do not change the size of the 3D object when 3D printing!
NOTE: When running the Model Targets Test App with the included Advanced Model Target database no Guide View is drawn immediately. Instead, the app prompts you to move your device around so that it can find the object.
As soon as you point your devices' camera to the object it will be detected and tracked.
- An outline rendering around the object indicates that it is being detected and tracked correctly. You can adjust the width of the rendered outline using the slider.
- For standard Model Target databases, a Guide View is displayed after the database is loaded. As shown below, the user needs to align the Guide View image with the object before tracking begins.
- For Advanced Model Target databases with one or multiple objects with advanced recognition, a guide view will not be displayed on the screen. Instead, when an object is detected, tracking will begin immediately from any view of the Model Target within the recognition range that was specified at generation time in the Model Target Generator (MTG).
NOTE: the circular split-section button on the right is the "Cycle GuideViews" button for standard Model Targets with multiple Guide Views. It enables you to cycle through different Guide Views of the Model Target i.e. front-view and rear-view.
In addition to selecting databases and Guide Views, the Test App has a menu button which will display information about the Model Target's tracking state and different features.
In the menu setting, you may activate the Info Panel that presents tracking states and the mode (ADAPTIVE or STATIC) which the Model target was set to in the MTG. In addition, you may switch to a different Model Target Tracking Mode to test your own Model Target databases. See more information about the motion hint and tracking mode in the article Optimizing Model Target Tracking.
The other options include toggling Autofocus and Device Tracker on and off.
Loading your Own Databases onto the Device
If you have a custom Model Target database (generated using the Model Target Generator) that you would like to test, you can transfer it onto your device's storage and then load it at runtime from inside the test app.
A Model Target database consists of two files:
If the Model Targets Test app has not yet been started, you will need to create the parent directory manually:
To make a database visible to the apps, upload the two database files onto the device storage by copying them into the following directory, as you created, for the Model Targets Test App:
For best results, create this directory before starting the test app.
If you want to test “SomeDatabase” with the Model Targets Test App, copy the .xml and .dat files to the following locations:
If your Android device is connected via USB, you can copy the files using
adb push. Assuming
SomeDatabase.dat are in a subfolder of the current directory called
SomeDatabase, you would use the following command:
adb push SomeDatabase.* /sdcard/Android/data/com.vuforia.engine.ModelTargetsTest/files/ModelTargetData/
The following diagram shows the resulting folder hierarchy:
Selecting and Loading a Database
At runtime, you can double-tap the screen to open the Options menu. Select a database from the list to load it for tracking.
Once you click a database, a loading progress dialogue will appear. On completion, the new Guide View will be displayed if you have loaded a standard Model Target database; or the app will start searching for recognizable objects if you have loaded an Advanced Model Target database
NOTE: The Guide View in Advanced databases are not displayed on the screen. If in your own app you wish to indicate the objects users should look for, we recommend setting a symbolic guide view. See more in Model Target Guide Views.