本文整理汇总了C++中qcar::ImageTracker类的典型用法代码示例。如果您正苦于以下问题:C++ ImageTracker类的具体用法?C++ ImageTracker怎么用?C++ ImageTracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImageTracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
JNIEXPORT void JNICALL
Java_rajawali_vuforia_RajawaliVuforiaActivity_stopCamera(JNIEnv *, jobject) {
LOG("Java_rajawali_vuforia_RajawaliVuforiaActivity_stopCamera");
// Stop the tracker:
QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
QCAR::Tracker* markerTracker = trackerManager.getTracker(
QCAR::MarkerTracker::getClassType());
if (markerTracker != 0)
markerTracker->stop();
QCAR::ImageTracker* imageTracker =
static_cast<QCAR::ImageTracker*>(trackerManager.getTracker(
QCAR::ImageTracker::getClassType()));
if (imageTracker != 0)
imageTracker->stop();
QCAR::CameraDevice::getInstance().stop();
// Stop Cloud Reco:
QCAR::TargetFinder* targetFinder = imageTracker->getTargetFinder();
assert(targetFinder != 0);
targetFinder->stop();
// Clears the trackables
targetFinder->clearTrackables();
QCAR::CameraDevice::getInstance().deinit();
initStateVariables();
}
示例2: LOG
// ----------------------------------------------------------------------------
// Initialize Cloud Reco
// ----------------------------------------------------------------------------
JNIEXPORT int JNICALL
Java_com_qualcomm_QCARSamples_CloudRecognition_CloudReco_initCloudReco(JNIEnv *, jobject)
{
LOG("Java_com_qualcomm_QCARSamples_VisualSearch_VisualSearch_initVisualSearch");
// Get the image tracker:
QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
assert(imageTracker != NULL);
// Initialize visual search:
QCAR::TargetFinder* targetFinder = imageTracker->getTargetFinder();
assert(targetFinder != NULL);
// Start initialization:
if (targetFinder->startInit(kAccessKey, kSecretKey))
{
targetFinder->waitUntilInitFinished();
}
int resultCode = targetFinder->getInitState();
if ( resultCode != QCAR::TargetFinder::INIT_SUCCESS)
{
LOG("Failed to initialize target finder.");
return resultCode;
}
// Use the following calls if you would like to customize the color of the UI
// targetFinder->setUIScanlineColor(1.0, 0.0, 0.0);
// targetFinder->setUIPointColor(0.0, 0.0, 1.0);
return resultCode;
}
示例3:
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);
}
示例4:
JNIEXPORT jint JNICALL Java_com_tvc_supastriker_SupaStriker_destroyTrackerData
(JNIEnv *, jobject){
LOG("Java_com_tvc_supastriker_SupaStriker_destroyTrackerData");
// 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 destroy tracking data set because the ImageTracker has not"
"been initialized");
return 0;
}
if(dataSetSupaStrika != 0){
if(imageTracker->getActiveDataSet() == dataSetSupaStrika &&
!imageTracker->deactivateDataSet(dataSetSupaStrika)){
LOG("Failed to destroy the tracking data set SupaStriker because the data set"
"could not be activated");
return 0;
}
LOG("Successfully destroyed the data set SupaStriker");
}
return 1;
}
示例5: configureVideoBackground
// ----------------------------------------------------------------------------
// Starts the Camera
// ----------------------------------------------------------------------------
JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_CloudRecognition_CloudReco_startCamera(JNIEnv *, jobject)
{
// Initialize the camera:
if (!QCAR::CameraDevice::getInstance().init())
return;
// Configure the video background
configureVideoBackground();
// Select the default mode:
if (!QCAR::CameraDevice::getInstance().selectVideoMode(
QCAR::CameraDevice::MODE_DEFAULT))
return;
// Start the camera:
if (!QCAR::CameraDevice::getInstance().start())
return;
// Start the tracker:
QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
assert(imageTracker != 0);
imageTracker->start();
// Start cloud based recognition if we are in scanning mode:
if(scanningMode)
{
QCAR::TargetFinder* targetFinder = imageTracker->getTargetFinder();
assert (targetFinder != 0);
crStarted = targetFinder->startRecognition();
}
}
示例6: assert
// ----------------------------------------------------------------------------
// Enables CloudReco Service
// ----------------------------------------------------------------------------
JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_CloudRecognition_CloudReco_enterScanningModeNative(JNIEnv*, jobject)
{
QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
assert(imageTracker != 0);
QCAR::TargetFinder* targetFinder = imageTracker->getTargetFinder();
assert (targetFinder != 0);
// Start CloudReco
crStarted = targetFinder->startRecognition();
// Clear all trackables created previously:
targetFinder->clearTrackables();
scanningMode = true;
// Updates state variables
showAnimation3Dto2D = false;
showAnimation2Dto3D = false;
isShowing2DOverlay = false;
renderState = RS_SCANNING;
}
示例7: LOG
JNIEXPORT int JNICALL
Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_destroyTrackerData(JNIEnv *, jobject)
{
LOG("Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_destroyTrackerData");
// 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 destroy the tracking data set because the ImageTracker has not"
" been initialized.");
return 0;
}
if (dataSetStonesAndChips != 0)
{
if (imageTracker->getActiveDataSet() == dataSetStonesAndChips &&
!imageTracker->deactivateDataSet(dataSetStonesAndChips))
{
LOG("Failed to destroy the tracking data set StonesAndChips because the data set "
"could not be deactivated.");
return 0;
}
if (!imageTracker->destroyDataSet(dataSetStonesAndChips))
{
LOG("Failed to destroy the tracking data set StonesAndChips.");
return 0;
}
LOG("Successfully destroyed the data set StonesAndChips.");
dataSetStonesAndChips = 0;
}
//if (dataSetTarmac != 0)
//{
// if (imageTracker->getActiveDataSet() == dataSetTarmac &&
// !imageTracker->deactivateDataSet(dataSetTarmac))
// {
// LOG("Failed to destroy the tracking data set Tarmac because the data set "
// "could not be deactivated.");
// return 0;
// }
// if (!imageTracker->destroyDataSet(dataSetTarmac))
// {
// LOG("Failed to destroy the tracking data set Tarmac.");
// return 0;
// }
// LOG("Successfully destroyed the data set Tarmac.");
// dataSetTarmac = 0;
//}
return 1;
}
示例8: LOG
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;
}
示例9: LOG
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;
}
示例10: LOGI
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;
}
示例11: QCAR_onUpdate
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);
}
}
}
示例12:
void
RefFreeFrame::deInit( )
{
QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
QCAR::ImageTracker* imageTracker =
static_cast<QCAR::ImageTracker*> (trackerManager.getTracker(
QCAR::Tracker::IMAGE_TRACKER));
if (imageTracker != 0)
{
QCAR::ImageTargetBuilder* targetBuilder =
imageTracker->getImageTargetBuilder();
if (targetBuilder && (targetBuilder->getFrameQuality()
!= QCAR::ImageTargetBuilder::FRAME_QUALITY_NONE))
{
targetBuilder->stopScan();
}
}
}
示例13: LOG
JNIEXPORT int JNICALL
Java_com_miosys_finder_ui_PfinderTargets_destroyTrackerData(JNIEnv *, jobject)
{
LOG("Java_com_miosys_finder_ui_PfinderTargets_destroyTrackerData");
// 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 destroy the tracking data set because the ImageTracker has not"
" been initialized.");
return 0;
}
if (dataSetStonesAndChips != 0)
{
if (imageTracker->getActiveDataSet() == dataSetStonesAndChips &&
!imageTracker->deactivateDataSet(dataSetStonesAndChips))
{
LOG("Failed to destroy the tracking data set StonesAndChips because the data set "
"could not be deactivated.");
return 0;
}
if (!imageTracker->destroyDataSet(dataSetStonesAndChips))
{
LOG("Failed to destroy the tracking data set StonesAndChips.");
return 0;
}
LOG("Successfully destroyed the data set StonesAndChips.");
dataSetStonesAndChips = 0;
}
if (dataSetTarmac != 0)
{
if (imageTracker->getActiveDataSet() == dataSetTarmac &&
!imageTracker->deactivateDataSet(dataSetTarmac))
{
LOG("Failed to destroy the tracking data set Tarmac because the data set "
"could not be deactivated.");
return 0;
}
if (!imageTracker->destroyDataSet(dataSetTarmac))
{
LOG("Failed to destroy the tracking data set Tarmac.");
return 0;
}
LOG("Successfully destroyed the data set Tarmac.");
dataSetTarmac = 0;
}
return 1;
}
示例14: LOG
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;
}
示例15:
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;
}