Show / Hide Table of Contents

    ImageTarget Extension Tracking

    Note

    Support:Android / iOS

    Tips: Because VOID SLAM technology requires the inertial measurement unit (IMU), it currently only works for mobile platform (Android, iOS). Cloud Recognition is currently unavailable for this function.


    Part 1. Introduction

    When the "Image Target Recognition" (with image marker) is successful, track the model using "VOID SLAM" technology.

    Part 2. Reading Guidelines

    This tutorial is mainly to introduce how to process in Unity environment.

    We assume that readers have basic experience in app development and unity usage.

    For more unity3d usage information, please visit the official website of unity3d documentation.

    Part 3. Development Environment

    You need to install and prepare your development environment as below before you start.

    OS

    • Windows 7 or higher
    • OS X 10.10 or higher

    Unity Version Support

    Unity3D Version VOID AR SDK Full Features
    5.6.x Support All Features
    2017.x Support All Features
    2018.x Support All Features
    2019.1.x Support All Features
    2019.2.0 Support All Features
    Note

    Unity3D of this tutorial: Unity 2017.4.13

    Unity3D Download: https://unity3d.com/cn/get-unity/download/archive

    Part 4. Implementation process

    Step 1. Open new Unity project

    Open Unity with new project. Fill the Project name with “ImageExtension”, and select the location, and click [ Create project ].

    1

    Step 2. Import VOID AR SDK

    Select[ Assets ] -> [ Import Package ] -> [ Custom Package... ], import VOID AR SDK.

    2

    Select the downloaded SDK file (.unitypackage), and click [ Open ] button.

    3

    Click [ Import ] from the prompted window. It takes minutes during the import process.

    4

    If there is a prompt window of “API Update Required” interface,please click [ I Made a Backup, Go Ahead! ].

    5

    Step 3. Delete Main Camera

    Note

    When you open the Unity3D, you will see the new scene in default. The new scene has two GameObjects: a "Main Camera" and a "Directional Light". We need to use the ARCamera from SDK, so please delete the default Camera.

    Right click the "Main Camera” from the scene, and select [ Delete ].

    6

    Step 4. Drag the prefabs “ARCamera” and “ImageExtensionTarget”

    Expand the directory [ Assets ] -> [ VoidAR ] -> [ Prefabs ],

    and drag the prefabs “ARCamera” and “ImageExtensionTarget” to the scene.

    2

    When you finish the process, it shows as below:

    3

    Step 5. ARCamera Setup

    Select ARCamera, and look up in the “Inspector” area on the right side, setup “Void AR Behaviour (Script)” properties.

    • Set MarkerType = "ImageExtension"

    4

    Step 6. Set App License Key

    Open the website of Cloud platform to register an account, and login.

    Website Url:https://cloud.voidar.net

    126

    Go to the Cloud plaform, and click [ Create SLAM application ].

    127

    Click [ Create application ].

    128

    Fill in the AppId in the popup window, and click [ Save ].

    Note

    Since the AppId is unique, please setup your AppId here, such as "com.VOIDAR.ImageExtension"

    Warning

    Make sure that your AppId and Bundle Identifier must be the same. Otherwise, when you need to remove the watermark, it will not work properly.

    18

    完成后,获得“AppKey”。

    19

    Back to Unity, select ARCamera, and check the Inspector on the right side, and continue with the setup of “App License Key”.

    7

    Step 7. Marker Setup

    Select ImageExtensionTarget, look up the “Inspector” area on the right side, setup the “Image Extension Behaviour (Script)” properties.

    • Set Image File Path = "Panda.jpg", the format is “filename”+“Suffix JPG”
    • Set Marker Width = "0.2258",fill in the real width of the marker (m)
    Warning

    Marker files must locate in [ Assets ] -> [ StreamingAssets ] folder. This tutorial uses the built-in marker file in SDK.

    11

    After setup, it shows as below:

    8

    Step 8. Model Setup

    Note

    You need to have your model for recognition under the ImageExtensionTarget.

    Right click the “ImageExtensionTarget” in the scene, add a 3D model “Cube”.

    9

    Select the “Cube”, adjust its size and position.

    10

    Step 9. Save Scene

    Select [ File ] -> [ Save Scenes ] , click for saving your setup.

    14

    Setup the name as “ImageExtension”, and click [ save ] button.

    11

    Step 10. Publishing Builds

    Build Process includes Android and iOS.

    Android

    First, switch the PC platform to Android platform from [ File ] -> [ Build Settings... ].

    18

    Select Android tag, if the [ Switch Platform ] button is grey, you need to download the Unity Android Support. Please click on the right side of the [ Open Download Page ] button, download and install.

    19

    Click [ Switch Platform ] button, switch the platform to Android.

    20

    After switch process, close the Build Settings interface first, and continue with packing.

    Select [ Edit ] -> [ Preferences... ], setup the preferences parameters.

    47

    Select “External Tools” option, setup Android SDK and JDK。

    Note

    If you do not have SDK and JDK, please click [ Download ] from the interface, it will guide you to download from the prompted website.

    Or you can also download from links below:

    SDK: https://developer.android.com/studio/index.html

    JDK: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    After the installation of SDK and JDK, you are able to setup their directory.

    48

    Select ARCamera, and look up in the “Inspector” area on the right side, setup “Void AR Behaviour (Script)” properties.

    • Set Camera = "后置摄像头"(Rear camera)

    12

    Select [ File ] -> [ Build Settings... ], cancel all default scenes, and click [ Add Open Scenes ] button to add current scene into the build area.

    21

    It shows as below:

    13

    Setup parameters

    Click [ Player Settings... ] button, check the “Inspector” area, setup the parameters as below or as your needs.

    • Set Company = "VOIDAR"

    • Set Product Name = "ImageExtension"

    • Important

      Cancel the selection of “Multithreaded Rendering” !

    • Important

      Set Bundle Identifier= "com.VOIDAR.ImageExtension" (The Bundle Identifier must be as same as the AppId you setup in Step 6. Otherwise, when you need to remove the watermark, it will not work properly.)

    14

    Finish the settings, and click [ Build ] button.

    15

    Set the file name as “ImageExtension”, and click [ save ] button to start building.

    16

    It takes minutes while building, please wait...

    26

    When the build is done, it will generate an apk file “ImageExtension.apk”.

    Android Build is completed.

    iOS

    iOS Build requires Mac device ( such as MacBook Pro、MacBook、iMac、Mac mini etc. )

    Switch the platform to iOS platform in Unity, and build Xcode project.

    Warning

    It is recommended to use Mac device to build Xcode project. If previously you make the project in Windows environment, you can export the Unity project as a unitypackage, or copy it to Mac device and build for xcode project.

    Launch Unity and open the saved or copied ImageExtension project. ( Skip this step if project opened already )

    28

    Click [ Open ] button to open the project.

    24

    Switch to iOS platform in Unity, click [ File ] -> [ Build Settings... ].

    30

    Select iOS tag, if the [ Switch Platform ] button is grey, you need to download the Unity iOS Support. Please click on the right side of the [ Open Download Page ] button, download and install.

    31

    Click [ Switch Platform ] button, switch the platform to iOS.

    32

    Click [ Player Settings... ] button after switch.

    340

    Important

    Cancel the selection of “Multithreaded Rendering”!

    51

    Close the Build Settings interface, select ARCamera, check the “Inspector” area on the right side, setup the "Void AR Behaviour (Script)” properties.

    • Set Camera = "后置摄像头"(Rear Camera)

    20

    Select [ File ] -> [ Build Settings... ], cancel all default scenes, and click [ Add Open Scenes ] button to add current scene into the build area.

    34

    It shows as below:

    21

    Finish the settings, and click [ Build ] button.

    22

    Set the project folder name “Output”, and click [ Save ].

    37

    Open the Xcode project.

    38

    Setup parameters

    Filling in your configurations: your certificate, deployment target.

    Click [ Unity-iPhone ] on the left side, config the parameters as below or by your customization:

    • Display Name = "VOIDAR_Test"

    • Important

      Set Bundle Identifier= "com.VOIDAR.ImageExtension" (The Bundle Identifier must be as same as the AppId you setup in Step 6. Otherwise, when you need to remove the watermark, it will not work properly.)

    • Version = "1.0"

    • Build = “1.0”

    • Team = “Your Certificate”

    • Deployment Target = “8.1”

    23

    Add Accelerate.framework

    Select General tag and scroll down, click the "+" in the "Linked Frameworks and Libraries".

    40

    Select “Accelerate.framework” from the prompted window, and click [ Add ].

    41

    After doing that, you will see “Accelerate.framework” from the list of "Linked Frameworks and Libraries" as below:

    42

    Add camera usage privacy

    Select “Info” tag, click the "+" below the "Supported interface orientations". Select “Privacy - Camera Usage Description” in the prompting list.

    43

    44

    Set Enable Bitcode = “No”

    Select ”Build Settings” tag, set Enable Bitcode = “No”.

    45

    Cancel armv7

    Select "Build Settings" tab, expand Architectures, and select "Other...".

    52

    The pop-up interface, select "armv7" and click "-".

    53

    After canceling, the display is as below.

    54

    Connect iphone or ipad to the Mac device, Click [ Run ].

    46

    After building, there will be an application “VOIDAR_Test” built into your iphone or ipad.

    The iOS build is done.

    By here, ImageTarget Extension Tracking process is done.

    Back to top Generated by DocFX