Log in or register to post comments

Limiting the number of recognised frame markers to one

July 24, 2012 - 8:00am #16

I'm working alongside an iOS developer who's using Unity and Vuforia, only he's off sick today.

Our project uses three markers - each one triggering a different 3D model. However, we only want one model to appear at a time, even if there are multiple markers visible within the camera view.

We've managed to do this with image markers (as it seems that only one of those can be tracked at once). It might be simpler for the graphic design team if we used frame markers, but I've been led to believe that those will all be recognised and tracked simultaneously.

Is there a way to use frame markers, but still limit the number of simultaneously tracked markers to 1, so that we don't get multiple models shown?

I'm going to have another dig through the documentation but I wanted to know whether anyone on here could help me with this.

Many thanks in advance.

Limiting the number of recognised frame markers to one

July 24, 2012 - 8:24am #15

hi amv

In the Unity project click on the ARCamera and go to the inspector.

Look for Max Simultaneous Image Targets and you can set this number accordingly if required, so more than one image can be tracked.

The same applies to frame markers.

 

HTH

N

Limiting the number of recognised frame markers to one

July 24, 2012 - 8:47am #14

Thanks so much for your prompt and helpful reply. I'll go check out that setting.

Much appreciated!

Limiting the number of recognised frame markers to one

July 26, 2012 - 3:00am #13

Hi Nalin,

My colleague is now back and we've had a go changing the setting you mentioned but it still seems to recognise several frame markers at once, projecting the models for each of them all at the same time (if they're all in view).

We've even looked into the script behind the settings and confirmed that MaxSimulatneousImageTargets = 0 and MultiFrameEnabled = false (see attached screenshots).

We know it's possible for image targets. Please can you confirm that it's also possible for frame markers, and if so, where are we going wrong?

Thanks,

Andy

 

Limiting the number of recognised frame markers to one

July 26, 2012 - 3:09am #12

Here's the relevant part of the script:

[SerializeField]

    private int MaxSimultaneousImageTargets = 0;

 

    // split detection of multiple targets over multiple frames

    [SerializeField]

    private bool MultiFrameEnabled = false;

 

and here's the screenshot:

Screenshot of QCARBehaviour (Script) section

Thanks.

Limiting the number of recognised frame markers to one

July 26, 2012 - 4:15am #11

Hi amv

Sorry it does apear that this setting has no bearing on Framemarkers.

It's up to the application to decide out of the Framemarkers recognised, which one(s) to do something with e.g. the application may decide to use the Pose/Matrix to decide which one(s) to show etc. and this should all be possible within the Unity scripting environment

HTH

N

Limiting the number of recognised frame markers to one

July 26, 2012 - 8:59am #10

Hi,

Is it possible to create a multi-target from 6 frame markers, or is that only possible with image markers?

We're trying to work with a physical cube which will have markers on 3 faces. If it was just two then we could have them on the top and bottom of the cube so that only one would be visible at once. However, because we need 3, there's a chance that two markers may be visible at once. We only want the one on the top to be taken into account.

I'm wondering if having a multi-target would at least let us know which of the markers is "uppermost" and only trigger the model associated with that one?

Thanks.

Limiting the number of recognised frame markers to one

July 27, 2012 - 4:27am #9

No, multitargets is only posible with Image Markers,

...and the pose/matrix only returns the center of the multitarget not the image target of each side.

However, the matrix does contain the orientation (hence the normals of these faces), and therefore it ought to be possible to determine which faces are visible by calculating the angle between each one and the line to the camera which sits at (0,0,0) using the dot product of these two vectors.

Sorry I do not have any sample code, but I think the above approach might be worth trying, though it will involve a little maths.

HTH

N

 

 

Limiting the number of recognised frame markers to one

July 27, 2012 - 5:02pm #8

Any update on this?  If it is tracking one frame marker, I want it to stop looking for other frame markers.  When there's more than one frame marker in view, it throws off the orientation of the objects and the direction of gravity is messed up.  

