DUtilsCV::GUI Class Reference

Window management for image visualization. More...

#include <GUI.h>

List of all members.

Classes

class  MouseHandler

Public Types

enum  tKey {
  NO_KEY = 0, BACKSPACE = 8, TAB = 9, ESC = 27,
  ENTER = 10, SPACEBAR = 32, LEFT_ARROW = 81, UP_ARROW = 82,
  RIGHT_ARROW = 83, DOWN_ARROW = 84, PAGE_UP = 85, PAGE_DOWN = 86,
  HOME = 80, END = 87, INS = 99, KP_CENTER = -99,
  KP_SW = -100, KP_SE = -101, KP_NE = -102, KP_S = -103,
  KP_E = -104, KP_N = -105, KP_W = -106, KP_NW = -107,
  KP_INS = -98, KP_SUP = -97, KP_ENTER = -115, KP_PLUS = -85,
  KP_MINUS = -83, KP_SLASH = -81, KP_ASTERISK = -86, KP_POINT = -82,
  KP_0 = -80, KP_1 = -79, KP_2 = -78, KP_3 = -77,
  KP_4 = -76, KP_5 = -75, KP_6 = -74, KP_7 = -73,
  KP_8 = -72, KP_9 = -71
}
 

Key codes.


typedef std::string tWinHandler
 Handler for windows.

Static Public Member Functions

static int showImage (const cv::Mat &image, bool autosize=true, tWinHandler *hwnd=NULL, int timeout=0)
static int showImageInfo (const cv::Mat &image, bool autosize=true, tWinHandler *hwnd=NULL)
static bool windowExists (const tWinHandler &hwnd)
static void destroyWindow (const tWinHandler &hwnd)
static bool showSystemImage (const cv::Mat &image, const std::string &tmp_file="tmp.png", const std::string &app="eog")

Detailed Description

Window management for image visualization.


Member Function Documentation

void GUI::destroyWindow ( const tWinHandler hwnd  )  [static]

Closes a window

Parameters:
hwnd 
int GUI::showImage ( const cv::Mat &  image,
bool  autosize = true,
GUI::tWinHandler hwnd = NULL,
int  timeout = 0 
) [static]

Creates a windows showing the given image and waits untils some key is pressed

Parameters:
image 
autosize param used the first time the window is created
hwnd (in/out) if given, the image is shown in the given window. If not, a new window is created and its name is returned here
timeout time to wait for user input (in ms). If 0 or not given, there is no time limit. In case of timeout, NO_KEY is returned.
Returns:
the pressed key by the user, or NO_KEY in case of timeout
int GUI::showImageInfo ( const cv::Mat &  image,
bool  autosize = true,
tWinHandler hwnd = NULL 
) [static]

Creates a window showing the given image and a status bar with info about the image. The control is blocked until some key is pressed, which is returned later.

Parameters:
image 
autosize param used the first time the window is created
hwnd (in/out) if given, the image is shown in the given window. If not, a new window is created and its name is returned here
hwnd (in/out) if given, the image is shown in the given window. If not, a new window is created and its name is returned here
Returns:
the pressed key by the user
bool GUI::showSystemImage ( const cv::Mat &  image,
const std::string &  tmp_file = "tmp.png",
const std::string &  app = "eog" 
) [static]

Saves the image in a temporary file to visualize it with a system application

Parameters:
image 
tmp_file file where the image is stored
app application invoked to visualize the image
Returns:
true iff success
bool GUI::windowExists ( const tWinHandler hwnd  )  [static]

Checks if window exists

Parameters:
hwnd 
Returns:
true iif window exists

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations
Generated on Thu Feb 7 19:22:00 2013 by  doxygen 1.6.3