Hello!!
Context: I'm using the Qualcomm example @ImageTargets, the example by it`s own can change the datasets with a method called in cpp that changes the value of a flag that is being constantly checked by QCAR_onUpdateCallback (Or something alike, it`s the first class in the ImageTargets.cpp)
What did i do? i commented the "if" that verifies the flag value, letting just the "if" that checks the currently active dataset and they change between them on a loop
The issue: It stopped reading the images, i have checked with log and it is changing the datasets and it`s calling the renderframe, but doesnt read the trackable images. What could be happend?
The Code:
class ImageTargets_UpdateCallback : public QCAR::UpdateCallback { virtual void QCAR_onUpdate(QCAR::State& /*state*/) { //if (switchDataSetAsap) //{ //switchDataSetAsap = false; // Get the image tracker: QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance(); QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>( trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER)); if (imageTracker == 0 || dataSetStonesAndChips == 0 || dataSetTarmac == 0 || imageTracker->getActiveDataSet() == 0) { LOG("Failed to switch data set."); return; } if (imageTracker->getActiveDataSet() == dataSetStonesAndChips) { imageTracker->deactivateDataSet(dataSetStonesAndChips); imageTracker->activateDataSet(dataSetTarmac); LOG("Dataset change from stones->tarmac"); } else { imageTracker->deactivateDataSet(dataSetTarmac); imageTracker->activateDataSet(dataSetStonesAndChips); LOG("Dataset change from tarmac->stones"); } //} } };
No compile errors, no runtime errors. I just know the datasets are being successfully changed, renderFrame its being executed, but it won`t recognize the trackables on them
Help please
Correct. I tought the same and i'm trying to formulate that reading time based on the number of... oh well, now i realize i was a little.. out of the road, but my idea is: if the dataset has... 200 trackables, multiply that value for a constant that gives it enought time to read 1 trackable, so it would be able to read all the trackables in a dataset, based in the quantity of the trackables in the dataset. But i would have a solution for a device :/ maybe