int main(int argc, char **argv) { init_cv_buffers(); context = init_kinect(); if (context == NULL) { return 1; } if (freenect_open_device(context, &device, 0) < 0) { printf("could not open device\n"); freenect_shutdown(context); return 1; } int capture_loop_failed = pthread_create(&kinect_thread, NULL, capture_loop, NULL); if (capture_loop_failed) { printf("pthread_create failed\n"); freenect_shutdown(context); return 1; } handle_sigint(); graphics_loop(argc, argv); pthread_join(kinect_thread, NULL); printf("thanks for shooting down quads!\n"); }
// ThisApp构造函数 ThisApp::ThisApp(){ if (SUCCEEDED(init_kinect()) && SUCCEEDED(init_speech_recognizer())){ m_threadAudio.std::thread::~thread(); m_threadAudio.std::thread::thread(AudioThread, this); } else{ m_threadAudio.std::thread::~thread(); m_threadAudio.std::thread::thread(AudioThread, this); } }
void testApp::setup() { ofSetLogLevel(OF_LOG_VERBOSE); ofSetWindowPosition(0,0); init_kinect(); init_keys(); debug_depth_texture = true; tex_width = 1024; tex_height = 768; mesh = new cml::Mesh_openni(&depth_generator); camluc.init(ofToDataPath("camara_lucida/openni_calibration.yml"), ofToDataPath("camara_lucida/openni_projector_calibration.yml"), ofToDataPath("camara_lucida/camara_lucida_config.xml"), mesh, tex_width, tex_height, 1); ofAddListener(camluc.render_texture, this, &testApp::render_texture); ofAddListener(camluc.render_hud, this, &testApp::render_hud); }
int main ( int argc, char **argv ) { ros::init ( argc, argv, "kinect_save_image" ); init_kinect(); return 0; }