Ejemplo n.º 1
0
	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);
			} else {
				imageTracker->deactivateDataSet(dataSetTarmac);
				imageTracker->activateDataSet(dataSetStonesAndChips);
			}
		}
	}
Ejemplo n.º 2
0
	    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::ImageTracker::getClassType()));
	            if (imageTracker == 0 || dataSetStonesAndChips == 0 || dataSetTarmac == 0 || dataSetvmio_vuforial_dev == 0 ||
	                imageTracker->getActiveDataSet() == 0)
	            {
	                LOG("Failed to switch data set.");
	                return;
	            }

				switch( selectedDataset )
				{
					case STONES_AND_CHIPS_DATASET_ID:
						if (imageTracker->getActiveDataSet() != dataSetStonesAndChips)
						{
							imageTracker->deactivateDataSet(dataSetvmio_vuforial_dev);
							imageTracker->deactivateDataSet(dataSetTarmac);
							imageTracker->activateDataSet(dataSetStonesAndChips);
						}
						break;

					case TARMAC_DATASET_ID:
						if (imageTracker->getActiveDataSet() != dataSetTarmac)
						{
							imageTracker->deactivateDataSet(dataSetvmio_vuforial_dev);
							imageTracker->deactivateDataSet(dataSetStonesAndChips);
							imageTracker->activateDataSet(dataSetTarmac);
						}
						break;

					case vmio_vuforial_dev_ID:
						if (imageTracker->getActiveDataSet() != dataSetvmio_vuforial_dev)
						{
							imageTracker->deactivateDataSet(dataSetStonesAndChips);
							imageTracker->activateDataSet(dataSetTarmac);
							imageTracker->deactivateDataSet(dataSetvmio_vuforial_dev);
						}
						break;
				}

				if(isExtendedTrackingActivated)
				{
					QCAR::DataSet* currentDataSet = imageTracker->getActiveDataSet();
					for (int tIdx = 0; tIdx < currentDataSet->getNumTrackables(); tIdx++)
					{
						QCAR::Trackable* trackable = currentDataSet->getTrackable(tIdx);
						trackable->startExtendedTracking();
					}
				}

	        }
	    }
