34 #include <opencv2/highgui/highgui.hpp> 35 #include <opencv2/highgui/highgui_c.h> 41 "rtabmap-camera [option] \n" 43 " --device # USB camera device id (default 0).\n" 44 " --rate # Frame rate (default 0 Hz). 0 means as fast as possible.\n" 45 " --path "" Path to a directory of images or a video file.\n" 46 " --calibration "" Calibration file (*.yaml).\n\n");
58 std::string calibrationFile;
59 for(
int i=1; i<argc; ++i)
61 if(strcmp(argv[i],
"--rate") == 0)
78 if(strcmp(argv[i],
"--device") == 0)
83 device = std::atoi(argv[i]);
95 if(strcmp(argv[i],
"--path") == 0)
108 if(strcmp(argv[i],
"--calibration") == 0)
113 calibrationFile = argv[i];
122 printf(
"Unrecognized option : %s\n", argv[i]);
128 UINFO(
"Using device %d", device);
132 UINFO(
"Using path %s", path.c_str());
156 UERROR(
"Path not valid! \"%s\"", path.c_str());
167 if(!calibrationFile.empty())
169 UINFO(
"Set calibration: %s", calibrationFile.c_str());
174 UERROR(
"Cannot initialize the camera.");
180 rgb = camera->takeImage().imageRaw();
181 cv::namedWindow(
"Video", CV_WINDOW_AUTOSIZE);
184 cv::imshow(
"Video", rgb);
186 int c = cv::waitKey(10);
190 rgb = camera->takeImage().imageRaw();
192 cv::destroyWindow(
"Video");
int main(int argc, char *argv[])
static std::string getDir(const std::string &filePath)
float UTILITE_EXP uStr2Float(const std::string &str)
Some conversion functions.
std::string getExtension()
static void setLevel(ULogger::Level level)
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
ULogger class and convenient macros.
static bool exists(const std::string &dirPath)