本文整理汇总了C++中Cameras::init方法的典型用法代码示例。如果您正苦于以下问题:C++ Cameras::init方法的具体用法?C++ Cameras::init怎么用?C++ Cameras::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cameras
的用法示例。
在下文中一共展示了Cameras::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
init();
// For catching a CTRL-C
signal(SIGINT,exit_handler);
// Initialize
int retVal = stereo.init();
if (retVal !=0 )
exit_handler(0);
// Start the acquisition flow
retVal = stereo.start();
if (retVal !=0 )
exit_handler(0);
// Main loop
while(true) {
// Capture stereo images
retVal = stereo.saveTwoImages();
if (retVal !=0 )
exit_handler(0);
// Wait 1s between each images
usleep(300000);
// Handle pause/unpause and ESC
int c = cvWaitKey(1);
if(c == 'p') {
DEBUG<<"Acquisition is now paused"<<endl;
c = 0;
while(c != 'p' && c != 27){
c = cvWaitKey(250);
}
DEBUG<<"Acquisition is now unpaused"<<endl;
}
if(c == 27) {
DEBUG<<"Acquisition has been stopped by user"<<endl;
break;
}
}
// Stop the acquisition flow
stereo.stop();
// Close cameras
stereo.close();
return 0;
}
示例2: main
int main(int argc, char **argv) {
init();
// For catching a CTRL-C
signal(SIGINT,exit_handler);
// Initialize
int retVal = stereo.init("../examples/stereo_calib_dataset_3/");
if (retVal !=0 )
exit_handler(0);
// Main loop
retVal = stereo.calib();
if (retVal !=0 )
exit_handler(0);
// Close camera
stereo.close();
return 0;
}