当前位置: 首页>>代码示例>>C++>>正文


C++ Tracker类代码示例

本文整理汇总了C++中Tracker的典型用法代码示例。如果您正苦于以下问题:C++ Tracker类的具体用法?C++ Tracker怎么用?C++ Tracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Tracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ofVec3f

FFTTracer::FFTTracer(){
    fft_size = ((testApp*)ofGetAppPtr())->fft_size;
    magnitude = new float[fft_size];
    
    for (int i = 0; i < fft_size; i++) {
        ofVec3f p = ofVec3f(0, 0, 0);
        pos.push_back(p);
        ofVec3f v = ofVec3f(0, 0, 0);
        vel.push_back(v);
        
        Tracker *t = new Tracker;
        t->setup();
        t->setTrackerLength(10);
        trackers.push_back(t);
    }
    
    //ばねパラメータ
    /*
     stiffness = 1.0;
     damping = 0.9;
     mass = 100.0;
     */
    stiffness = 2.0;
    damping = 0.92;
    mass = 200;
    
    //((testApp*)ofGetAppPtr())->cam.setPosition(0, 0, -200);
    //((testApp*)ofGetAppPtr())->cam.lookAt(ofVec3f(0,0,0));
    //camStart = ofPoint(0,0,-200);
    //camEnd = camStart;
    resetCam();
}
开发者ID:bimyoo,项目名称:AudioVisualApps,代码行数:32,代码来源:FFTTracer.cpp

示例2: tracker_new

static int tracker_new(lua_State * L) {
	const char * body = luaL_checkstring(L, 1);
	const char * ip = luaL_checkstring(L, 2);
	int port = luaL_optint(L, 3, 3883);
	Tracker * u = (Tracker*)lua_newuserdata(L, sizeof(Tracker));
	sprintf(u->name, "%[email protected]%s:%d", body, ip, port);
	
	if (u->open(u->name)) {
		luaL_getmetatable(L, "vrpn_Tracker_Remote");
		lua_setmetatable(L, -2);
		
		// create environment table to hold pos, quat etc.
		lua_createtable(L, 0, 3);
			lua_pushinteger(L, 0);	lua_setfield(L, -2, "sensor");
			lua_createtable(L, 3, 0);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 1);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 2);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 3);
			lua_setfield(L, -2, "pos");
			lua_createtable(L, 4, 0);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 1);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 2);
				lua_pushnumber(L, 0);	lua_rawseti(L, -2, 3);
				lua_pushnumber(L, 1);	lua_rawseti(L, -2, 4);
			lua_setfield(L, -2, "quat");		
		lua_setfenv(L, -2);
		
		return 1;
	} 
	return 0;
}
开发者ID:LuaAV,项目名称:LuaAV,代码行数:31,代码来源:lua_vrpn.cpp

示例3: test_tracker

void test_tracker() {
  int frame_count = 0;

  cv::VideoCapture cap;
  cap.set(cv::CAP_PROP_FRAME_WIDTH,320);
  cap.set(cv::CAP_PROP_FRAME_HEIGHT,240);

  if(!cap.open(0)) throw (string) "couldn't open camera";
  cv::Mat frame;

  Tracker tracker;

  for(;;) {

    cap >> frame;
    tracker.process_image(frame);
    ++frame_count;
    //const cv::Scalar white = cv::Scalar(255,255,255);
    //const cv::Scalar green = cv::Scalar(0,255,0);
    const cv::Scalar red = cv::Scalar(0,0,255);

    cv::putText(frame, (string) to_string(frame_count), cv::Point(50,50), cv::FONT_HERSHEY_SIMPLEX, 1, red, 3);
    //putText(frame, (string) to_string(tracker.low_distance), cv::Point(50,100), cv::FONT_HERSHEY_SIMPLEX ,1, red, 3);
    //putText(frame, (string) to_string(tracker.high_distance), cv::Point(50,150), cv::FONT_HERSHEY_SIMPLEX ,1, red, 3);

    cv::imshow("window 1", frame);
    if(cv::waitKey(1)==27) break;
  }

}
开发者ID:berickson,项目名称:car,代码行数:30,代码来源:tracker.cpp

示例4: testLightImplicitDigitalSurface

//-----------------------------------------------------------------------------
// Testing LightImplicitDigitalSurface
//-----------------------------------------------------------------------------
bool testLightImplicitDigitalSurface()
{
  using namespace Z3i;
  typedef ImplicitDigitalEllipse3<Point> ImplicitDigitalEllipse;
  typedef LightImplicitDigitalSurface<KSpace,ImplicitDigitalEllipse> Boundary;
  typedef Boundary::SurfelConstIterator ConstIterator;
  typedef Boundary::Tracker Tracker;
  typedef Boundary::Surfel Surfel;

  unsigned int nbok = 0;
  unsigned int nb = 0;
  trace.beginBlock ( "Testing block ... LightImplicitDigitalSurface" );
  Point p1( -10, -10, -10 );
  Point p2( 10, 10, 10 );
  KSpace K;
  nbok += K.init( p1, p2, true ) ? 1 : 0; 
  nb++;
  trace.info() << "(" << nbok << "/" << nb << ") "
	       << "K.init() is ok" << std::endl;
  ImplicitDigitalEllipse ellipse( 6.0, 4.5, 3.4 );
  Surfel bel = Surfaces<KSpace>::findABel( K, ellipse, 10000 );
  Boundary boundary( K, ellipse, 
                     SurfelAdjacency<KSpace::dimension>( true ), bel );
  unsigned int nbsurfels = 0;
  for ( ConstIterator it = boundary.begin(), it_end = boundary.end();
        it != it_end; ++it )
    {
      ++nbsurfels;
    }
  trace.info() << nbsurfels << " surfels found." << std::endl;
  trace.beginBlock ( "Checks if adjacent surfels are part of the surface." );

  for ( ConstIterator it = boundary.begin(), it_end = boundary.end();
        it != it_end; ++it )
    {
      Tracker* ptrTracker = boundary.newTracker( *it );
      Surfel s = ptrTracker->current();
      Dimension trackDir = * K.sDirs( s );
      Surfel s1, s2;
      // unsigned int m1 = 
      ptrTracker->adjacent( s1, trackDir, true ); 
      // unsigned int m2 = 
      ptrTracker->adjacent( s2, trackDir, false ); 
      // trace.info() << "s = " << s << std::endl;
      // trace.info() << "s1 = " << s1 << " m1 = " << m1 << std::endl;
      // trace.info() << "s2 = " << s2 << " m2 = " << m2 << std::endl;
      nb++, nbok += boundary.isInside( s1 ) ? 1 : 0;
      // trace.info() << "(" << nbok << "/" << nb << ") "
      //              << "boundary.isInside( s1 )" << std::endl;
      nb++, nbok += boundary.isInside( s2 ) ? 1 : 0;
      // trace.info() << "(" << nbok << "/" << nb << ") "
      //              << "boundary.isInside( s2 )" << std::endl;
      delete ptrTracker;
    }
  trace.info() << "(" << nbok << "/" << nb << ") isInside tests." << std::endl;
  trace.endBlock();
  trace.endBlock();
  return nbok == nb;
}
开发者ID:Victor-Ostromoukhov,项目名称:DGtal,代码行数:62,代码来源:testDigitalSurface.cpp

示例5: Tracker

// Create a new tracker for images of a given size.
Tracker *create(int width, int height, bool debug) {
    Tracker *tracker = new Tracker(width, height, debug);
	if (! tracker->init()) {
		delete tracker;
		tracker = NULL;
	}
	return tracker;
}
开发者ID:AdarshSBelludi,项目名称:Junkyard-Jumbotron,代码行数:9,代码来源:artoolkit_.cpp

示例6: testDigitalSetBoundary

/**
 * Example of a test. To be completed.
 *
 */
bool testDigitalSetBoundary()
{
  unsigned int nbok = 0;
  unsigned int nb = 0;
  
  trace.beginBlock ( "Testing block ... DigitalSetBoundary" );
  using namespace Z2i;
  typedef DigitalSetBoundary<KSpace,DigitalSet> Boundary;
  typedef Boundary::SurfelConstIterator ConstIterator;
  typedef Boundary::Tracker Tracker;
  typedef Boundary::Surfel Surfel;
  Point p1( -10, -10 );
  Point p2( 10, 10 );
  Domain domain( p1, p2 );
  DigitalSet dig_set( domain );
  Shapes<Domain>::addNorm2Ball( dig_set, Point( 0, 0 ), 5 );
  Shapes<Domain>::removeNorm2Ball( dig_set, Point( 0, 0 ), 1 );
  KSpace K;
  nbok += K.init( domain.lowerBound(), domain.upperBound(), true ) ? 1 : 0; 
  nb++;
  trace.info() << "(" << nbok << "/" << nb << ") "
	       << "K.init() is ok" << std::endl;
  Boundary boundary( K, dig_set );
  unsigned int nbsurfels = 0;
  for ( ConstIterator it = boundary.begin(), it_end = boundary.end();
        it != it_end; ++it )
    {
      ++nbsurfels;
    }
  trace.info() << nbsurfels << " surfels found." << std::endl;
  nb++, nbok += nbsurfels == ( 12 + 44 ) ? 1 : 0;
  trace.info() << "(" << nbok << "/" << nb << ") "
	       << "nbsurfels == (12 + 44 )" << std::endl;
  for ( ConstIterator it = boundary.begin(), it_end = boundary.end();
        it != it_end; ++it )
    {
      Tracker* ptrTracker = boundary.newTracker( *it );
      Surfel s = ptrTracker->current();
      Dimension trackDir = * K.sDirs( s );
      Surfel s1, s2;
      unsigned int m1 = ptrTracker->adjacent( s1, trackDir, true ); 
      unsigned int m2 = ptrTracker->adjacent( s2, trackDir, false ); 
      trace.info() << "s = " << s << std::endl;
      trace.info() << "s1 = " << s1 << " m1 = " << m1 << std::endl;
      trace.info() << "s2 = " << s2 << " m2 = " << m2 << std::endl;
      nb++, nbok += boundary.isInside( s1 ) ? 1 : 0;
      trace.info() << "(" << nbok << "/" << nb << ") "
                   << "boundary.isInside( s1 )" << std::endl;
      nb++, nbok += boundary.isInside( s2 ) ? 1 : 0;
      trace.info() << "(" << nbok << "/" << nb << ") "
                   << "boundary.isInside( s2 )" << std::endl;
      delete ptrTracker;
    }
  trace.endBlock();
  return nbok == nb;
}
开发者ID:Victor-Ostromoukhov,项目名称:DGtal,代码行数:60,代码来源:testDigitalSurface.cpp

示例7: main

int main(int argc, char** argv)
{
	Tracker tracker;

	tracker.read_image_paths(argv[1]);
	tracker.read_confidence_paths(argv[2]);

	tracker.initialize_tracker();

	for(int i = 3; (i < argc) && ((argv[i])[0] == '-'); i++)
	{
	    switch ((argv[i])[1])
	    {
	    	case 'e':
	    		i++;
	    		tracker.set_std_noise(atof(argv[i]));
	    		break;
	    	default:
	    		printf("\nUnrecognized option %s!\n\n",argv[i]);
	            exit(0);
	    }
	}

	// process each frame
	while(tracker.is_the_end() == false)
	{
		tracker.process_frame();

		cv::waitKey(1);
		tracker.next_frame();
	}

	tracker.terminate_tracker();
}
开发者ID:caomw,项目名称:Multitarget_Tracking,代码行数:34,代码来源:main.cpp

示例8: main

int main(int argc,const char* argv[])
{
    vector3 v(1,2,3);
    Body b(v);
    b.print();
    std::srand(time(NULL));
    std::cout<<RangeFloat(1,2)<<std::endl;
    Tracker track;
    track.print_all();
    return 0;
}
开发者ID:rosebudflyaway,项目名称:parallel_course_project,代码行数:11,代码来源:test.cpp

示例9: main

int main(){
	Tracker tracker = Tracker();
	cout << tracker.allocate("apibox") << endl;
	cout << tracker.allocate("apibox") << endl;
	tracker.deallocate("apibox1");
	cout << tracker.allocate("apibox") << endl;
	cout << tracker.allocate("testbox") << endl;




}
开发者ID:hughbzhang,项目名称:Solved,代码行数:12,代码来源:hostname.cpp

示例10: main

int main(int argc, char *argv[]) {
  ola::AppInit(&argc, argv, "[options]",
               "Measure the latency of RPCs to olad.");

  Tracker tracker;
  if (!tracker.Setup()) {
    OLA_FATAL << "Setup failed";
    exit(1);
  }

  tracker.Start();
  return 0;
}
开发者ID:DanielAeolusLaude,项目名称:ola,代码行数:13,代码来源:ola-latency.cpp

示例11: ofSetFrameRate

//--------------------------------------------------------------
void ofApp::setup() {
	ofSetFrameRate(60);
	ofSetVerticalSync(true);
	
	rotate = 0;
	
	// setup bvh
	bvh[0].load("bvhfiles/kashiyuka.bvh");
	bvh[1].load("bvhfiles/nocchi.bvh");
	bvh[2].load("bvhfiles/aachan.bvh");
	
	for (int i = 0; i < 3; i++)	{
		bvh[i].play();
	}
	
	track.loadSound("Perfume_globalsite_sound.wav");
	track.play();
	track.setLoop(true);
	
	// setup tracker and drawer
	for (int i = 0; i < 3; i++)
		{
		ofxBvh &b = bvh[i];
		Drawer *d = new Drawer;
		
		for (int n = 0; n < b.getNumJoints(); n++) {
			const ofxBvhJoint *o = b.getJoint(n);
			Tracker *t = new Tracker;
			t->setup(o);
			t->setTrackerLength(trackerLength);
			trackers.push_back(t);
			d->add(o);
		}
		
		drawers.push_back(d);
		}
	
	ofPushMatrix();
	ofTranslate(0, -100);
	ofScale(1, 1, 1);
	ofRotateX(90);
	camera.setFov(90);
	camera.lookAt(ofVec3f(0,0,0));
	camera.setPosition(300, 30, 300);
	//camera.disableMouseInput();
	ofPopMatrix();
	background.loadImage("background.png");
	
}
开发者ID:Kajiyu,项目名称:LiTLeaders7_MArt,代码行数:50,代码来源:ofApp.cpp

示例12: getGUI

    void MagnetGeneratorPlugin::generateMagnet()
    {
        bt::TorrentInterface* tor = getGUI()->getTorrentActivity()->getCurrentTorrent();
        if (!tor)
            return;

        QUrl dn(tor->getStats().torrent_name);
        SHA1Hash ih(tor->getInfoHash());

        QString uri("magnet:?xt=urn:btih:");
        uri.append(ih.toString());

        if (MagnetGeneratorPluginSettings::dn())
        {
            uri.append("&dn=");
            uri.append(QUrl::toPercentEncoding(dn.toString(), "{}", NULL));
        }

        if ((MagnetGeneratorPluginSettings::customtracker() && MagnetGeneratorPluginSettings::tr().length() > 0) && !MagnetGeneratorPluginSettings::torrenttracker())
        {
            uri.append("&tr=");
            QUrl tr(MagnetGeneratorPluginSettings::tr());
            uri.append(QUrl::toPercentEncoding(tr.toString(), "{}", NULL));
        }

        if (MagnetGeneratorPluginSettings::torrenttracker())
        {
            QList<bt::TrackerInterface*> trackers = tor->getTrackersList()->getTrackers();
            if (!trackers.isEmpty())
            {
                Tracker* trk = (Tracker*)trackers.first();
                QUrl tr(trk->trackerURL());

                uri.append("&tr=");
                uri.append(QUrl::toPercentEncoding(tr.toString(), "{}", NULL));
            }

        }

        addToClipboard(uri);

        if (MagnetGeneratorPluginSettings::popup())
            showPopup();

    }
开发者ID:dreamsxin,项目名称:ktorrent,代码行数:45,代码来源:magnetgeneratorplugin.cpp

示例13: Visit

bool Graph::Visit(int node, Tracker &tracker) {
    if (tracker.IsHamiltonianCycle()) {
        return true;
    }

    for (const auto adjacent_node : adjacency_list_[node]) {
        if (!tracker.IsVisited(adjacent_node) || tracker.IsHamiltonianCycle(adjacent_node)) {
            tracker.Visit(adjacent_node);
            if (Visit(adjacent_node, tracker)) {
                return true;
            }

            tracker.UndoVisit(adjacent_node);
        }
    }

    return false;
}
开发者ID:GauthamBanasandra,项目名称:Hackerrank_Solutions,代码行数:18,代码来源:Hamiltonian+cycle.cpp

示例14: ofSetFrameRate

void testApp::setup()
{
	ofSetFrameRate(60);
	ofSetVerticalSync(true);

	ofBackground(0);

	play_rate = play_rate_t = 1;
	rotate = 0;

	bvh.resize(3);

	// You have to get motion and sound data from http://www.perfume-global.com

	// setup bvh
	bvh[0].load("bvhfiles/aachan.bvh");
	bvh[1].load("bvhfiles/kashiyuka.bvh");
	bvh[2].load("bvhfiles/nocchi.bvh");

	for (int i = 0; i < bvh.size(); i++)
	{
		bvh[i].setFrame(1);
	}

	track.loadSound("Perfume_globalsite_sound.wav");
	track.play();
	track.setLoop(true);

	// setup tracker
	for (int i = 0; i < bvh.size(); i++)
	{
		ofxBvh &b = bvh[i];

		for (int n = 0; n < b.getNumJoints(); n++)
		{
			const ofxBvhJoint *o = b.getJoint(n);
			Tracker *t = new Tracker;
			t->setup(o);
			trackers.push_back(t);
		}
	}
}
开发者ID:chansuke,项目名称:Perfume,代码行数:42,代码来源:testApp.cpp

示例15: ofSetFrameRate

//--------------------------------------------------------------
void ofApp::setup() {
	ofSetFrameRate(60);
	ofSetVerticalSync(true);	
	
	rotate = 0;
	
	// setup bvh
	bvh[0].load("bvhfiles/kashiyuka.bvh");
	bvh[1].load("bvhfiles/nocchi.bvh");
	bvh[2].load("bvhfiles/aachan.bvh");
	
	for (int i = 0; i < 3; i++)	{
		bvh[i].play();
	}
	
	track.load("Perfume_globalsite_sound.wav");
	track.play();
	track.setLoop(true);
	
	// setup tracker
	for (int i = 0; i < 3; i++)
	{
		ofxBvh &b = bvh[i];
		
		for (int n = 0; n < b.getNumJoints(); n++) {
			const ofxBvhJoint *o = b.getJoint(n);
			Tracker *t = new Tracker;
			t->setup(o);
			t->setTrackerLength(trackerLength);
			trackers.push_back(t);
		}
	}
	
	camera.setFov(45);
	camera.setDistance(360);
	camera.disableMouseInput();
	
	background.load("background.png");
	
}
开发者ID:MorimasaAketa,项目名称:perfume-bvh-oF,代码行数:41,代码来源:ofApp.cpp


注:本文中的Tracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。