38 #include <Base/Image/Image.hh>
39 #include <Base/Image/ImageIO.hh>
40 #include <Base/Image/WrapBias2Ipl.hh>
43 #include <bias_config.h>
44 #ifndef BIAS_HAVE_OPENCV
45 # error You need to enable OPENCV to compile this file. Please reconfigure BIAS with USE_OPENCV
53 int main(
int argc,
char** argv ){
55 if (argc>=2)
if (strcmp(argv[1],
"-darttest")==0) {
57 std::cout<<
"started dart test: "<<argv[0]<<std::endl;
61 string filename( BIAS_TESTS_DATA
"r4.jpg" );
62 if (!darttest && (argc>1)) filename=argv[1];
65 cout<<
"error loading image "<<filename<<endl;
75 cvLine( wrap.p_imgIpl,
80 cvEllipse( wrap.p_imgIpl,
87 string msg(
"Hello BIAS world! 1234567890");
89 CvFont font1, font2, font3;
90 cvInitFont( &font1, CV_FONT_HERSHEY_SIMPLEX,
93 cvInitFont( &font2, CV_FONT_HERSHEY_PLAIN,
97 CV_FONT_HERSHEY_COMPLEX,
104 cvPutText( wrap.p_imgIpl, msg.c_str(),
105 cvPoint(100,50), &font1, cvScalar(255,0,0) );
106 cvPutText( wrap.p_imgIpl, msg.c_str(),
107 cvPoint(100,100), &font2, cvScalar(0,255,0) );
108 cvPutText( wrap.p_imgIpl, msg.c_str(),
109 cvPoint(100,150), &font3, cvScalar(0,0,255) );
115 if (!darttest) wrap.Display(
true, 2000);
unsigned int GetWidth() const
unsigned int GetHeight() const
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.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
wrapper around a BIAS image to be used as an OpenCv IPlimage with shared data area.