Just did an exp: display the same image but with two time varying framemarkers, like marker 0 and maker 1. The period of each marker is 1s. Codes from framemarkder can do the tracking in realtime, but not for detection. Once the 1st detected marker is marker 0, then the rest will be recoganized as 0, though marker 1 is being displayed.
Check the codes. The tracking & detection happens in JNI "Java_com_qualcomm_QCARSamples_FrameMarkers_FrameMarkersRenderer_renderFrame", when the onDrawFrame() function is called in the class FrameMarkersRenderer. Since by default in my settings, only one framemarker is displayed, I adapted the codes as follows:
if(state.getNumTrackableResults() == 1) { const QCAR::TrackableResult* trackableResult = state.getTrackableResult(0); // Check the type of the trackable: assert(trackableResult->getType() == QCAR::TrackableResult::MARKER_RESULT); const QCAR::MarkerResult* markerResult = static_cast<const QCAR::MarkerResult*>(trackableResult); const QCAR::Marker& marker = markerResult->getTrackable(); int textureIndex = marker.getMarkerId(); LOG("Frame %d is detected.", textureIndex); }
What's wrong with realtime detection? Any suggestions on correction? thx.
OK, thanks for the clarification;
the thing is that detection runs as a background process and can take a little bit of time (compared to tracking); so in that sense, it's not strictly "realtime" (just to use your definition);
once a marker is detected, then the tracking process starts; so, it could be that when you suddenly switch the marker in you sequence, the tracker keeps tracking the marker as if it was the old one (while the detector might realize the change only after some time).