OpenCV/IPL image format acces.
- Author
- Thomsen / Woetzel
#include <iostream>
#include <Base/Image/Image.hh>
#include <Base/Image/ImageIO.hh>
#include <Base/Image/ImageConvert.hh>
#ifdef BIAS_HAVE_OPENCV
# include <highgui.h>
#endif
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
#ifdef BIAS_HAVE_OPENCV
IplImage *dst=NULL;
if (argc!=2){
BIASERR(argv[0]<<" <image-file>");
return -1;
}
BIASERR("error loading "<<argv[1]<<" (Load)");
return -2;
}
BIASERR("error converting bias -> ipl");
return -2;
}
cvNamedWindow( "window", 1 );
cvShowImage( "window", dst );
const int delay=3000;
std::cout<<"will close gui window after "<<delay<<" msecs."<<endl;
cvWaitKey(4000);
std::cout<<"closed window."<<endl;
BIASERR("error converting ipl -> bias");
return -2;
}
BIASERR("error writing bias-ipl-bias.mip");
return -1;
}
#else
std::cout<<"you compiled without OpenCV."<<endl;
#endif
return 0;
}