Log in or register to post comments

How can I detect marker within marker.

January 24, 2013 - 4:33am #1


I want to detect marker within marker, like your Bert and Ernie Video sample First you guys detect first marker and draw walls around that and when you put Bert on First marker it becomes also second marker and show virtual object of Bert. I want to do same replica but I am using Just image any super hero and a ground as a marker. I want to do same task which you are doing but only difference I am using simple images as a marker. So I am getting confuse on two things.

How Can I detect marker within marker.

How can I able to detect second marker when it comes in range of First marker, just like you guys are doing in Bert and Ernie sample.

Help me on that, this will be great for me. Thanks in advance.

How can I detect marker within marker.

January 28, 2013 - 6:16am #8

Hi, the Virtual Buttons will only give you a signal when they get occluded/deoccluded by something (be it your hand of something else);

this is like having a ON/OFF switch; they do not provide you with other features.

However you could maybe try combining the virtual buttons with some custom script (in addition) that for example computes the relative position (e.g. the distance) between the first marker and the second marker, and based on that, you could implement some extra logic.


How can I detect marker within marker.

January 28, 2013 - 6:02am #7

Thanks Alessandro

Sorry for again question, because I am stuck at one issue and that is about virtual button. Vitual button only detects our hands or finger gesture when it comes within region of any button(red, yellow blue etc), but my logic is bit different I have second marker and it should detects that when second marker when it comes within region of first marker unlike Virtual button which detects human hands. So I want to detect real position of second marker and also compare with virtual button like red's current location, so I think this basic logic but how can I do that, any suggestion or do you have any other logic to accomplish this task. Thanks in advance.

How can I detect marker within marker.

January 28, 2013 - 4:27am #6

Hi, to show/hide an object (in general in Unity) you can:

  • retreieve the object by searching by name, for instance:
GameObject myTrackable = GameObject.Find( "My_Trackable_Name" );


  • Get the renderer components of that object and then enable or disable them, like in this code:
Renderer[] renderers = myTrackable.GetComponentsInChildren<Renderer>();
foreach (Renderer renderer in renderers) renderer.enabled = false;//or true


Note: you can find a code example also in DefaultTrackableEventHandler script in ImageTargets sample.


How can I detect marker within marker.

January 28, 2013 - 4:21am #5

Thanks Alessandro

I also think that I should use Virtual button, Just one question how can I show and hide second Image target in Unity3d, I know this will be handle in Virtualbuttoneventhandler class and in function "OnButtonPressed" but don't know how to hide and show virtual object of second marker. Is there any property of ImageTarget?

How can I detect marker within marker.

January 28, 2013 - 3:24am #4

Hi, for the occulsion part, what I meant was just the fact that if you have two image targets, you can track both and you can partially occlude one target with the other (e.g. dragging one printed target in front of the other printed target) without loosing tracking (i.e. Vuforia will still be able to tarck both targets to a certain extent; if the occlusion becomes too large, then at some point it will loose the occluded target).

However, for occlusion mechanisms similar to the Virtual Buttons one (i.e. something different from what i was mentioning), you should use Virtual Buttons, because there are currently no other features in Vuforia that handle that case.



How can I detect marker within marker.

January 28, 2013 - 3:16am #3

Thanks Alessandro,

I am following Image Targer sample, and I increase Maximum Simultaneously Image Target to 3 from AR Camera now its successfully detecting 3 marker at same time. But my first question remain unsolved and looks difficult is that how can I detect 2nd marker when it'll within range of first marker, I think it is same like as virtual button when finger comes in specific region then it detect touch and change color of teapot so I am revolving in logic. Kindly guide me what should I do and what about occlusion which you mentioned at here? Please help me on that.

How can I detect marker within marker.

January 24, 2013 - 6:44am #2

Hi, the Bert and Ernie sample was an experimental demo, built with some ad-hoc additioal techniques; the standard SDK does not provide the full feature set used in that demo;

however, you coudl try combining multiple Image Targets or Frame markers to create your virtual environment

(for instance, if you check the FrameMarkers sample, you will see that we use 4 different markers and create an augmentation of those);

you can also use multiple Image Targets (for that you will need to increase the Max Simultaneous Image Targets field in the QCARBehaviour in the ARCamera inspector);

for the occlusion issue, to some extent Vuforia is able to compensate for mutual occlusion of targets, but you will need to test to see if this effectively meets your requirements.



Log in or register to post comments