50 #include <visp/vpConfig.h>
52 #if defined(VISP_HAVE_OPENCV)
61 #include <visp/vpDisplay.h>
62 #include <visp/vpDisplayOpenCV.h>
63 #include <visp/vpMath.h>
64 #include <visp/vpImageTools.h>
67 #include <visp/vpDebug.h>
68 #include <visp/vpDisplayException.h>
70 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
72 # include <opencv2/imgproc/imgproc.hpp>
73 # include <opencv2/core/core_c.h>
76 # define CV_RGB( r, g, b ) cv::Scalar( (b), (g), (r), 0 )
80 std::vector<std::string> vpDisplayOpenCV::m_listTitles = std::vector<std::string>();
81 unsigned int vpDisplayOpenCV::m_nbWindows = 0;
98 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
99 background(NULL), col(NULL), cvcolor(), font(NULL),
101 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
103 fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false),
104 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
105 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
106 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
107 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
108 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
109 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
111 init(I, x, y, title) ;
128 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
129 background(NULL), col(NULL), cvcolor(), font(NULL),
131 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
133 fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false),
134 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
135 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
136 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
137 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
138 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
139 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
141 init(I, x, y, title) ;
168 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
169 background(NULL), col(NULL), cvcolor(), font(NULL),
171 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
173 fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false),
174 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
175 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
176 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
177 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
178 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
179 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
185 title_ = std::string(title);
188 std::ostringstream s;
190 title_ = std::string(
"Window ") + s.str();
196 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
197 if(m_listTitles[i] ==
title_){
198 std::ostringstream s;
200 title_ = std::string(
"Window ") + s.str();
208 m_listTitles.push_back(
title_);
232 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
233 background(NULL), col(NULL), cvcolor(), font(NULL),
235 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
237 fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false),
238 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
239 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
240 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
241 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
242 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
243 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
253 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
254 cvReleaseImage(&background);
277 "Image not initialized")) ;
303 "Image not initialized")) ;
333 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
334 int flags = CV_WINDOW_AUTOSIZE;
336 int flags = cv::WINDOW_AUTOSIZE;
341 title_ = std::string(title);
345 std::ostringstream s;
347 title_ = std::string(
"Window ") + s.str();
353 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
354 if(m_listTitles[i] ==
title_){
355 std::ostringstream s;
357 title_ = std::string(
"Window ") + s.str();
365 m_listTitles.push_back(
title_);
369 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
370 if (cvNamedWindow( this->
title_.c_str(), flags ) < 0) {
373 "OpenCV was not built with a display device")) ;
376 cv::namedWindow( this->
title_, flags );
378 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
390 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
437 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
439 cvInitFont( font, CV_FONT_HERSHEY_PLAIN, 0.70f,0.70f);
442 cvGetTextSize(
"A", font, &fontSize, &baseline );
447 fontSize = cv::getTextSize(
"A", font, fontScale, thickness, &baseline );
450 fontHeight = fontSize.height + baseline;
507 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
508 cvMoveWindow( this->
title_.c_str(), winx, winy );
510 cv::moveWindow( this->
title_.c_str(), winx, winy );
517 "OpenCV not initialized")) ;
547 "OpenCV not initialized")) ;
567 const unsigned int w,
const unsigned int h )
576 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
579 CvSize size = cvSize((
int)this->
width, (
int)this->
height);
580 if (background != NULL){
581 if(background->nChannels != channels || background->depth != depth
582 || background->height != (
int) I.
getHeight() || background->width != (int) I.
getWidth()){
583 if(background->nChannels != 0) cvReleaseImage(&background);
584 background = cvCreateImage( size, depth, channels );
587 else background = cvCreateImage( size, depth, channels );
590 unsigned char * input = (
unsigned char*)Ip->imageData;
591 unsigned char * output = (
unsigned char*)background->imageData;
593 unsigned int iwidth = Ic.getWidth();
595 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
603 *(output+3*j) = *(input+j*3);
604 *(output+3*j+1) = *(input+j*3+1);
605 *(output+3*j+2) = *(input+j*3+2);
608 input = input + 3*iwidth;
609 output = output + 3*this->
width;
617 cv::Size size((
int)this->width, (
int)this->height);
618 if(background.channels() != channels || background.depth() != depth
619 || background.rows != (int) I.
getHeight() || background.cols != (int) I.
getWidth()){
620 background = cv::Mat( size, CV_MAKETYPE(depth, channels) );
626 unsigned char * input = (
unsigned char*)Ip.data;
627 unsigned char * output = (
unsigned char*)background.data;
629 unsigned int iwidth = Ic.getWidth();
631 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
639 *(output+3*j) = *(input+j*3);
640 *(output+3*j+1) = *(input+j*3+1);
641 *(output+3*j+2) = *(input+j*3+2);
644 input = input + 3*iwidth;
645 output = output + 3*this->
width;
654 "OpenCV not initialized")) ;
686 "OpenCV not initialized")) ;
706 const unsigned int w,
const unsigned int h )
713 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
714 CvSize size = cvSize((
int)this->
width, (
int)this->
height);
717 if (background != NULL){
718 if(background->nChannels != channels || background->depth != depth
719 || background->height != (
int) I.
getHeight() || background->width != (int) I.
getWidth()){
720 if(background->nChannels != 0) cvReleaseImage(&background);
721 background = cvCreateImage( size, depth, channels );
724 else background = cvCreateImage( size, depth, channels );
729 unsigned char * input = (
unsigned char*)Ip->imageData;
730 unsigned char * output = (
unsigned char*)background->imageData;
732 unsigned int iwidth = Ic.
getWidth();
734 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
742 *(output+3*j) = *(input+j*3);
743 *(output+3*j+1) = *(input+j*3+1);
744 *(output+3*j+2) = *(input+j*3+2);
747 input = input + 3*iwidth;
748 output = output + 3*this->
width;
756 cv::Size size((
int)this->width, (
int)this->height);
757 if(background.channels() != channels || background.depth() != depth
758 || background.rows != (int) I.
getHeight() || background.cols != (int) I.
getWidth()){
759 background = cv::Mat( size, CV_MAKETYPE(depth, channels) );
764 unsigned char * input = (
unsigned char*)Ip.data;
765 unsigned char * output = (
unsigned char*)background.data;
767 unsigned int iwidth = Ic.
getWidth();
769 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
777 *(output+3*j) = *(input+j*3);
778 *(output+3*j+1) = *(input+j*3+1);
779 *(output+3*j+2) = *(input+j*3+2);
782 input = input + 3*iwidth;
783 output = output + 3*this->
width;
792 "OpenCV not initialized")) ;
818 delete [] col ; col = NULL ;
820 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
828 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
829 cvDestroyWindow( this->
title_.c_str() );
831 cv::destroyWindow( this->
title_ );
834 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
835 if(
title_ == m_listTitles[i]){
836 m_listTitles.erase(m_listTitles.begin()+(
long int)i);
857 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
858 cvShowImage(this->
title_.c_str(), background );
861 cv::imshow(this->
title_, background );
869 "OpenCV not initialized")) ;
882 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
883 cvShowImage(this->
title_.c_str(), background );
886 cv::imshow(this->
title_.c_str(), background );
894 "OpenCV not initialized")) ;
904 static bool warn_displayed =
false;
905 if (! warn_displayed) {
907 warn_displayed =
true;
921 unsigned int w,
unsigned int h,
922 unsigned int thickness)
932 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon())
933 &&(std::fabs(b)<= std::numeric_limits<double>::epsilon()))
972 "OpenCV not initialized")) ;
994 #if VISP_HAVE_OPENCV_VERSION < 0x020408
995 cvPutText( background, text,
998 font, col[color.
id] );
1000 cv::putText( background, text,
1003 font, fontScale, col[color.
id] );
1007 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1008 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1009 cvPutText( background, text,
1014 cv::putText( background, text,
1017 font, fontScale, cvcolor );
1025 "OpenCV not initialized")) ;
1038 unsigned int radius,
1041 unsigned int thickness)
1045 if (fill ==
false) {
1047 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1048 cvCircle( background,
1051 (int)radius, col[color.
id], (
int)thickness);
1053 cv::circle( background,
1056 (int)radius, col[color.
id], (
int)thickness);
1060 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1061 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1062 cvCircle( background,
1065 (int)radius, cvcolor, (
int)thickness);
1067 cv::circle( background,
1070 (int)radius, cvcolor, (
int)thickness);
1075 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1076 int filled = cv::FILLED;
1078 int filled = CV_FILLED;
1081 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1082 cvCircle( background,
1085 (int)radius, col[color.
id], filled);
1087 cv::circle( background,
1090 (int)radius, col[color.
id], filled);
1094 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1095 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1096 cvCircle( background,
1099 (int)radius, cvcolor, filled);
1101 cv::circle( background,
1104 (int)radius, cvcolor, filled);
1113 "OpenCV not initialized")) ;
1128 unsigned int thickness)
1156 "OpenCV not initialized")) ;
1175 unsigned int thickness)
1182 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1188 col[color.
id], (int) thickness);
1190 cv::line( background,
1195 col[color.
id], (int) thickness);
1199 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1200 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1206 cvcolor, (int) thickness);
1208 cv::line( background,
1213 cvcolor, (int) thickness);
1221 "OpenCV not initialized")) ;
1236 unsigned int thickness)
1241 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1247 col[color.
id], (int) thickness);
1249 cv::line( background,
1254 col[color.
id], (int) thickness);
1258 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1259 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1265 cvcolor, (int) thickness);
1267 cv::line( background,
1272 cvcolor, (int) thickness);
1280 "OpenCV not initialized")) ;
1328 "OpenCV not initialized")) ;
1347 unsigned int w,
unsigned int h,
1348 const vpColor &color,
bool fill,
1349 unsigned int thickness)
1353 if (fill ==
false) {
1355 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1356 cvRectangle( background,
1361 col[color.
id], (int)thickness);
1363 cv::rectangle( background,
1368 col[color.
id], (int)thickness);
1372 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1373 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1374 cvRectangle( background,
1379 cvcolor, (int)thickness);
1381 cv::rectangle( background,
1386 cvcolor, (int)thickness);
1391 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1392 int filled = cv::FILLED;
1394 int filled = CV_FILLED;
1397 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1398 cvRectangle( background,
1403 col[color.
id], filled);
1405 cv::rectangle( background,
1410 col[color.
id], filled);
1414 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1415 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1416 cvRectangle( background,
1423 cv::rectangle( background,
1437 "OpenCV not initialized")) ;
1455 const vpColor &color,
bool fill,
1456 unsigned int thickness )
1460 if (fill ==
false) {
1462 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1463 cvRectangle( background,
1468 col[color.
id], (int)thickness);
1470 cv::rectangle( background,
1475 col[color.
id], (int)thickness);
1479 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1480 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1481 cvRectangle( background,
1486 cvcolor, (int)thickness);
1488 cv::rectangle( background,
1493 cvcolor, (int)thickness);
1498 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1499 int filled = cv::FILLED;
1501 int filled = CV_FILLED;
1504 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1505 cvRectangle( background,
1510 col[color.
id], filled);
1512 cv::rectangle( background,
1517 col[color.
id], filled);
1521 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1522 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1523 cvRectangle( background,
1530 cv::rectangle( background,
1544 "OpenCV not initialized")) ;
1562 const vpColor &color,
bool fill,
1563 unsigned int thickness)
1567 if (fill ==
false) {
1569 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1570 cvRectangle( background,
1575 col[color.
id], (int)thickness);
1577 cv::rectangle( background,
1582 col[color.
id], (int)thickness);
1586 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1587 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1588 cvRectangle( background,
1593 cvcolor, (int)thickness);
1596 cv::rectangle( background,
1601 cvcolor, (int)thickness);
1607 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1608 int filled = cv::FILLED;
1610 int filled = CV_FILLED;
1613 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1614 cvRectangle( background,
1619 col[color.
id], filled);
1621 cv::rectangle( background,
1626 col[color.
id], filled);
1630 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1631 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1632 cvRectangle( background,
1639 cv::rectangle( background,
1653 "OpenCV not initialized")) ;
1681 lbuttondown =
false;
1682 mbuttondown =
false;
1683 rbuttondown =
false;
1688 lbuttondown =
false;
1692 mbuttondown =
false;
1696 rbuttondown =
false;
1699 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1704 }
while ( ret ==
false && blocking ==
true);
1709 "OpenCV not initialized")) ;
1742 lbuttondown =
false;
1743 mbuttondown =
false;
1744 rbuttondown =
false;
1749 u = (
unsigned int)x_lbuttondown;
1750 v = (
unsigned int)y_lbuttondown;
1753 lbuttondown =
false;
1757 u = (
unsigned int)x_mbuttondown;
1758 v = (
unsigned int)y_mbuttondown;
1761 mbuttondown =
false;
1765 u = (
unsigned int)x_rbuttondown;
1766 v = (
unsigned int)y_rbuttondown;
1769 rbuttondown =
false;
1772 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1777 }
while ( ret ==
false && blocking ==
true);
1782 "OpenCV not initialized")) ;
1818 lbuttondown =
false;
1819 mbuttondown =
false;
1820 rbuttondown =
false;
1825 u = (
unsigned int)x_lbuttondown;
1826 v = (
unsigned int)y_lbuttondown;
1830 lbuttondown =
false;
1834 u = (
unsigned int)x_mbuttondown;
1835 v = (
unsigned int)y_mbuttondown;
1839 mbuttondown =
false;
1843 u = (
unsigned int)x_rbuttondown;
1844 v = (
unsigned int)y_rbuttondown;
1848 rbuttondown =
false;
1851 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1856 }
while ( ret ==
false && blocking ==
true);
1861 "OpenCV not initialized")) ;
1906 u = (
unsigned int)x_lbuttonup;
1907 v = (
unsigned int)y_lbuttonup;
1915 u = (
unsigned int)x_mbuttonup;
1916 v = (
unsigned int)y_mbuttonup;
1924 u = (
unsigned int)x_rbuttonup;
1925 v = (
unsigned int)y_rbuttonup;
1932 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1937 }
while ( ret ==
false && blocking ==
true);
1942 "OpenCV not initialized" ) ) ;
1962 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1963 case CV_EVENT_MOUSEMOVE:
1965 case cv::EVENT_MOUSEMOVE:
1973 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1974 case CV_EVENT_LBUTTONDOWN:
1976 case cv::EVENT_LBUTTONDOWN:
1979 disp->lbuttondown =
true;
1980 disp->x_lbuttondown = x;
1981 disp->y_lbuttondown = y;
1984 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1985 case CV_EVENT_MBUTTONDOWN:
1987 case cv::EVENT_MBUTTONDOWN:
1990 disp->mbuttondown =
true;
1991 disp->x_mbuttondown = x;
1992 disp->y_mbuttondown = y;
1995 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1996 case CV_EVENT_RBUTTONDOWN:
1998 case cv::EVENT_RBUTTONDOWN:
2001 disp->rbuttondown =
true;
2002 disp->x_rbuttondown = x;
2003 disp->y_rbuttondown = y;
2006 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2007 case CV_EVENT_LBUTTONUP:
2009 case cv::EVENT_LBUTTONUP:
2012 disp->lbuttonup =
true;
2013 disp->x_lbuttonup = x;
2014 disp->y_lbuttonup = y;
2017 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2018 case CV_EVENT_MBUTTONUP:
2020 case cv::EVENT_MBUTTONUP:
2023 disp->mbuttonup =
true;
2024 disp->x_mbuttonup = x;
2025 disp->y_mbuttonup = y;
2028 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2029 case CV_EVENT_RBUTTONUP:
2031 case cv::EVENT_RBUTTONUP:
2034 disp->rbuttonup =
true;
2035 disp->x_rbuttonup = x;
2036 disp->y_rbuttonup = y;
2073 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2074 key_pressed = cvWaitKey(delay);
2076 key_pressed = cv::waitKey(delay);
2079 if (key_pressed == -1)
2086 "OpenCV not initialized")) ;
2121 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2122 key_pressed = cvWaitKey(delay);
2124 key_pressed = cv::waitKey(delay);
2126 if (key_pressed == -1)
2130 sprintf(
string,
"%c", key_pressed);
2137 "OpenCV not initialized")) ;
2164 u = (
unsigned int)x_move;
2165 v = (
unsigned int)y_move;
2175 "OpenCV not initialized")) ;
2199 u = (
unsigned int)x_move;
2200 v = (
unsigned int)y_move;
2209 "OpenCV not initialized")) ;
void displayCircle(const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
void displayCharString(const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
void clearDisplay(const vpColor &color=vpColor::white)
unsigned int getWidth() const
void displayRectangle(const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void displayPoint(const vpImagePoint &ip, const vpColor &color)
unsigned char B
Blue component.
static const vpColor black
static const vpColor darkRed
bool getClick(bool blocking=true)
void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
Class to define colors available for display functionnalities.
static const vpColor lightGray
bool getPointerPosition(vpImagePoint &ip)
static const vpColor darkBlue
bool displayHasBeenInitialized
display has been initialized
unsigned char G
Green component.
static const vpColor green
static int round(const double x)
void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static const vpColor lightRed
virtual ~vpDisplayOpenCV()
static const vpColor orange
static void on_mouse(int event, int x, int y, int flags, void *param)
void set_i(const double ii)
static const vpColor cyan
static const vpColor lightGreen
void flushDisplayROI(const vpImagePoint &iP, const unsigned int width, const unsigned int height)
void set_u(const double u)
static double sqr(double x)
void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
The vpDisplayOpenCV allows to display image using the opencv library.
void set_v(const double v)
void displayImage(const vpImage< vpRGBa > &I)
void displayArrow(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
void displayImageROI(const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int width, const unsigned int height)
bool getClickUp(vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
static const vpColor gray
static const vpColor darkGray
void set_j(const double jj)
bool getPointerMotionEvent(vpImagePoint &ip)
Error that can be emited by the vpDisplay class and its derivates.
void getImage(vpImage< vpRGBa > &I)
get the window pixmap and put it in vpRGBa image
int windowXPosition
display position
unsigned char R
Red component.
void setFont(const char *font)
unsigned int getHeight() const
Defines a rectangle in the plane.
static const vpColor darkGreen
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void setTitle(const char *title)
static const vpColor yellow
static const vpColor lightBlue
int windowYPosition
display position
static const vpColor purple
static const vpColor white
bool getKeyboardEvent(bool blocking=true)
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
void setWindowPosition(int winx, int winy)
static const vpColor blue