Log in or register to post comments

Multiple Frame Markers interaction

January 27, 2014 - 5:01pm #1


I've a problem with a frame markers sample. I'm replacing the models for a new one when two markers are close together. I've managed to make it work with one pair of markers, however I need to do the same for multiple pairs of markers and change a different models accordingly only when two corresponding markers are together, otherwise don't show anything (or show another model).

The functionality, so far, works only when two markers are being tracked but when I have more pairs in the rendering scene the models are not showing accordingly. I guess its a matter of logic but I have run out of options. Do you have any ideas on how to face this problem?

I'm doing everyhting linearly in the renderFrame function on FrameMarkers.cpp. I'm wondering if is there any other way to implement a functionality of this kind and if its possible to work directly in Java rather than C++.

Thanks in advance for your help,



Multiple Frame Markers interaction

January 30, 2014 - 1:09am #7

No, that does not work because in the getTrackableResult() you need to pass an index between 0 and state.getNumTrackaleResults()-1.

Such index represents the position of the TrackableResult in the array of trackable results reported by the state, for the current frame (which may change from frame to frame, depending on which trackables are currently tracked in the camera field of view)

Multiple Frame Markers interaction

January 29, 2014 - 10:27am #6


Actually the thing I need is to know when a marker is tracked or not, I was trying something like:

const QCAR::TrackableResult* trackableResult = state.getTrackableResult(THE_ID_IM_LOOKING);

even if I get an exception but doesn't work, I'm wondering if is there an easiest solution besides the global list of trackables.

Multiple Frame Markers interaction

January 29, 2014 - 10:06am #5

You need to run state.getNumTrackableResults() because the list of active trackables might change at every frame;

of course, nothing prevents you from building some higher level software layer, for example using a glbal list of trackable, and implement some mechanism to query the status of a specific marker by ID for instance;  however, this is not explicitly supported by the SDK API, so it's something you would need to implement by your own, as an additional software layer on top.


Multiple Frame Markers interaction

January 29, 2014 - 9:20am #4


Probably its a silly question but for the function I want to implement I'm wondering if it's possible to look for an specific marker id in the tracakle objects. I want to know if lets say the marker ID 4 is being tracked without use the "for" loop of state.getNumTrackableResults(). Just a search in the state object.

Multiple Frame Markers interaction

January 28, 2014 - 3:31pm #3

Great!, thanks, I'll move to Java later. I'm trying to solve this problem in c++ in the meantime.

Multiple Frame Markers interaction

January 28, 2014 - 12:51am #2

Hi, as you recognize, this is really a matter of programming and application logic.

Concerning your question about Java vs C++; yes, it is possible to code everything in Java, if you use the latest version of the SDK (2.8.7).

This version has a complete Java API, so you don't need to write a single line of code in C++ (although, you still can, if you want to).

Check the sample called "VuforiaSamples-2-8-x", which also includes a Frame marker "sub-sample"



Log in or register to post comments