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



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

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

此外,每个云图像目标都可以选择性地具有关联的元数据;目标元数据本质上只不过是一个自定义的用户定义的数据块,只要数据大小不超过允许的限制(每个目标最多1MB),它就可以与目标关联并填充自定义信息。

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

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

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).

EDIT:这是对您问题的第一部分的回答:"元数据应该使用什么"(而不是关于如何查找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"
}

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

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

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

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

最新更新