25 #include <Base/Debug/TimeMeasure.hh>
26 #include <Base/Image/ImageConvert.hh>
27 #include <Base/Image/ImageIO.hh>
28 #include <Image/Camera.hh>
29 #include <VideoSource/VideoSource_DCAM.hh>
44 int main(
int argc,
char *argv[])
46 unsigned int num = argc > 1 ? max(1, atoi(argv[1])) : 2;
47 std::vector< VideoSource_DCAM > cam(num);
48 std::vector< Camera<unsigned char> > grabimg(num);
50 cout <<
"Initializing " << num <<
" cameras..." << endl;
52 for (
unsigned int i = 0; i < num; i++) {
53 cam[i].SetDebugLevel(D_DCAM |D_DCAM_F7);
54 cam[i].SetFirewireB(
false);
55 if (cam[i].OpenDevice(i) < 0) {
56 cerr <<
"Failed to open camera at bus " << i <<
"!" << endl;
60 cam[i].SetDebugLevel(0);
61 cam[i].InitImage(grabimg[i]);
64 for (
unsigned int i = 0; i < num; i++)
65 cam[i].GrabSingle(grabimg[i]);
68 for (
unsigned int i = 0; i < num; i++) {
69 sprintf(filename,
"camera-%d.mip", i);
71 cout <<
"Saved camera image " << i <<
" to " << filename <<
"." << endl;
74 cout <<
"Closing cameras..." << endl;
76 for (
unsigned int i = 0; i < num; i++) {
77 cam[i].SetDebugLevel(D_DCAM);
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.