Example for using a single DCam
- Author
- MIP
#include <Base/Debug/TimeMeasure.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Image/ImageIO.hh>
#include <Image/Camera.hh>
#include <VideoSource/VideoSource_DCAM.hh>
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
int res = -1;
int num = 1;
if (argc > 1) {
num = atoi(argv[1]);
if (num < 1) num = 1;
}
dc1394video_mode_t mode = DC1394_VIDEO_MODE_800x600_MONO8;
if (res < 0) {
cerr << "Failed to open camera (error code " << res << ")" << endl;
exit(1);
}
for (int i = 0; i < num; i++)
{
cout << "Attempting to grab image..." << flush;
cout <<" done!" << endl << flush;
char filename[16];
sprintf(filename, "image-%05d.mip", i);
}
cout << "Closing camera..." << flush;
cout << " done!" << endl << flush;
delete cam;
return 0;
}