什么是元数据?如何创建元数据以及如何使用Vuforia将其与云目标相关联?

时间:2013-11-25 05:29:19

标签: vuforia

我为自己的代码修改了示例CloudRecog代码。我创建了云数据库并获取AccessKeys,然后将此密钥复制到CloudReco.cpp文件。我应该如何使用元数据。我不明白这一点。然后当我阅读示例代码时,我看到了这一行:private static final String mServerURL =“https://ar.qualcomm.at/samples/cloudreco/json/”。如何获取我的metaData网址?

3 个答案:

答案 0 :(得分:3)

Vuforia云识别服务支持零售和出版中的新型应用。使用云识别的应用程序将能够使用摄像机图像查询云数据库(实际识别发生在云中),然后处理从云返回的匹配结果以执行本地检测和跟踪。

此外,每个云图像目标都可以选择具有关联的元数据;目标元数据基本上只是一个自定义的用户定义的数据blob,可以与目标关联并填充自定义信息,只要数据大小不会达到允许的限制(每个目标最多1MB)。 / p>

因此,您可以使用元数据来存储与特定目标相关的其他内容,您的应用程序可以使用某些自定义逻辑来处理这些内容。

例如,您的应用程序可能会使用元数据来存储:

a simple text message that you want your app to display on the screen of your device when the target is detected, for example:
    “Hello, I am your cloud image target XYZ, you have detected me :-) !”
a simple URL string (for instance “http://my_server/my_3d_models/my_model_01.obj”) pointing to a custom network location where you have stored some other content, like a 3D model, a video, an image, or any other custom data, so that for each different image target, your application may use such URL to download the specific content;
more in general, some custom string that your application is able to process and use to perform specific actions
a full 3D model (not just the URL pointing to a model on a server, but the model itself), for example the metadata itself could embed an .OBJ 3D model, provided that the size does not exceed the allowed limits (up to 1MB)
and more ...

如何为云目标创建/存储元数据?

在云数据库中创建目标时,元数据可以与图像目标一起上传;或者您也可以在以后更新现有目标的元数据;在任何一种情况下,您都可以使用在线TargetManager,如下所述:

https://developer.vuforia.com/resources/dev-guide/managing-targets-cloud-database-using-target-manager

或者您可以使用VWS API以编程方式继续,如下所述:

https://developer.vuforia.com/resources/dev-guide/managing-targets-cloud-database-using-developer-api

如何识别云目标的元数据?

Vuforia SDK提供了一个专用API,用于检索移动应用程序中目标的元数据。当检测到(识别)云目标时,会向应用程序报告新的TargetSearchResult,并且可以使用以下方法之一获取元数据:

Vuforia Native SDK - C++ API:        TargetSearchResult::getMetaData()  -  const char*
Vuforia Native SDK - Java API:        TargetSearchResult.getMetaData()  -  String
Vuforia Unity Extension - C# API:    TargetSearchResult.Metadata  - string

另请参阅API参考页面:

https://developer.vuforia.com/resources/api/classcom_1_1qualcomm_1_1vuforia_1_1_target_search_result

https://developer.vuforia.com/resources/api/unity/struct_target_finder_1_1_target_search_result

示例代码:

For a reference sample code in native Android, see the code in the Books.java in the "Books-2-x-y" sample project.
For a reference sample code in native iOS, see the code in the BooksEAGLView.mm file in the  "Books-2-x-y" sample project.
For a reference sample code in Unity, see the CloudRecoEventHandler.cs script (attached to theCloudRecognition prefab) in the Books sample; in particular, the OnNewSearchResult method shows how to get a targetSearchResult object (from which you can then get the metadata, as shown in the example code).

答案 1 :(得分:1)

编辑:这是对你问题的第一部分的回应:“我应该使用什么元数据”(不是关于如何找到URL的第二部分)

根据他们的文档(https://developer.vuforia.com/resources/dev-guide/cloud-targets):

  

每当Cloud Reco将元数据传递给应用程序   目标被认可。由开发人员决定   这个元数据的内容 - Vuforia将其视为一个blob并且只是通过   它与应用程序一致。可上载的最大大小   元数据是150kByte。

我在他们的CloudRecognition应用程序中添加了一些调试,并看到他们在“识别”图像时返回的有效负载(可能是元数据)是:

{
    "thumburl": "https://developer.vuforia.com/samples/cloudreco/thumbs/01_thumbnail.png",
    "author": "Karina Borland",
    "your price": "43.15",
    "title": "Cloud Recognition in Vuforia",
    "average rating": "4",
    "# of ratings": "41",
    "targetid": "a47d2ea6b762459bb0aed1ae9dbbe405",
    "bookurl": "https://developer.vuforia.com/samples/cloudreco/book1.php",
    "list price": "43.99"
}

答案 2 :(得分:1)

与CloudReco数据库中的图像目标一起上传的MetaData是一个.txt文件,包含您想要的任何内容。

作为示例应用程序的有效负载,pherris链接的内容实际上是给定图像目标的元数据链接到的.json文件的内容。

在示例应用程序中,结构如下:

  • 应用程序激活相机并识别图像目标
  • 然后,应用程序会请求特定的图像目标元数据
  • 在这种情况下,有问题的元数据是一个.txt文件,其中包含以下内容:  http://www.link-to-a-specific-json-file.com/randomname.json
  • 然后,应用程序请求该特定.json文件的内容
  • 特定的.json文件看起来像pherris链接的复制粘贴的文本数据
  • 应用程序使用.json文件中的文本数据来填写示例应用程序的实际内容