简体   繁体   English

ARToolkit多个强制标记

[英]ARToolkit Multiple Mandatory Markers

I studied the multimarker documentation of ARToolKit for iOS and i have some troubles in achieving some sort of QR-Code. 我研究了ARToolKit for iOS的多multimarker文档,并且在实现某种QR代码时遇到了一些麻烦。

I want, for example: 我想要例如:

A set of 6 markers positioned differently on a picture, and when and only when ALL of them are present, some sort of video is displayed in the origin of them( i want to use some sort of CORNER Markers like QR-Code system ). 一组6个标记,它们在图片上的位置不同,并且仅当当所有标记都存在时,它们的源中才会显示某种视频(我想使用某种CORNER标记,例如QR码系统)。

How to do this ? 这个怎么做 ? From what i've seen, on multimarkers, if 1 is present out of 6 for example, the object is displayed. 根据我的观察,在多标记上,例如,如果6个中有1个,则显示该对象。

From looking into the ARToolKit code you can see that a MultiMarker is internally handled as one single Marker consisting of several Pattern: 通过查看ARToolKit代码,您可以看到MultiMarker在内部被视为一个由多个Pattern组成的单个Marker:

https://github.com/artoolkit/artoolkit5/blob/master/lib/SRC/ARWrapper/ARMarker.cpp#L344 https://github.com/artoolkit/artoolkit5/blob/master/lib/SRC/ARWrapper/ARMarker.cpp#L344

https://github.com/artoolkit/artoolkit5/blob/master/lib/SRC/ARWrapper/ARMarkerMulti.cpp#L75 https://github.com/artoolkit/artoolkit5/blob/master/lib/SRC/ARWrapper/ARMarkerMulti.cpp#L75

That is why ARToolKit will always return true whenever one of the markers configured in the multi-marker configuration is visible. 因此,只要在多标记配置中配置的标记之一可见,ARToolKit总是返回true。

Taking that into account 'Multi-Markers' are not the way to go for the target you would like to reach. 考虑到“多标记”并不是您想要达到的目标的方法。

What you can do, however, is to configure each marker separately and add them as 'Single-Marker'. 但是,您可以做的是分别配置每个标记并将其添加为“单个标记”。 Then you can query if all of these 'Single-Markers' are visible. 然后,您可以查询所有这些“单个标记”是否可见。

If so you can calculate the origin of all these 'Single-Markers' and render your object there. 如果是这样,您可以计算所有这些“单个标记”的来源,并在那里渲染对象。

You can get an idea on how to configure several 'Single-Markers' if you take a look here: 如果您查看以下内容,则可以了解如何配置多个“单个标记”:

http://augmentmy.world/moving-cars-augmented-reality http://augmentmy.world/moving-cars-augmented-reality

Also take that example here on how to set to markers into the same coordinate system (and calculate the distance between them) you can use that as a starting point for calculating the origin between several markers: 同样在这里以如何将标记设置为同一坐标系(并计算它们之间的距离)为例,您可以将其用作计算多个标记之间原点的起点:

https://github.com/artoolkit/artoolkit5/tree/master/AndroidStudioProjects/ARMarkerDistanceProj https://github.com/artoolkit/artoolkit5/tree/master/AndroidStudioProjects/ARMarkerDistanceProj

I know that these are not iOS examples but I have only done Android so far. 我知道这些不是iOS示例,但到目前为止我只做过Android。 Also, the ARWrapper interface should be the same on Android and iOS, meaning to say there should not be much difference between these two. 另外,ARWrapper界面在Android和iOS上应该相同,这意味着这两者之间应该没有太大区别。

I hope that helps 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM