本文整理汇总了C++中Tracker类的典型用法代码示例。如果您正苦于以下问题:C++ Tracker类的具体用法?C++ Tracker怎么用?C++ Tracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tracker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: main
int main(int argc, char* argv[]) {
Parser parser;
GeneralConfig::scale = 10;
parser.addGroup(TrackingConfig());
parser.addGroup(RecordingConfig());
parser.addGroup(SceneConfig());
parser.addGroup(GeneralConfig());
parser.addGroup(BulletConfig());
parser.read(argc, argv);
Tracker* TrackerSystem;
if (TrackingConfig::objType=="towel")
TrackerSystem = new TowelTracker();
else if (TrackingConfig::objType=="rope")
TrackerSystem = new RopeTracker();
else throw std::runtime_error("invalid objType");
extern bool LIVE;
if (LIVE) TrackerSystem->runOnline();
else TrackerSystem->runOffline();
}
开发者ID:NaohiroHayashi,项目名称:bulletsim,代码行数:22,代码来源:test_new_tracking.cpp
示例17: test_random
template <uint32_t K> static bool test_random() {
srand(K);
error = false;
for (uint32_t j = 0; j < iterations; ++j) {
Tracker<K> tracker;
uint32_t i = 0;
for (i = 0; i < ops; ++i) {
if ((rand() & 0xF) == 0) {
// Simulate work that takes time
if (logging) {
printf("SLEEPING for %dms (%d)\n", sleepPeriodMS, PR_IntervalNow());
}
PR_Sleep(PR_MillisecondsToInterval(sleepPeriodMS));
// Process pending timer events
NS_ProcessPendingEvents(nullptr);
}
tracker.DoRandomOperation();
}
}
return !error;
}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:24,代码来源:TestExpirationTracker.cpp
示例18: main
int main() {
// Verify that piped outputs are line-buffered
setvbuf(stdout, (char *) NULL, _IOLBF, 0); /* make line buffered stdout */
T = Tracker("config.tz");
#ifdef _draw_
namedWindow("window", 1);
#endif
while (1) {
T.update();
#ifdef _draw_
if (T.C.size() > 0) {
line(img, T.C[0][0], T.C[0][1], Scalar(0, 0, 255));
line(img, T.C[0][1], T.C[0][2], Scalar(0, 255, 0));
line(img, T.C[0][2], T.C[0][3], Scalar(255, 0, 0));
line(img, T.C[0][3], T.C[0][0], Scalar(128, 128, 128));
circle(img, T.C[0][0], 40, Scalar(0, 0, 255), 2, 8);
circle(img, T.C[0][1], 40, Scalar(0, 0, 255), 2, 8);
circle(img, T.C[0][2], 40, Scalar(0, 0, 255), 2, 8);
circle(img, T.C[0][3], 40, Scalar(0, 0, 255), 2, 8);
}
for (int n = 0; n < T.P.size(); n++) {
circle(img, Point(T.P[n].x, T.P[n].y), sqrt(T.P[n].num / PI), Scalar(0, 255, 0), 4, 8);
}
imshow("window", img);
#endif
std::cout << T.tvecf.print((T.trackerFound)?1.0:0.0) << "\n";
}
return 0;
}
开发者ID:kiranshila,项目名称:ThrackerZodd,代码行数:36,代码来源:main.cpp
示例19: demo1
void demo1(int strawman)
{
Tracker trk;
if (strawman <= 3)
{
// FPix
{ Det d; d.setDisk( 29.1, 4.5, 16.1, 56, false); trk.add(d); }
{ Det d; d.setDisk( 39.6, 4.5, 16.1, 56, false); trk.add(d); }
{ Det d; d.setDisk( 51.6, 4.5, 16.1, 56, false); trk.add(d); }
// BPix
{ Det d; d.setLayer( 3.0, 0.0, 27.4, 0, false); trk.add(d); }
{ Det d; d.setLayer( 6.8, 0.0, 27.4, 0, false); trk.add(d); }
{ Det d; d.setLayer( 10.9, 0.0, 27.4, 0, false); trk.add(d); }
{ Det d; d.setLayer( 16.0, 0.0, 27.4, 0, false); trk.add(d); }
// Variant used for the initial proposal: 4 full disks, 3 half disks
if (strawman == 0)
{
{ Det d; d.setDisk( 76.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 85.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 108.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 140.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 200.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 230.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 264.0, 10.0, 16.1, 56, true); trk.add(d); }
}
// Variant using 6 disks a la FPix
if (strawman == 1)
{
{ Det d; d.setDisk( 83.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 99.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 138.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 175.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 218.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 264.0, 4.5, 16.1, 56, true); trk.add(d); }
}
// Variant optimising lever arm using small and large r rings
if (strawman == 2)
{
{ Det d; d.setDisk( 100.0, 14.5, 16.0, 56, true); trk.add(d); } // 1
{ Det d; d.setDisk( 109.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 118.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 128.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 140.0, 14.5, 16.0, 56, true); trk.add(d); } // 5
{ Det d; d.setDisk( 153.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 168.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 184.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 202.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 222.0, 14.5, 16.0, 56, true); trk.add(d); } // 10
{ Det d; d.setDisk( 240.0, 14.5, 16.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 66.0, 5.5, 12.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 88.0, 5.5, 12.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 130.0, 5.5, 12.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 180.0, 5.5, 12.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 34.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 48.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 65.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 84.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 112.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 138.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 164.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 190.0, 3.2, 4.8, 56, true); trk.add(d); }
{ Det d; d.setDisk( 264.0, 4.5, 16.1, 56, true); trk.add(d); }
}
// Variant using 6 disks a la FPix but the rings are separated in z for disks 1-5
if (strawman == 3)
{
{ Det d; d.setDisk( 68.0, 4.5, 11.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 92.0, 4.5, 11.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 125.0, 4.5, 11.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 170.0, 4.5, 11.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 210.0, 4.5, 11.0, 56, true); trk.add(d); }
{ Det d; d.setDisk( 90.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 115.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 140.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 180.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 220.0, 10.0, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 264.0, 4.5, 16.1, 56, true); trk.add(d); }
}
// Variant with conical supply tube, first attempt
if (strawman == 104)
{
// another FPix disk
{ Det d; d.setDisk( 68.0, 4.5, 16.1, 56, true); trk.add(d); }
// Now the start of VFpix
{ Det d; d.setDisk( 85.0, 4.5, 16.1, 56, true); trk.add(d); }
{ Det d; d.setDisk( 109.0, 4.5, 16.1, 56, true); trk.add(d); }
//.........这里部分代码省略.........
开发者ID:frmeier,项目名称:tkPlotter,代码行数:101,代码来源:demo1.C
示例20: main
int main(int argc, const char **argv)
{
VideoCapture cap;
Tracker objTracker;
CommandLineParser parser(argc, argv, keys);
if (parser.has("help")) {
help();
return 0;
}
cap.open(argv[1]);
if (!cap.isOpened()) {
help();
cout << "***Could not access file...***\n";
return -1;
}
Size S = Size((int) cap.get(CV_CAP_PROP_FRAME_WIDTH), //Acquire input size
(int) cap.get(CV_CAP_PROP_FRAME_HEIGHT));
cout << hot_keys;
bool paused = false;
Mat frame;
cap >> frame;
objTracker.Init(S, Tracker::InitParams());
int ex = static_cast<int>(cap.get(CV_CAP_PROP_FOURCC));
VideoWriter outputVideo;
// outputVideo.open("output.mp4" , ex, cap.get(CV_CAP_PROP_FPS), S, true);
Mat out;
try {
while (1) {
if (!paused && Tracker::g_initTracking) {
cap >> frame;
if (frame.empty())
break;
}
if (!paused) {
objTracker.ProcessFrame(frame, out);
}
imshow("CamShift", out);
// outputVideo << out;
char c = (char)waitKey(10);
if (c == 27)
break;
switch (c) {
case 'b':
objTracker.ToggleShowBackproject();
break;
case 'c':
// trackObject = 0;
// histimg = Scalar::all(0);
break;
case 'h':
objTracker.HideControlsGUI();
// showHist = !showHist;
// if (!showHist)
// destroyWindow("Histogram");
// else
// namedWindow("Histogram", 1);
// break;
case 'p':
paused = !paused;
break;
case 'r':
cap.set(CV_CAP_PROP_POS_AVI_RATIO, 0);
// outputVideo.set(CV_CAP_PROP_POS_AVI_RATIO, 0);
cap >> frame;
objTracker.Init(S, Tracker::InitParams());
break;
default:
;
}
}
}
catch (const cv::Exception &e) {
std::cerr << e.what();
cap.release();
outputVideo.release();
return 1;
}
cap.release();
outputVideo.release();
return 0;
}
开发者ID:Xiaoliang1992,项目名称:kalman-camshift,代码行数:100,代码来源:main.cpp
注:本文中的Tracker类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论