46 #include <visp3/core/vpConfig.h>
48 #if defined(VISP_HAVE_OPENCV)
57 #include <visp3/core/vpDisplay.h>
58 #include <visp3/gui/vpDisplayOpenCV.h>
59 #include <visp3/core/vpMath.h>
60 #include <visp3/core/vpImageTools.h>
63 #include <visp3/core/vpDebug.h>
64 #include <visp3/core/vpDisplayException.h>
66 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
68 # include <opencv2/imgproc/imgproc.hpp>
69 # include <opencv2/core/core_c.h>
72 # define CV_RGB( r, g, b ) cv::Scalar( (b), (g), (r), 0 )
76 std::vector<std::string> vpDisplayOpenCV::m_listTitles = std::vector<std::string>();
77 unsigned int vpDisplayOpenCV::m_nbWindows = 0;
95 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
96 background(NULL), col(NULL), cvcolor(), font(NULL),
98 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
100 fontHeight(10), x_move(0), y_move(0) , move(false),
101 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
102 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
103 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
104 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
105 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
106 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
108 init(I, x, y, title) ;
125 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
126 background(NULL), col(NULL), cvcolor(), font(NULL),
128 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
130 fontHeight(10), x_move(0), y_move(0) , move(false),
131 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
132 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
133 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
134 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
135 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
136 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
138 init(I, x, y, title) ;
165 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
166 background(NULL), col(NULL), cvcolor(), font(NULL),
168 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
170 fontHeight(10), x_move(0), y_move(0) , move(false),
171 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
172 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
173 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
174 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
175 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
176 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
182 title_ = std::string(title);
185 std::ostringstream s;
187 title_ = std::string(
"Window ") + s.str();
193 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
194 if(m_listTitles[i] ==
title_){
195 std::ostringstream s;
197 title_ = std::string(
"Window ") + s.str();
205 m_listTitles.push_back(
title_);
229 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
230 background(NULL), col(NULL), cvcolor(), font(NULL),
232 background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
234 fontHeight(10), x_move(0), y_move(0) , move(false),
235 x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
236 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false),
237 x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
238 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false),
239 x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false),
240 x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false)
250 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
251 cvReleaseImage(&background);
274 "Image not initialized")) ;
300 "Image not initialized")) ;
330 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
331 int flags = CV_WINDOW_AUTOSIZE;
333 int flags = cv::WINDOW_AUTOSIZE;
338 title_ = std::string(title);
342 std::ostringstream s;
344 title_ = std::string(
"Window ") + s.str();
350 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
351 if(m_listTitles[i] ==
title_){
352 std::ostringstream s;
354 title_ = std::string(
"Window ") + s.str();
362 m_listTitles.push_back(
title_);
366 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
367 if (cvNamedWindow( this->
title_.c_str(), flags ) < 0) {
370 "OpenCV was not built with a display device")) ;
373 cv::namedWindow( this->
title_, flags );
375 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
387 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
434 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
436 cvInitFont( font, CV_FONT_HERSHEY_PLAIN, 0.70f,0.70f);
439 cvGetTextSize(
"A", font, &fontSize, &baseline );
444 fontSize = cv::getTextSize(
"A", font, fontScale, thickness, &baseline );
447 fontHeight = fontSize.height + baseline;
504 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
505 cvMoveWindow( this->
title_.c_str(), winx, winy );
507 cv::moveWindow( this->
title_.c_str(), winx, winy );
514 "OpenCV not initialized")) ;
544 "OpenCV not initialized")) ;
564 const unsigned int w,
const unsigned int h )
573 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
576 CvSize size = cvSize((
int)this->
width, (
int)this->
height);
577 if (background != NULL){
578 if(background->nChannels != channels || background->depth != depth
579 || background->height != (
int) I.
getHeight() || background->width != (int) I.
getWidth()){
580 if(background->nChannels != 0) cvReleaseImage(&background);
581 background = cvCreateImage( size, depth, channels );
584 else background = cvCreateImage( size, depth, channels );
587 unsigned char * input = (
unsigned char*)Ip->imageData;
588 unsigned char * output = (
unsigned char*)background->imageData;
590 unsigned int iwidth = Ic.getWidth();
592 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
600 *(output+3*j) = *(input+j*3);
601 *(output+3*j+1) = *(input+j*3+1);
602 *(output+3*j+2) = *(input+j*3+2);
605 input = input + 3*iwidth;
606 output = output + 3*this->
width;
614 cv::Size size((
int)this->width, (
int)this->height);
615 if(background.channels() != channels || background.depth() != depth
616 || background.rows != (int) I.
getHeight() || background.cols != (int) I.
getWidth()){
617 background = cv::Mat( size, CV_MAKETYPE(depth, channels) );
623 unsigned char * input = (
unsigned char*)Ip.data;
624 unsigned char * output = (
unsigned char*)background.data;
626 unsigned int iwidth = Ic.getWidth();
628 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
636 *(output+3*j) = *(input+j*3);
637 *(output+3*j+1) = *(input+j*3+1);
638 *(output+3*j+2) = *(input+j*3+2);
641 input = input + 3*iwidth;
642 output = output + 3*this->
width;
651 "OpenCV not initialized")) ;
683 "OpenCV not initialized")) ;
703 const unsigned int w,
const unsigned int h )
710 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
711 CvSize size = cvSize((
int)this->
width, (
int)this->
height);
714 if (background != NULL){
715 if(background->nChannels != channels || background->depth != depth
716 || background->height != (
int) I.
getHeight() || background->width != (int) I.
getWidth()){
717 if(background->nChannels != 0) cvReleaseImage(&background);
718 background = cvCreateImage( size, depth, channels );
721 else background = cvCreateImage( size, depth, channels );
726 unsigned char * input = (
unsigned char*)Ip->imageData;
727 unsigned char * output = (
unsigned char*)background->imageData;
729 unsigned int iwidth = Ic.
getWidth();
731 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
739 *(output+3*j) = *(input+j*3);
740 *(output+3*j+1) = *(input+j*3+1);
741 *(output+3*j+2) = *(input+j*3+2);
744 input = input + 3*iwidth;
745 output = output + 3*this->
width;
753 cv::Size size((
int)this->width, (
int)this->height);
754 if(background.channels() != channels || background.depth() != depth
755 || background.rows != (int) I.
getHeight() || background.cols != (int) I.
getWidth()){
756 background = cv::Mat( size, CV_MAKETYPE(depth, channels) );
761 unsigned char * input = (
unsigned char*)Ip.data;
762 unsigned char * output = (
unsigned char*)background.data;
764 unsigned int iwidth = Ic.
getWidth();
766 output = output + (int)(iP.
get_i()*3*this->width+ iP.
get_j()*3);
774 *(output+3*j) = *(input+j*3);
775 *(output+3*j+1) = *(input+j*3+1);
776 *(output+3*j+2) = *(input+j*3+2);
779 input = input + 3*iwidth;
780 output = output + 3*this->
width;
789 "OpenCV not initialized")) ;
815 delete [] col ; col = NULL ;
817 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
825 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
826 cvDestroyWindow( this->
title_.c_str() );
828 cv::destroyWindow( this->
title_ );
831 for(
size_t i = 0 ; i < m_listTitles.size() ; i++){
832 if(
title_ == m_listTitles[i]){
833 m_listTitles.erase(m_listTitles.begin()+(
long int)i);
854 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
855 cvShowImage(this->
title_.c_str(), background );
858 cv::imshow(this->
title_, background );
866 "OpenCV not initialized")) ;
879 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
880 cvShowImage(this->
title_.c_str(), background );
883 cv::imshow(this->
title_.c_str(), background );
891 "OpenCV not initialized")) ;
901 static bool warn_displayed =
false;
902 if (! warn_displayed) {
904 warn_displayed =
true;
918 unsigned int w,
unsigned int h,
919 unsigned int thickness)
929 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon())
930 &&(std::fabs(b)<= std::numeric_limits<double>::epsilon()))
969 "OpenCV not initialized")) ;
991 #if VISP_HAVE_OPENCV_VERSION < 0x020408
992 cvPutText( background, text,
995 font, col[color.
id] );
997 cv::putText( background, text,
1000 font, fontScale, col[color.
id] );
1004 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1005 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1006 cvPutText( background, text,
1011 cv::putText( background, text,
1014 font, fontScale, cvcolor );
1022 "OpenCV not initialized")) ;
1035 unsigned int radius,
1038 unsigned int thickness)
1042 if (fill ==
false) {
1044 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1045 cvCircle( background,
1048 (int)radius, col[color.
id], (
int)thickness);
1050 cv::circle( background,
1053 (int)radius, col[color.
id], (
int)thickness);
1057 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1058 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1059 cvCircle( background,
1062 (int)radius, cvcolor, (
int)thickness);
1064 cv::circle( background,
1067 (int)radius, cvcolor, (
int)thickness);
1072 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1073 int filled = cv::FILLED;
1075 int filled = CV_FILLED;
1078 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1079 cvCircle( background,
1082 (int)radius, col[color.
id], filled);
1084 cv::circle( background,
1087 (int)radius, col[color.
id], filled);
1091 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1092 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1093 cvCircle( background,
1096 (int)radius, cvcolor, filled);
1098 cv::circle( background,
1101 (int)radius, cvcolor, filled);
1110 "OpenCV not initialized")) ;
1125 unsigned int thickness)
1153 "OpenCV not initialized")) ;
1172 unsigned int thickness)
1179 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1185 col[color.
id], (int) thickness);
1187 cv::line( background,
1192 col[color.
id], (int) thickness);
1196 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1197 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1203 cvcolor, (int) thickness);
1205 cv::line( background,
1210 cvcolor, (int) thickness);
1218 "OpenCV not initialized")) ;
1233 unsigned int thickness)
1238 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1244 col[color.
id], (int) thickness);
1246 cv::line( background,
1251 col[color.
id], (int) thickness);
1255 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1256 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1262 cvcolor, (int) thickness);
1264 cv::line( background,
1269 cvcolor, (int) thickness);
1277 "OpenCV not initialized")) ;
1325 "OpenCV not initialized")) ;
1344 unsigned int w,
unsigned int h,
1345 const vpColor &color,
bool fill,
1346 unsigned int thickness)
1350 if (fill ==
false) {
1352 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1353 cvRectangle( background,
1358 col[color.
id], (int)thickness);
1360 cv::rectangle( background,
1365 col[color.
id], (int)thickness);
1369 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1370 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1371 cvRectangle( background,
1376 cvcolor, (int)thickness);
1378 cv::rectangle( background,
1383 cvcolor, (int)thickness);
1388 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1389 int filled = cv::FILLED;
1391 int filled = CV_FILLED;
1394 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1395 cvRectangle( background,
1400 col[color.
id], filled);
1402 cv::rectangle( background,
1407 col[color.
id], filled);
1411 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1412 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1413 cvRectangle( background,
1420 cv::rectangle( background,
1434 "OpenCV not initialized")) ;
1452 const vpColor &color,
bool fill,
1453 unsigned int thickness )
1457 if (fill ==
false) {
1459 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1460 cvRectangle( background,
1465 col[color.
id], (int)thickness);
1467 cv::rectangle( background,
1472 col[color.
id], (int)thickness);
1476 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1477 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1478 cvRectangle( background,
1483 cvcolor, (int)thickness);
1485 cv::rectangle( background,
1490 cvcolor, (int)thickness);
1495 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1496 int filled = cv::FILLED;
1498 int filled = CV_FILLED;
1501 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1502 cvRectangle( background,
1507 col[color.
id], filled);
1509 cv::rectangle( background,
1514 col[color.
id], filled);
1518 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1519 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1520 cvRectangle( background,
1527 cv::rectangle( background,
1541 "OpenCV not initialized")) ;
1559 const vpColor &color,
bool fill,
1560 unsigned int thickness)
1564 if (fill ==
false) {
1566 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1567 cvRectangle( background,
1572 col[color.
id], (int)thickness);
1574 cv::rectangle( background,
1579 col[color.
id], (int)thickness);
1583 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1584 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1585 cvRectangle( background,
1590 cvcolor, (int)thickness);
1593 cv::rectangle( background,
1598 cvcolor, (int)thickness);
1604 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1605 int filled = cv::FILLED;
1607 int filled = CV_FILLED;
1610 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1611 cvRectangle( background,
1616 col[color.
id], filled);
1618 cv::rectangle( background,
1623 col[color.
id], filled);
1627 cvcolor = CV_RGB(color.
R, color.
G, color.
B) ;
1628 #if VISP_HAVE_OPENCV_VERSION < 0x020408
1629 cvRectangle( background,
1636 cv::rectangle( background,
1650 "OpenCV not initialized")) ;
1678 lbuttondown =
false;
1679 mbuttondown =
false;
1680 rbuttondown =
false;
1685 lbuttondown =
false;
1689 mbuttondown =
false;
1693 rbuttondown =
false;
1696 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1701 }
while ( ret ==
false && blocking ==
true);
1706 "OpenCV not initialized")) ;
1739 lbuttondown =
false;
1740 mbuttondown =
false;
1741 rbuttondown =
false;
1746 u = (
unsigned int)x_lbuttondown;
1747 v = (
unsigned int)y_lbuttondown;
1750 lbuttondown =
false;
1754 u = (
unsigned int)x_mbuttondown;
1755 v = (
unsigned int)y_mbuttondown;
1758 mbuttondown =
false;
1762 u = (
unsigned int)x_rbuttondown;
1763 v = (
unsigned int)y_rbuttondown;
1766 rbuttondown =
false;
1769 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1774 }
while ( ret ==
false && blocking ==
true);
1779 "OpenCV not initialized")) ;
1815 lbuttondown =
false;
1816 mbuttondown =
false;
1817 rbuttondown =
false;
1822 u = (
unsigned int)x_lbuttondown;
1823 v = (
unsigned int)y_lbuttondown;
1827 lbuttondown =
false;
1831 u = (
unsigned int)x_mbuttondown;
1832 v = (
unsigned int)y_mbuttondown;
1836 mbuttondown =
false;
1840 u = (
unsigned int)x_rbuttondown;
1841 v = (
unsigned int)y_rbuttondown;
1845 rbuttondown =
false;
1848 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1853 }
while ( ret ==
false && blocking ==
true);
1858 "OpenCV not initialized")) ;
1903 u = (
unsigned int)x_lbuttonup;
1904 v = (
unsigned int)y_lbuttonup;
1912 u = (
unsigned int)x_mbuttonup;
1913 v = (
unsigned int)y_mbuttonup;
1921 u = (
unsigned int)x_rbuttonup;
1922 v = (
unsigned int)y_rbuttonup;
1929 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1934 }
while ( ret ==
false && blocking ==
true);
1939 "OpenCV not initialized" ) ) ;
1959 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1960 case CV_EVENT_MOUSEMOVE:
1962 case cv::EVENT_MOUSEMOVE:
1970 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1971 case CV_EVENT_LBUTTONDOWN:
1973 case cv::EVENT_LBUTTONDOWN:
1976 disp->lbuttondown =
true;
1977 disp->x_lbuttondown = x;
1978 disp->y_lbuttondown = y;
1981 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1982 case CV_EVENT_MBUTTONDOWN:
1984 case cv::EVENT_MBUTTONDOWN:
1987 disp->mbuttondown =
true;
1988 disp->x_mbuttondown = x;
1989 disp->y_mbuttondown = y;
1992 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
1993 case CV_EVENT_RBUTTONDOWN:
1995 case cv::EVENT_RBUTTONDOWN:
1998 disp->rbuttondown =
true;
1999 disp->x_rbuttondown = x;
2000 disp->y_rbuttondown = y;
2003 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2004 case CV_EVENT_LBUTTONUP:
2006 case cv::EVENT_LBUTTONUP:
2009 disp->lbuttonup =
true;
2010 disp->x_lbuttonup = x;
2011 disp->y_lbuttonup = y;
2014 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2015 case CV_EVENT_MBUTTONUP:
2017 case cv::EVENT_MBUTTONUP:
2020 disp->mbuttonup =
true;
2021 disp->x_mbuttonup = x;
2022 disp->y_mbuttonup = y;
2025 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2026 case CV_EVENT_RBUTTONUP:
2028 case cv::EVENT_RBUTTONUP:
2031 disp->rbuttonup =
true;
2032 disp->x_rbuttonup = x;
2033 disp->y_rbuttonup = y;
2070 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2071 key_pressed = cvWaitKey(delay);
2073 key_pressed = cv::waitKey(delay);
2076 if (key_pressed == -1)
2083 "OpenCV not initialized")) ;
2118 #if (VISP_HAVE_OPENCV_VERSION < 0x020408)
2119 key_pressed = cvWaitKey(delay);
2121 key_pressed = cv::waitKey(delay);
2123 if (key_pressed == -1)
2127 sprintf(
string,
"%c", key_pressed);
2134 "OpenCV not initialized")) ;
2161 u = (
unsigned int)x_move;
2162 v = (
unsigned int)y_move;
2172 "OpenCV not initialized")) ;
2196 u = (
unsigned int)x_move;
2197 v = (
unsigned int)y_move;
2206 "OpenCV not initialized")) ;
2211 #elif !defined(VISP_BUILD_SHARED_LIBS)
2213 void dummy_vpDisplayOpenCV() {};
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)
Class that defines generic functionnalities for display.
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)
static void display(const vpImage< unsigned char > &I)
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