Getting Started with EasyAR

Targets in EasyAR

EasyAR offers a flexible target management interface. It is easy to use. You can generate EasyAR targets at runtime, and do not need to login the website to upload and download a lot of stuffs.

EasyAR manages targets in two steps.

The first step is to load configuration and setup target. For C++, you can reference Target and ImageTarget for target details and load/unload. And for Unity, you can reference Target and ImageTarget for the same, and additional ImageTargetBaseBehaviour and ImageTarget Prefab for how to use it in the editor.

The second step is to load the target into the tracker for track. EasyAR load and unload target to the tracker in an async way, it will not block the calling thread so perform an incremental background loading.

A target loaded into the tracker will be passed by a Frame when Augmenter::newFrame called and finally form a part of the AugmentedTarget.

Target Json Configure

The flexibility of EasyAR target do not stop at the load/unload interface. You can also get flexibility in the configure file.

You can load a target from image only or with some detailed configurations. EasyAR use json format to store target configurations. The full data interface is like below.

{
  "images" :
  [
    {
      "image" : "idback.jpg",
      "name" : "idback",
      "size" : [8.56, 5.4],
      "uid" : "uid-string"
    }
  ]
}
                    

The above json contains all fields that can be used by EasyAR: target image path, target name, target size and target uid. Only the target image path is required among all the fields. So the following json is acceptable.

{
  "images" :
  [
    {
      "image" : "argame00.jpg",
      "name" : "argame"
    }
  ]
}
                    

And this is also acceptable.

{
  "images" :
  [
    {
      "image" : "argame00.jpg"
    }
  ]
}
                    

You can put multiple targets into the same json file and load them together or separately.

{
  "images" :
  [
    {
      "image" : "argame00.jpg",
      "name" : "argame"
    },
    {
      "image" : "idback.jpg",
      "name" : "idback",
      "size" : [8.56, 5.4],
      "uid" : "uid-string"
    }
  ]
}
                    
{
  "images" :
  [
    {
      "image" : "sightplus/argame01.jpg",
      "name" : "argame01"
    },
    {
      "image" : "sightplus/argame02.jpg",
      "name" : "argame02"
    },
    {
      "image" : "sightplus/argame03.jpg",
      "name" : "argame03"
    }
  ]
}
                    

Sometimes you do not actually care about detail configurations like size or name, and you just want to load a lot of images as targets. So we offer a simplified configuration.

{
  "images": [
    "argame00.jpg"
  ]
}
                    

Like above, all you have to write is just a line of image path. With a lot of images, you can write,

{
  "images": [
    "argame00.jpg",
    "argame01.jpg",
    "argame02.jpg",
    "argame03.jpg",
    "argame04.jpg",
    "argame05.jpg"
  ]
}
                    

Also, you can combine all above together. The following sample shows a combination with different ways to write the path. Make sure to write unix-like path (use / to seperate path components). EasyAR supports only ASCII characters in the path string in current version.

{
  "images": [
    "path/to/argame00.jpg",
    "path/to/argame01.png",
    "argame02.jpg",
    {
      "image" : "path/to/argame03.jpg"
    },
    {
      "image" : "argame04.png",
      "name" : "argame"
    },
    {
      "image" : "idback.jpg",
      "name" : "idback",
      "size" : [8.56, 5.4],
      "uid" : "uid-string"
    },
    "c:/win/absolute/path/to/argame05.png",
    "/unix/absolute/path/to/argame06.jpg"
  ]
}