GUI.cpp
Go to the documentation of this file.
00001 
00024 #include <vector>
00025 #include <opencv/cv.h>
00026 #include <opencv/highgui.h>
00027 #include <cstdio>
00028 #include <string>
00029 #include <sstream>
00030 #include "GUI.h"
00031 
00032 using namespace std;
00033 using namespace DUtilsCV;
00034 
00035 // ---------------------------------------------------------------------------
00036 
00037 void GUI::showImage(const cv::Mat &image, bool autosize)
00038 {
00039   static int id = 0;
00040   
00041   char name[16];
00042   sprintf(name, "win%d", id++);
00043   
00044   int flags = 0;
00045   if(autosize) flags |= CV_WINDOW_AUTOSIZE;
00046   
00047   cv::namedWindow( name, flags );
00048   cv::imshow( name, image );
00049   cv::waitKey();
00050 }
00051 
00052 // ---------------------------------------------------------------------------
00053 
00054 bool GUI::showSystemImage(const cv::Mat &image,
00055   const std::string &tmp_file, const std::string &app)
00056 {
00057   cv::imwrite(tmp_file, image);
00058   
00059   stringstream ss;
00060   ss << app << " " << tmp_file;
00061 
00062   return(0 == system(ss.str().c_str()));
00063 }
00064 
00065 // ---------------------------------------------------------------------------
00066 


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:31:17