40 #ifndef vpDisplayOpenCV_h 41 #define vpDisplayOpenCV_h 43 #include <visp3/core/vpConfig.h> 44 #if defined(VISP_HAVE_OPENCV) 46 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 50 #include <visp3/core/vpDisplay.h> 51 #include <visp3/core/vpImage.h> 52 #include <visp3/core/vpImageConvert.h> 54 #if VISP_HAVE_OPENCV_VERSION >= 0x020101 55 #include <opencv2/core/core.hpp> 56 #include <opencv2/highgui/highgui.hpp> 153 #if (VISP_HAVE_OPENCV_VERSION < 0x020408) 154 IplImage *m_background;
160 cv::Mat m_background;
166 static std::vector<std::string> m_listTitles;
167 static unsigned int m_nbWindows;
231 unsigned int getScreenHeight();
232 void getScreenSize(
unsigned int &width,
unsigned int &height);
233 unsigned int getScreenWidth();
236 void init(
vpImage<vpRGBa> &I,
int winx = -1,
int winy = -1,
const std::string &title =
"");
237 void init(
unsigned int width,
unsigned int height,
int winx = -1,
int winy = -1,
const std::string &title =
"");
240 void setFont(
const std::string &font);
241 void setTitle(
const std::string &title);
249 unsigned int w = 4,
unsigned int h = 2,
unsigned int thickness = 1);
254 unsigned int thickness = 1);
257 unsigned int thickness = 1);
261 void displayImage(
const unsigned char *I);
264 unsigned int height);
266 unsigned int height);
272 bool fill =
false,
unsigned int thickness = 1);
274 bool fill =
false,
unsigned int thickness = 1);
278 void flushDisplayROI(
const vpImagePoint &iP,
unsigned int width,
unsigned int height);
280 bool getClick(
bool blocking =
true);
290 static void on_mouse(
int event,
int x,
int y,
int flags,
void *param);
292 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 293 void overlay(std::function<
void(cv::Mat&)> overlay_function,
double opacity);
Class that defines generic functionnalities for display.
static bool getPointerPosition(const vpImage< unsigned char > &I, vpImagePoint &ip)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static bool getPointerMotionEvent(const vpImage< unsigned char > &I, vpImagePoint &ip)
Class to define RGB colors available for display functionnalities.
static bool getClickUp(const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
static void displayPoint(const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
static const vpColor green
static void setFont(const vpImage< unsigned char > &I, const std::string &font)
static void displayArrow(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static void displayRectangle(const vpImage< unsigned char > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void getImage(const vpImage< unsigned char > &Is, vpImage< vpRGBa > &Id)
static void displayCircle(const vpImage< unsigned char > &I, const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void setWindowPosition(const vpImage< unsigned char > &I, int winx, int winy)
Defines a rectangle in the plane.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static bool getKeyboardEvent(const vpImage< unsigned char > &I, bool blocking=true)
static void displayCharString(const vpImage< unsigned char > &I, const vpImagePoint &ip, const char *string, const vpColor &color)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
static const vpColor white
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void displayDotLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)