Log in or register to post comments

Understanding how recos in target manager are calculated

November 7, 2013 - 2:12am #1

Hello

I'm just trying to understand exactly how the number of recos is calculated as displayed in the target manager.

I have a callback set up for when I get an update from the cloud recognition service:

    class VisualSearch_UpdateCallback : public QCAR::UpdateCallback
    {
        virtual void QCAR_onUpdate(QCAR::State& state);
    } qcarUpdate;
 
In the callback I am logging to Flurry when I get new cloud recognition results:
 
void VisualSearch_UpdateCallback::QCAR_onUpdate(QCAR::State & state)
{
    // Get the tracker manager:
    QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();

    // Get the image tracker:
    QCAR::ImageTracker *imageTracker = static_cast<QCAR::ImageTracker *>(trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));

    // Get the target finder:
    QCAR::TargetFinder *finder = imageTracker->getTargetFinder();

    // Check if there are new results available:
    const int statusCode = finder->updateSearchResults();
    if (statusCode < 0)
    {
        // Show a message if we encountered an error:
        [[CRQCARutils getInstance] showUIAlertFromErrorCode:statusCode];
    }
    else if (statusCode == QCAR::TargetFinder::UPDATE_RESULTS_AVAILABLE)
    {

        // Iterate through the new results:
        for (int i = 0 ; i < finder->getResultCount() ; ++i)
        {
            [Flurry logEvent:@"Cloud_Recognition_Result"];

            const QCAR::TargetSearchResult *result = finder->getResult(i);

            // Check if this target is suitable for tracking:
            if (result->getTrackingRating() > 0)
            {
                // Create a new Trackable from the result:
                finder->enableTracking(*result);
            }
        }
    }
}

 

 

My question is whether I should expect the number of recos in the target manager to match the number of Flurry events. I'm finding more recos recorded in the target manager than being logged in Flurry (2 or 3 times more). Why is there a difference?

Thanks!

Matthew

Understanding how recos in target manager are calculated

November 7, 2013 - 4:55am #2

Not sure exactly from looking at your code.

Just checking your code against the sample and there it checks against Bad Targets, and also checks the result of 

finder->enableTracking(*result);

...to ensure it is not zero.  Not sure whether these might be making a difference.

 

The only way to be sure is to put some counters in (rather than flurry) in the first instance and just do a few test runs to get to the bottom of it.

 

N

Log in or register to post comments