Reading Meta Data in CRS in unity

0 votes
asked Sep 25, 2017 by unishubh (140 points)
How to read metadata in CRS and use it to specify Image Target?

2 Answers

0 votes
answered Sep 25, 2017 by albert52 (31,850 points)

hi,

You can process the json.

For example : https://www.easyar.com/doc/EasyAR%20CRS/api/farmer-create.html

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 0,
    "result": {
        "targetId":"e61db301-e80f-4025-b822-9a00eb48d8d2",
        "trackingImage":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
        "name": "easyar",
        "size": "5",
        "meta": "496fbbabc2b38ecs3460a...",
        "type": "ImageTarget",
        "date": "2016-06-15T09:56:30.000Z",
        "active":"1"
    },
    "date": "2016-06-15T09:09:19.954Z"
}

statusCode:0 is OK,1 is invalid appKey,2 is invalid signature,3 is invalid date

result:core result body

date:datetime of response at server.

targetId:Unique identity of the target

trackingImage:tracking image stored in server for AR tracking

name: Target Name

size:Width of target image ( cm )

meta:users’ custemized info uploaded: e.x. json text, base64 encoded, or url-encoded, etcd

type:”ImageTarget”

active:”1” is active, “0” is inactive

0 votes
answered Aug 14, 2019 by jalajshah (230 points)

n CloudRecognizeBehaviour >> Open()>> there are reference of ImageTargetController
open it 
>>OnFound() >>

add code 
        byte[] mbyte = System.Convert.FromBase64String(target.meta());
         string meta = Encoding.UTF8.GetString(mbyte);

you will get meta, 

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...