Example for a videosource getting images over network
- Author
- MIP
#include <Base/Common/W32Compat.hh>
#include <VideoSource/VideoSource_Net.hh>
#include <Base/Image/ImageIO.hh>
#include <Image/Camera.hh>
using namespace BIAS;
using namespace std;
bool done = false;
bool save = false;
int imgNo = 0;
int main( int argc, char *argv[])
{
int res;
if (argc>1) {
cout <<"Connecting server "<<argv[1]<<endl;
int port = D_CS_DEFAULT_PORT;
if(argc>2) port = atoi(argv[2]);
if (res!=0)
exit(-1);
} else {
cout<<"usage: "<<argv[0]<<" serverName [port]"<<endl;
exit(0);
}
while(!done){
if (imgNo==0)
if (imgNo%10==0) {
char name[255];
sprintf(name,"image_%04i.mip",imgNo);
cout<<"Written image:"<<name<<" to disk"<<endl;
}
imgNo++;
if (imgNo==200) done=true;
}
delete cam;
return 0;
}