Limiting the number of recognised frame markers to one

July 27, 2012 - 6:36pm #7

Multitargets don't provide an API for determining the facing child targets. As Nalin stated, you'd have to determine this by analyzing their orientation.

If you'd like to limit tracking on a set of framemarkers, set your Max Simultaneous target value to 1. This will restrict tracking to a single target instance. But it won't guarantee that the tracked target is on top of others, or in any specific orientation relative to the others.

Also you can compose a MultiTarget using FrameMarkers, but these FM's will be treated like ImageTargets. To experiment with this, set your Max Simultaneous value to 1 + the number of sides that the MT has (e.g. 6 ). This should enable you to detect the MT and an FM simultaneousy. You can experiment with the MSIT value, as you don't typically need to count all of the MT faces.

Limiting the number of recognised frame markers to one

July 29, 2012 - 12:32pm #6

DavidBeard wrote:

If you'd like to limit tracking on a set of framemarkers, set your Max Simultaneous target value to 1. This will restrict tracking to a single target instance. 

I see MaxSimultaneousImageTargets, but I have that set to 1 and it still tracks multiple frame markers.  I don't see a frame-marker-specific setting

edit: Think I have a workaround -- I can set MarkerBehavior.enabled = false for the other markers when I have one active.  

Limiting the number of recognised frame markers to one

July 30, 2012 - 7:17am #5

JTown wrote:

DavidBeard wrote:

If you'd like to limit tracking on a set of framemarkers, set your Max Simultaneous target value to 1. This will restrict tracking to a single target instance. 

I see MaxSimultaneousImageTargets, but I have that set to 1 and it still tracks multiple frame markers.  I don't see a frame-marker-specific setting

edit: Think I have a workaround -- I can set MarkerBehavior.enabled = false for the other markers when I have one active.  

 

Yup, MaxSimTargets wont make a difference to frame markers. I changed the script in defaultTrackableEventHandler to this:

//somewhere

static bool trackedSingleFrameMarker = false;

 

//then

       public void OnTrackableStateChanged(
                                    TrackableBehaviour.Status previousStatus,
                                    TrackableBehaviour.Status newStatus)
    {
       
       
        if (newStatus == TrackableBehaviour.Status.DETECTED ||
            newStatus == TrackableBehaviour.Status.TRACKED )
           
        {
            if (!trackedSingleFrameMarker )
            {
               
            OnTrackingFound();
            trackedSingleFrameMarker = true;
        }
        }
        else
        {
            trackedSingleFrameMarker = false;
            OnTrackingLost();
        }
    }

 

Typically the first marker it picks up is the one it sticks to. If it loses sight of the marker it'll then pop the the next 'first one' it see's. Works 99% of the time and if it does, for whatever reason not display the image/video/3dmodel/whatever then either moving the camera away from all the markers for a second, or running your hand over the markers "refreshes" it.

 

 

Limiting the number of recognised frame markers to one

July 30, 2012 - 9:28am #4

Oops, Double-Posted.

 

See next post :- )

 

Schwaaa

Limiting the number of recognised frame markers to one

August 5, 2012 - 9:02pm #3

Yes this is correct as I said earlier in the thread.

Max sim targets has no bearing on frame markers.

N

Limiting the number of recognised frame markers to one

October 10, 2012 - 8:22am #2

Another quick fix is getting the number of active trackables and then limiting your for loop to the target number like this:

 

int numActiveTrackables = state.getNumActiveTrackables();

int limit = 2;

if(numActiveTrackables > limit){

        numActiveTrackables = limit;

}

for (int i = 0; i < numActiveTrackables; ++i) {

        // Qualcomm magic stuff

}

Limiting the number of recognised frame markers to one

October 11, 2012 - 6:40pm #1

Yes you'll need to accommodate this sort of constraint in the event handler. I was mistaken regarding the affect of MSIT on FrameMarkers :P

Log in or register to post comments