Log in or register to post comments

Successfully changing datasets but...

May 30, 2012 - 7:42am #1

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

Successfully changing datasets but...

June 22, 2012 - 12:02am #3

i am also facing the same issue "Successfully changing the dataset but not recognizing  after changing dataset".

Help Please.

Re: Successfully changing datasets but...

May 30, 2012 - 8:52pm #2

Let's consolidate these so that we can keep track of them, and check your PMs.

http://ar.qualcomm.at/node/2002275

Log in or register to post comments