void
MSTracker::addTrackableSource(QCAR::TrackableSource *t) {
    QCAR::TrackerManager& trackerManager =
        QCAR::TrackerManager::getInstance();
    QCAR::ImageTracker* imageTracker =
        static_cast<QCAR::ImageTracker*> (trackerManager.getTracker(
                QCAR::Tracker::IMAGE_TRACKER));
    // Deactivate current dataset
    imageTracker->deactivateDataSet(imageTracker->getActiveDataSet());

    // Replace the previously tracked target (if any) by the new one.
    if ( this->dataset->hasReachedTrackableLimit() ||
            this->dataset->getNumTrackables()) {
        delete static_cast<MSTargetInfo *>(this->dataset->getTrackable(0)->getUserData());
        this->dataset->destroy(this->dataset->getTrackable(0));
    }

    // Add new trackable source
    QCAR::Trackable *trackable = this->dataset->createTrackable(t);

    // Get its additionnal info from controller, and store it as userdata.
    MSTargetInfo *info = MSController::getNewTargetInfo();
    if (info) {
        trackable->setUserData(info);
    }

    // Reactivate current dataset
    imageTracker->activateDataSet(this->dataset);
}
MSTracker::MSTracker() {
    QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
    QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(trackerManager.initTracker(QCAR::Tracker::IMAGE_TRACKER));

    // Create and activate the data set:
    this->dataset = imageTracker->createDataSet();
    imageTracker->activateDataSet(this->dataset);
}
Ejemplo n.º 5
0
JNIEXPORT int JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData(JNIEnv *, jobject)
{
    LOG("Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData");
    
    // 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 == NULL)
    {
        LOG("Failed to load tracking data set because the ImageTracker has not"
            " been initialized.");
        return 0;
    }

    // Create the data sets:
    dataSetStonesAndChips = imageTracker->createDataSet();
    if (dataSetStonesAndChips == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    //dataSetTarmac = imageTracker->createDataSet();
    //if (dataSetTarmac == 0)
    //{
    //    LOG("Failed to create a new tracking data.");
    //    return 0;
    //}

    // Load the data sets:
    if (!dataSetStonesAndChips->load("/mnt/sdcard/Menu.xml", QCAR::DataSet::STORAGE_ABSOLUTE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    //if (!dataSetTarmac->load("Tarmac.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
    //{
    //    LOG("Failed to load data set.");
    //    return 0;
    //}

    // Activate the data set:
    if (!imageTracker->activateDataSet(dataSetStonesAndChips))
    {
        LOG("Failed to activate data set.");
        return 0;
    }


    LOG("Successfully loaded and activated data set.");
    return 1;
}
Ejemplo n.º 6
0
JNIEXPORT int JNICALL
Java_edu_pugetsound_vichar_ar_ARGameActivity_loadTrackerData(JNIEnv *, jobject)
{
    LOG("Java_edu_pugetsound_vichar_ar_ARGameActivity_loadTrackerData");

    // 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 == NULL)
    {
        LOG("Failed to load tracking data set because the ImageTracker has not"
            " been initialized.");
        return 0;
    }

    // Create the data sets:
    dataSetVichar = imageTracker->createDataSet();
    if (dataSetVichar == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    dataSetFlakesBox = imageTracker->createDataSet();
    if (dataSetFlakesBox == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    // Load the data sets:
    if (!dataSetVichar->load("vichar.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    if (!dataSetFlakesBox->load("FlakesBox.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    // Activate the data set:
    if (!imageTracker->activateDataSet(dataSetVichar))
    {
        LOG("Failed to activate data set.");
        return 0;
    }

    LOG("Successfully loaded and activated data set.");
    return 1;
}
JNIEXPORT int JNICALL
Java_name_nailgun_irrlichtvuforia_MainActivity_loadTrackerData(JNIEnv *, jobject)
{
    LOG("Java_name_nailgun_irrlichtvuforia_MainActivity_loadTrackerData");
    
    // 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 == NULL)
    {
        LOG("Failed to load tracking data set because the ImageTracker has not"
            " been initialized.");
        return 0;
    }

    // Create the data sets:
    dataSetStonesAndChips = imageTracker->createDataSet();
    if (dataSetStonesAndChips == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    dataSetTarmac = imageTracker->createDataSet();
    if (dataSetTarmac == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    // Load the data sets:
    if (!dataSetStonesAndChips->load("StonesAndChips.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    if (!dataSetTarmac->load("Tarmac.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    // Activate the data set:
    if (!imageTracker->activateDataSet(dataSetStonesAndChips))
    {
        LOG("Failed to activate data set.");
        return 0;
    }

    LOG("Successfully loaded and activated data set.");
    return 1;
}
Ejemplo n.º 8
0
JNIEXPORT int JNICALL
Java_com_robopeak_EasyQCAR_EasyQCAR_create(JNIEnv* env, jobject, jstring trackerXml)
{
    LOGI("EasyQCAR_create");

    // 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 == NULL)
    {
        imageTracker = static_cast<QCAR::ImageTracker*>(trackerManager.initTracker(QCAR::Tracker::IMAGE_TRACKER));
        if (imageTracker == NULL)
        {
            LOGE("Failed to initialize ImageTracker.");
            return 0;
        }

        LOGI("Successfully initialized ImageTracker.");
    }

    // Create the data sets:
    g_dataSet = imageTracker->createDataSet();
    if (g_dataSet == 0)
    {
        LOGE("Failed to create a new tracking data.");
        return 0;
    }
    // Load the data sets:
    const char* c_xml = env->GetStringUTFChars(trackerXml, 0);
    if (!g_dataSet->load(c_xml, QCAR::DataSet::STORAGE_APPRESOURCE))
    {
        LOGE("Failed to load data set %s.", c_xml);
        return 0;
    }
    env->ReleaseStringUTFChars(trackerXml, c_xml);

    // Activate the data set:
    if (!imageTracker->activateDataSet(g_dataSet))
    {
        LOGE("Failed to activate data set %s.", c_xml);
        return 0;
    }

    LOGI("Successfully loaded and activated data set %s.", c_xml);
    return 1;
}
Ejemplo n.º 9
0
JNIEXPORT int JNICALL
Java_com_snda_sdar_ImageTargets_loadTrackerData(JNIEnv *, jobject)
{
	LOG("Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData");

	// 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 == NULL)
	{
		LOG("Failed to load tracking data set because the ImageTracker has not"
				" been initialized.");
		return 0;
	}

	// Create the data sets:
	dataSetDefault = imageTracker->createDataSet();
	if (dataSetDefault == 0)
	{
		LOG("Failed to create a new tracking data.");
		return 0;
	}

	// Load the data sets:
	if (!dataSetDefault->load("default.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
	{
		LOG("Failed to load data set.");
		return 0;
	}

	// Activate the data set:
	if (!imageTracker->activateDataSet(dataSetDefault))
	{
		LOG("Failed to activate data set.");
		return 0;
	}

	LOG("Successfully loaded and activated data set.");
	return 1;
}
Ejemplo n.º 10
0
JNIEXPORT int JNICALL
Java_com_mx_ipn_escom_ars_recorrido_ReconocerActivity_loadTrackerData(JNIEnv *env, jobject,jstring fileName)
{
    LOG("Java_com_mx_ipn_escom_ars_recorrido_ReconocerActivity_loadTrackerData");

    // 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 == NULL)
    {
        LOG("Failed to load tracking data set because the ImageTracker has not"
            " been initialized.");
        return 0;
    }

    dataSetStonesAndChips2 = imageTracker->createDataSet();
    if (dataSetStonesAndChips2 == 0)
    {
        LOG("Failed to create a new tracking data.");
        return 0;
    }

    const char *nativeString = env->GetStringUTFChars(fileName, 0);
    if (!dataSetStonesAndChips2->load(nativeString, QCAR::DataSet::STORAGE_ABSOLUTE))
    {
        LOG("Failed to load data set.");
        return 0;
    }

    env->ReleaseStringUTFChars(fileName, nativeString);

    if (!imageTracker->activateDataSet(dataSetStonesAndChips2))
    {
        LOG("Failed to activate data set.");
        return 0;
    }

    LOG("Successfully loaded and activated data set.");
    return 1;
}
Ejemplo n.º 11
0
JNIEXPORT int JNICALL
Java_rajawali_vuforia_RajawaliVuforiaActivity_createImageMarker(JNIEnv* env,
		jobject object, jstring dataSetFile) {
	QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
	QCAR::ImageTracker* imageTracker =
			static_cast<QCAR::ImageTracker*>(trackerManager.getTracker(
					QCAR::ImageTracker::getClassType()));

	if (imageTracker == NULL) {
		LOG("Failed to load tracking data set because the ImageTracker has not"
		" been initialized.");
		return 0;
	}

	QCAR::DataSet* dataSet = imageTracker->createDataSet();
	if (dataSet == 0) {
		LOG("Failed to create a new tracking data.");
		return 0;
	}

	// Load the data sets:
	const char *nativeString = env->GetStringUTFChars(dataSetFile, NULL);
	if (!dataSet->load(nativeString, QCAR::DataSet::STORAGE_APPRESOURCE)) {
		LOG("Failed to load data set.");
		env->ReleaseStringUTFChars(dataSetFile, nativeString);
		return 0;
	}
	env->ReleaseStringUTFChars(dataSetFile, nativeString);

	// Activate the data set:
	if (!imageTracker->activateDataSet(dataSet)) {
		LOG("Failed to activate data set.");
		return 0;
	}

	LOG("Successfully loaded and activated data set.");

	return 1;
}
Ejemplo n.º 12
0
JNIEXPORT jint JNICALL Java_com_tvc_supastriker_SupaStriker_loadTrackerData
  (JNIEnv *, jobject){
	LOG("Java_com_tvc_supastriker_SupaStriker_loadTrackerData");

	//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 == NULL){
		LOG("Failed to load tracking data set because ImageTracker has not "
				"been initialized");
		return 0;
	}

	//create the data sets:
	dataSetSupaStrika = imageTracker->createDataSet();
	if(dataSetSupaStrika == 0){
		LOG("Failed to create new tracking data..");
		return 0;
	}

	//Load datasets..
	if(!dataSetSupaStrika->load("SupaStrikas_db.xml", QCAR::DataSet::STORAGE_APPRESOURCE)){
		LOG("Failed to load data set..");
		return 0;
	}

	//Activate the dataset
	if(!imageTracker->activateDataSet(dataSetSupaStrika)){
		LOG("Failed to activate data set");
	}

	LOG("Successfully loaded and activated the data set");
	return 1;
}
Ejemplo n.º 13
0
    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 ||
                imageTracker->getActiveDataSet() == 0)
            {
                LOG("Failed to switch data set.1 = %d, 2 = %d, 3 = %d", imageTracker, dataSetStonesAndChips, imageTracker->getActiveDataSet());
                return;
            }
            
            if (imageTracker->getActiveDataSet() == dataSetStonesAndChips)
            {
                imageTracker->deactivateDataSet(dataSetStonesAndChips);
                imageTracker->destroyDataSet(dataSetStonesAndChips);

                LOG("Load dynamically new data set Start");
                LOG("DataSetName %s", dataSetName);

                // 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 == NULL)
                {
                	LOG("Failed to load tracking data set because the ImageTracker has not"
                    " been initialized.");
                    return;
                }

                // Create the data sets:
                dataSetStonesAndChips = imageTracker->createDataSet();
                if (dataSetStonesAndChips == 0)
                {
                	LOG("Failed to create a new tracking data.");
                    return;
                }
                LOG("Load data set from device");
                char path[strlen("/mnt/sdcard/") + strlen(dataSetName) + strlen(".xml")];
                strcpy(path, "/mnt/sdcard/");
                strcat(path, dataSetName);
                strcat(path, ".xml");

                LOG("Path %s", path);
                // Load the data sets:
                if (!dataSetStonesAndChips->load(path, QCAR::DataSet::STORAGE_ABSOLUTE))
                {
                	LOG("Failed to load data set.");
                    return;
                }

                // Activate the data set:
                if (!imageTracker->activateDataSet(dataSetStonesAndChips))
                {
                	LOG("Failed to activate data set.");
                    return;
                }

                LOG("Load dynamically new data set End");


                //imageTracker->activateDataSet(dataSetTarmac);
            }
            else
            {
                //imageTracker->deactivateDataSet(dataSetTarmac);
                imageTracker->activateDataSet(dataSetStonesAndChips);
            }
        }
    }
Ejemplo n.º 14
0
	virtual void QCAR_onUpdate(QCAR::State&) {

		if (dataSetToActivate != NULL) {
			QCAR::TrackerManager& trackerManager =
					QCAR::TrackerManager::getInstance();
			QCAR::ImageTracker* imageTracker =
					static_cast<QCAR::ImageTracker*>(trackerManager.getTracker(
							QCAR::ImageTracker::getClassType()));
			if (imageTracker == 0) {
				LOG("Failed to activate data set.");
				return;
			}
			imageTracker->activateDataSet(dataSetToActivate);

			if(isExtendedTrackingActivated)
			{
				for (int tIdx = 0; tIdx < dataSetToActivate->getNumTrackables(); tIdx++)
				{
					QCAR::Trackable* trackable = dataSetToActivate->getTrackable(tIdx);
					trackable->startExtendedTracking();
				}
			}

			dataSetToActivate = NULL;
		}

		if (scanningMode) {
			QCAR::TrackerManager& trackerManager =
					QCAR::TrackerManager::getInstance();
			QCAR::ImageTracker* imageTracker =
					static_cast<QCAR::ImageTracker*>(trackerManager.getTracker(
							QCAR::ImageTracker::getClassType()));

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

			// Check if there are new results available:
			const int statusCode = targetFinder->updateSearchResults();

			if (statusCode < 0) {
				char errorMessage[80];
				LOG(errorMessage, "Error with status code %d", statusCode);
			} else if (statusCode
					== QCAR::TargetFinder::UPDATE_RESULTS_AVAILABLE) {
				// Process new search results
				if (targetFinder->getResultCount() > 0) {
					const QCAR::TargetSearchResult* result =
							targetFinder->getResult(0);

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

						if (newTrackable != 0) {
							LOG(
									"Successfully created new trackable '%s' with rating '%d'.",

									newTrackable->getName(), result->getTrackingRating());

							if (strcmp(result->getUniqueTargetId(),
									lastTargetId) != 0) {
								// Copies the new target Metadata
								snprintf(targetMetadata, CONTENT_MAX, "%s",
										result->getMetaData());
								//LOG(targetMetadata);

							}

							strcpy(lastTargetId, result->getUniqueTargetId());

							// Stop Cloud Reco scanning
							targetFinder->stop();

							scanningMode = false;
						}
					}
				}
			}
		}
	}
Ejemplo n.º 15
0
	JNIEXPORT int JNICALL
	Java_com_miosys_finder_ui_PfinderTargets_loadTrackerData(JNIEnv *, jobject)
	{
	    LOG("Java_com_miosys_finder_ui_PfinderTargets_loadTrackerData");

	    // Get the image tracker:
	    QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
	    QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
	                    trackerManager.getTracker(QCAR::ImageTracker::getClassType()));
	    if (imageTracker == NULL)
	    {
	        LOG("Failed to load tracking data set because the ImageTracker has not"
	            " been initialized.");
	        return 0;
	    }

	    // Create the data sets:
	    dataSetStonesAndChips = imageTracker->createDataSet();
	    if (dataSetStonesAndChips == 0)
	    {
	        LOG("Failed to create a new tracking data.");
	        return 0;
	    }

	    dataSetTarmac = imageTracker->createDataSet();
	    if (dataSetTarmac == 0)
	    {
	        LOG("Failed to create a new tracking data.");
	        return 0;
	    }

	    dataSetvmio_vuforial_dev = imageTracker->createDataSet();
	    if(dataSetvmio_vuforial_dev == 0){
	    	LOG("Failed to create a new Tracking data.");
	    	return 0;
	    }


	    // Load the data sets:
	    if (!dataSetStonesAndChips->load("StonesAndChips.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
	    {
	        LOG("Failed to load data set.");
	        return 0;
	    }

	    if (!dataSetTarmac->load("Tarmac.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
	    {
	        LOG("Failed to load data set.");
	        return 0;
	    }

	    if(!dataSetvmio_vuforial_dev->load("vmio_vuforia_dev.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
	    {
	    	LOG("Failed to load data set vmio.");
	    	return 0;
	    }
	    // Activate the data set:
	//    if (!imageTracker->activateDataSet(dataSetStonesAndChips))
	//    {
	//        LOG("Failed to activate data set.");
	//        return 0;
	//    }

	    if (!imageTracker->activateDataSet(dataSetvmio_vuforial_dev))
	    {
	          LOG("Failed to activate data set.");
	          return 0;
	    }
	    LOG("Successfully loaded and activated data set.");
	    return 1;
	}
    JNIEXPORT int JNICALL
    Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData(JNIEnv *, jobject)
    {
        LOG("Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData");

        // 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 == NULL)
        {
            LOG("Failed to load tracking data set because the ImageTracker has not"
                " been initialized.");
            return 0;
        }

        // Create the data sets:
        dataSetStonesAndChips = imageTracker->createDataSet();
        if (dataSetStonesAndChips == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        dataSetTarmac = imageTracker->createDataSet();
        if (dataSetTarmac == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        dataSethuitailang = imageTracker->createDataSet();
        if (dataSethuitailang == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        dataSetheroin = imageTracker->createDataSet();
        if (dataSetheroin == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        dataSethh = imageTracker->createDataSet();
        if (dataSethh == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        dataSetchhhh = imageTracker->createDataSet();
        if (dataSetchhhh == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }
        dataSetcoo = imageTracker->createDataSet();
        if (dataSetcoo == 0)
        {
            LOG("Failed to create a new tracking data.");
            return 0;
        }

        // Load the data sets:
        if (!dataSetStonesAndChips->load("StonesAndChips.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set1.");
            return 0;
        }

        if (!dataSetTarmac->load("Tarmac.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set2.");
            return 0;
        }

        if (!dataSethuitailang->load("huitailang.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set3.");
            return 0;
        }

        if (!dataSetheroin->load("heroin.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set4.");
            return 0;
        }

        if (!dataSetchhhh->load("chhhh.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set5.");
            return 0;
        }
        if (!dataSetcoo->load("coo.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set6.");
            return 0;
        }
        if (!dataSethh->load("hh.xml", QCAR::DataSet::STORAGE_APPRESOURCE))
        {
            LOG("Failed to load data set7.");
            return 0;
        }

        // Activate the data set:
        if (!imageTracker->activateDataSet(dataSetStonesAndChips))
        {
            LOG("Failed to activate data set.");
            return 0;
        }

        imageTracker->activateDataSet(dataSethuitailang);
        imageTracker->activateDataSet(dataSetheroin);
        imageTracker->activateDataSet(dataSetStonesAndChips);
        imageTracker->activateDataSet(dataSetchhhh);
        imageTracker->activateDataSet(dataSethh);
        imageTracker->activateDataSet(dataSetcoo);
        LOG("Successfully loaded and activated data set.");
        return 1;
    }