40 #include <visp3/core/vpConfig.h>
42 #if defined(HAVE_OPENCV_HIGHGUI)
51 #include <visp3/core/vpDisplay.h>
52 #include <visp3/core/vpImageTools.h>
53 #include <visp3/core/vpIoTools.h>
54 #include <visp3/core/vpMath.h>
55 #include <visp3/gui/vpDisplayOpenCV.h>
58 #include <visp3/core/vpDisplayException.h>
60 #include <opencv2/core/core_c.h>
62 #if defined(HAVE_OPENCV_IMGPROC)
63 #include <opencv2/imgproc/imgproc.hpp>
67 #define CV_RGB(r, g, b) cv::Scalar((b), (g), (r), 0)
71 #include <visp3/gui/vpDisplayX.h>
78 std::vector<std::string> vpDisplayOpenCV::m_listTitles = std::vector<std::string>();
79 unsigned int vpDisplayOpenCV::m_nbWindows = 0;
104 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
105 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
106 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
107 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
108 y_rbuttonup(0), rbuttonup(false)
140 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
141 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
142 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
143 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
144 y_rbuttonup(0), rbuttonup(false)
147 init(I, x, y, title);
170 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
171 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
172 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
173 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
174 y_rbuttonup(0), rbuttonup(false)
202 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
203 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
204 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
205 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
206 y_rbuttonup(0), rbuttonup(false)
209 init(I, x, y, title);
240 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
241 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
242 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
243 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
244 y_rbuttonup(0), rbuttonup(false)
249 if (!title.empty()) {
253 std::ostringstream s;
255 m_title = std::string(
"Window ") + s.str();
261 for (
size_t i = 0; i < m_listTitles.size(); i++) {
262 if (m_listTitles[i] ==
m_title) {
263 std::ostringstream s;
265 m_title = std::string(
"Window ") + s.str();
272 m_listTitles.push_back(
m_title);
300 m_background(), col(nullptr), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f),
301 fontHeight(10), x_move(0), y_move(0), move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false),
302 x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false),
303 x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), x_rbuttonup(0),
304 y_rbuttonup(0), rbuttonup(false)
378 int flags = cv::WINDOW_AUTOSIZE;
381 if (!title.empty()) {
386 std::ostringstream s;
388 m_title = std::string(
"Window ") + s.str();
394 for (
size_t i = 0; i < m_listTitles.size(); i++) {
395 if (m_listTitles[i] ==
m_title) {
396 std::ostringstream s;
398 m_title = std::string(
"Window ") + s.str();
405 m_listTitles.push_back(
m_title);
409 cv::namedWindow(this->
m_title, flags);
410 cv::moveWindow(this->
m_title.c_str(), this->m_windowXPosition, this->m_windowYPosition);
465 fontSize = cv::getTextSize(
"A", font, fontScale, thickness, &baseline);
467 fontHeight = fontSize.height + baseline;
517 cv::moveWindow(this->
m_title.c_str(), winx, winy);
540 if (m_background.channels() != channels || m_background.depth() != depth || m_background.rows != (
int)
m_height ||
541 m_background.cols != (
int)
m_width) {
542 m_background = cv::Mat(size, CV_MAKETYPE(depth, channels));
546 for (
unsigned int i = 0; i <
m_height; i++) {
547 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width);
548 for (
unsigned int j = 0; j <
m_width; j++) {
549 unsigned char val = I[i][j];
557 for (
unsigned int i = 0; i <
m_height; i++) {
558 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width);
559 for (
unsigned int j = 0; j <
m_width; j++) {
595 if (m_background.channels() != channels || m_background.depth() != depth || m_background.rows != (
int)
m_height ||
596 m_background.cols != (
int)
m_width) {
597 m_background = cv::Mat(size, CV_MAKETYPE(depth, channels));
601 unsigned int i_min = (
unsigned int)iP.
get_i();
602 unsigned int j_min = (
unsigned int)iP.
get_j();
603 unsigned int i_max = std::min<unsigned int>(i_min + h,
m_height);
604 unsigned int j_max = std::min<unsigned int>(j_min + w,
m_width);
605 for (
unsigned int i = i_min; i < i_max; i++) {
606 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width + j_min * 3);
607 for (
unsigned int j = j_min; j < j_max; j++) {
608 unsigned char val = I[i][j];
616 int i_min = std::max<int>((
int)ceil(iP.
get_i() /
m_scale), 0);
617 int j_min = std::max<int>((
int)ceil(iP.
get_j() /
m_scale), 0);
620 for (
int i = i_min; i < i_max; i++) {
621 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width + j_min * 3);
622 for (
int j = j_min; j < j_max; j++) {
654 if (m_background.channels() != channels || m_background.depth() != depth || m_background.rows != (
int)
m_height ||
655 m_background.cols != (
int)
m_width) {
656 m_background = cv::Mat(size, CV_MAKETYPE(depth, channels));
660 for (
unsigned int i = 0; i <
m_height; i++) {
661 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width);
662 for (
unsigned int j = 0; j <
m_width; j++) {
671 for (
unsigned int i = 0; i <
m_height; i++) {
672 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width);
673 for (
unsigned int j = 0; j <
m_width; j++) {
708 if (m_background.channels() != channels || m_background.depth() != depth || m_background.rows != (
int)
m_height ||
709 m_background.cols != (
int)
m_width) {
710 m_background = cv::Mat(size, CV_MAKETYPE(depth, channels));
714 unsigned int i_min = (
unsigned int)iP.
get_i();
715 unsigned int j_min = (
unsigned int)iP.
get_j();
716 unsigned int i_max = std::min<unsigned int>(i_min + h,
m_height);
717 unsigned int j_max = std::min<unsigned int>(j_min + w,
m_width);
718 for (
unsigned int i = i_min; i < i_max; i++) {
719 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width + j_min * 3);
720 for (
unsigned int j = j_min; j < j_max; j++) {
729 int i_min = std::max<int>((
int)ceil(iP.
get_i() /
m_scale), 0);
730 int j_min = std::max<int>((
int)ceil(iP.
get_j() /
m_scale), 0);
733 for (
int i = i_min; i < i_max; i++) {
734 unsigned char *dst_24 = (
unsigned char *)m_background.data + (
int)(i * 3 *
m_width + j_min * 3);
735 for (
int j = j_min; j < j_max; j++) {
768 if (col !=
nullptr) {
773 cv::destroyWindow(this->
m_title);
774 for (
size_t i = 0; i < m_listTitles.size(); i++) {
775 if (
m_title == m_listTitles[i]) {
776 m_listTitles.erase(m_listTitles.begin() + (
long int)i);
795 cv::imshow(this->
m_title, m_background);
812 cv::imshow(this->
m_title.c_str(), m_background);
836 unsigned int w,
unsigned int h,
unsigned int thickness)
844 if ((std::fabs(a) <= std::numeric_limits<double>::epsilon()) &&
845 (std::fabs(b) <= std::numeric_limits<double>::epsilon())) {
892 cv::putText(m_background, text,
894 font, fontScale, col[color.
id]);
897 cvcolor = CV_RGB(color.
R, color.
G, color.
B);
898 cv::putText(m_background, text,
900 font, fontScale, cvcolor);
920 unsigned int thickness)
925 int r =
static_cast<int>(radius /
m_scale);
928 cv_color = col[color.
id];
931 cv_color = CV_RGB(color.
R, color.
G, color.
B);
935 int cv_thickness =
static_cast<int>(thickness);
936 cv::circle(m_background, cv::Point(x, y), r, cv_color, cv_thickness);
939 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
940 int filled = cv::FILLED;
942 int filled = CV_FILLED;
944 double opacity =
static_cast<double>(color.
A) / 255.0;
945 overlay([x, y, r, cv_color, filled](cv::Mat image) { cv::circle(image, cv::Point(x, y), r, cv_color, filled); },
962 unsigned int thickness)
990 unsigned int thickness)
998 bool vertical_line = (int)ip2_.
get_j() == (int)ip1_.
get_j();
1001 std::swap(ip1_, ip2_);
1005 std::swap(ip1_, ip2_);
1008 double diff_j = vertical_line ? 1 : ip2_.
get_j() - ip1_.
get_j();
1009 double deltaj = size / length * diff_j;
1010 double deltai = size / length * (ip2_.
get_i() - ip1_.
get_i());
1011 double slope = (ip2_.
get_i() - ip1_.
get_i()) / diff_j;
1012 double orig = ip1_.
get_i() - slope * ip1_.
get_j();
1014 if (vertical_line) {
1015 for (
unsigned int i = (
unsigned int)ip1_.
get_i(); i < ip2_.
get_i(); i += (
unsigned int)(2 * deltai)) {
1016 double j = ip1_.
get_j();
1021 for (
unsigned int j = (
unsigned int)ip1_.
get_j(); j < ip2_.
get_j(); j += (
unsigned int)(2 * deltaj)) {
1022 double i = slope * j + orig;
1039 unsigned int thickness)
1048 cvcolor = CV_RGB(color.
R, color.
G, color.
B);
1068 for (
unsigned int i = 0; i < thickness; i++) {
1072 col[color.
id], (
int)thickness);
1075 cvcolor = CV_RGB(color.
R, color.
G, color.
B);
1078 cvcolor, (
int)thickness);
1103 const vpColor &color,
bool fill,
unsigned int thickness)
1110 cv::Scalar cv_color;
1112 cv_color = col[color.
id];
1115 cv_color = CV_RGB(color.
R, color.
G, color.
B);
1118 if (fill ==
false) {
1119 int cv_thickness =
static_cast<int>(thickness);
1120 cv::rectangle(m_background, cv::Point(left, top), cv::Point(right, bottom), cv_color, cv_thickness);
1123 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1124 int filled = cv::FILLED;
1126 int filled = CV_FILLED;
1128 double opacity =
static_cast<double>(color.
A) / 255.0;
1129 overlay([left, top, right, bottom, cv_color, filled](cv::Mat image) {
1130 cv::rectangle(image, cv::Point(left, top), cv::Point(right, bottom), cv_color, filled);
1154 const vpColor &color,
bool fill,
unsigned int thickness)
1161 cv::Scalar cv_color;
1163 cv_color = col[color.
id];
1166 cv_color = CV_RGB(color.
R, color.
G, color.
B);
1169 if (fill ==
false) {
1170 int cv_thickness =
static_cast<int>(thickness);
1171 cv::rectangle(m_background, cv::Point(left, top), cv::Point(right, bottom), cv_color, cv_thickness);
1174 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1175 int filled = cv::FILLED;
1177 int filled = CV_FILLED;
1179 double opacity =
static_cast<double>(color.
A) / 255.0;
1180 overlay([left, top, right, bottom, cv_color, filled](cv::Mat image) {
1181 cv::rectangle(image, cv::Point(left, top), cv::Point(right, bottom), cv_color, filled);
1211 cv::Scalar cv_color;
1213 cv_color = col[color.
id];
1216 cv_color = CV_RGB(color.
R, color.
G, color.
B);
1219 if (fill ==
false) {
1220 int cv_thickness =
static_cast<int>(thickness);
1221 cv::rectangle(m_background, cv::Point(left, top), cv::Point(right, bottom), cv_color, cv_thickness);
1224 #if VISP_HAVE_OPENCV_VERSION >= 0x030000
1225 int filled = cv::FILLED;
1227 int filled = CV_FILLED;
1229 double opacity =
static_cast<double>(color.
A) / 255.0;
1230 overlay([left, top, right, bottom, cv_color, filled](cv::Mat image) {
1231 cv::rectangle(image, cv::Point(left, top), cv::Point(right, bottom), cv_color, filled);
1262 lbuttondown =
false;
1263 mbuttondown =
false;
1264 rbuttondown =
false;
1269 lbuttondown =
false;
1273 mbuttondown =
false;
1277 rbuttondown =
false;
1282 }
while (ret ==
false && blocking ==
true);
1315 lbuttondown =
false;
1316 mbuttondown =
false;
1317 rbuttondown =
false;
1322 u = (
unsigned int)x_lbuttondown *
m_scale;
1323 v = (
unsigned int)y_lbuttondown *
m_scale;
1326 lbuttondown =
false;
1330 u = (
unsigned int)x_mbuttondown *
m_scale;
1331 v = (
unsigned int)y_mbuttondown *
m_scale;
1334 mbuttondown =
false;
1338 u = (
unsigned int)x_rbuttondown *
m_scale;
1339 v = (
unsigned int)y_rbuttondown *
m_scale;
1342 rbuttondown =
false;
1347 }
while (ret ==
false && blocking ==
true);
1381 lbuttondown =
false;
1382 mbuttondown =
false;
1383 rbuttondown =
false;
1388 u = (
unsigned int)x_lbuttondown *
m_scale;
1389 v = (
unsigned int)y_lbuttondown *
m_scale;
1393 lbuttondown =
false;
1397 u = (
unsigned int)x_mbuttondown *
m_scale;
1398 v = (
unsigned int)y_mbuttondown *
m_scale;
1402 mbuttondown =
false;
1406 u = (
unsigned int)x_rbuttondown *
m_scale;
1407 v = (
unsigned int)y_rbuttondown *
m_scale;
1411 rbuttondown =
false;
1416 }
while (ret ==
false && blocking ==
true);
1459 u = (
unsigned int)x_lbuttonup *
m_scale;
1460 v = (
unsigned int)y_lbuttonup *
m_scale;
1468 u = (
unsigned int)x_mbuttonup *
m_scale;
1469 v = (
unsigned int)y_mbuttonup *
m_scale;
1477 u = (
unsigned int)x_rbuttonup *
m_scale;
1478 v = (
unsigned int)y_rbuttonup *
m_scale;
1487 }
while (ret ==
false && blocking ==
true);
1509 case cv::EVENT_MOUSEMOVE:
1516 case cv::EVENT_LBUTTONDOWN:
1518 disp->lbuttondown =
true;
1519 disp->x_lbuttondown = x;
1520 disp->y_lbuttondown = y;
1523 case cv::EVENT_MBUTTONDOWN:
1525 disp->mbuttondown =
true;
1526 disp->x_mbuttondown = x;
1527 disp->y_mbuttondown = y;
1530 case cv::EVENT_RBUTTONDOWN:
1532 disp->rbuttondown =
true;
1533 disp->x_rbuttondown = x;
1534 disp->y_rbuttondown = y;
1537 case cv::EVENT_LBUTTONUP:
1539 disp->lbuttonup =
true;
1540 disp->x_lbuttonup = x;
1541 disp->y_lbuttonup = y;
1544 case cv::EVENT_MBUTTONUP:
1546 disp->mbuttonup =
true;
1547 disp->x_mbuttonup = x;
1548 disp->y_mbuttonup = y;
1551 case cv::EVENT_RBUTTONUP:
1553 disp->rbuttonup =
true;
1554 disp->x_rbuttonup = x;
1555 disp->y_rbuttonup = y;
1589 int key_pressed = cv::waitKey(delay);
1591 if (key_pressed == -1)
1628 int key_pressed = cv::waitKey(delay);
1629 if (key_pressed == -1)
1633 std::stringstream ss;
1663 double u = (
unsigned int)x_move /
m_scale;
1664 double v = (
unsigned int)y_move /
m_scale;
1693 u = (
unsigned int)x_move /
m_scale;
1694 v = (
unsigned int)y_move /
m_scale;
1713 #if defined(VISP_HAVE_X11)
1716 #elif defined(VISP_HAVE_XRANDR)
1717 std::string command =
"xrandr | grep '*'";
1718 FILE *fpipe = (FILE *)popen(command.c_str(),
"r");
1720 while (fgets(line,
sizeof(line), fpipe)) {
1721 std::string str(line);
1722 std::size_t found = str.find(
"Failed");
1724 if (found == std::string::npos) {
1725 std::vector<std::string> elm;
1727 for (
size_t i = 0; i < elm.size(); i++) {
1728 if (!elm[i].empty()) {
1730 if (resolution.size() == 2) {
1731 std::istringstream sswidth(resolution[0]), ssheight(resolution[1]);
1741 #elif defined(_WIN32)
1743 w = GetSystemMetrics(SM_CXSCREEN);
1744 h = GetSystemMetrics(SM_CYSCREEN);
1747 "implemented on winrt"));
1757 unsigned int width, height;
1767 unsigned int width, height;
1781 if (opacity < 1.0) {
1783 overlay = m_background.clone();
1793 if (opacity < 1.0) {
1794 cv::addWeighted(
overlay, opacity, m_background, 1.0 - opacity, 0.0, m_background);
1800 #elif !defined(VISP_BUILD_SHARED_LIBS)
1802 void dummy_vpDisplayOpenCV() { };
Class to define RGB colors available for display functionalities.
static const vpColor white
static const vpColor darkGray
static const vpColor cyan
static const vpColor orange
static const vpColor darkRed
static const vpColor blue
static const vpColor lightGray
static const vpColor lightBlue
static const vpColor darkGreen
static const vpColor darkBlue
static const vpColor purple
static const vpColor lightGreen
static const vpColor yellow
static const vpColor lightRed
static const vpColor black
static const vpColor green
static const vpColor gray
Error that can be emitted by the vpDisplay class and its derivatives.
@ notInitializedError
Display not initialized.
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void displayRectangle(const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1) VP_OVERRIDE
void overlay(std::function< void(cv::Mat &)> overlay_function, double opacity)
void flushDisplayROI(const vpImagePoint &iP, unsigned int width, unsigned int height) VP_OVERRIDE
virtual ~vpDisplayOpenCV() VP_OVERRIDE
bool getKeyboardEvent(bool blocking=true) VP_OVERRIDE
void displayPoint(const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1) VP_OVERRIDE
void setFont(const std::string &font) VP_OVERRIDE
void getImage(vpImage< vpRGBa > &I) VP_OVERRIDE
Get the window pixmap and put it in vpRGBa image.
void flushDisplay() VP_OVERRIDE
void getScreenSize(unsigned int &width, unsigned int &height) VP_OVERRIDE
void clearDisplay(const vpColor &color=vpColor::white) VP_OVERRIDE
bool getPointerMotionEvent(vpImagePoint &ip) VP_OVERRIDE
void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1) VP_OVERRIDE
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) VP_OVERRIDE
unsigned int getScreenWidth() VP_OVERRIDE
void setTitle(const std::string &title) VP_OVERRIDE
void setWindowPosition(int winx, int winy) VP_OVERRIDE
void displayCircle(const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1) VP_OVERRIDE
void closeDisplay() VP_OVERRIDE
void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1) VP_OVERRIDE
void displayImage(const vpImage< unsigned char > &I) VP_OVERRIDE
bool getPointerPosition(vpImagePoint &ip) VP_OVERRIDE
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="") VP_OVERRIDE
void displayText(const vpImagePoint &ip, const std::string &text, const vpColor &color=vpColor::green) VP_OVERRIDE
bool getClickUp(vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true) VP_OVERRIDE
bool getClick(bool blocking=true) VP_OVERRIDE
static void on_mouse(int event, int x, int y, int flags, void *param)
void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1) VP_OVERRIDE
unsigned int getScreenHeight() VP_OVERRIDE
void displayImageROI(const vpImage< unsigned char > &I, const vpImagePoint &iP, unsigned int width, unsigned int height) VP_OVERRIDE
void getScreenSize(unsigned int &width, unsigned int &height) VP_OVERRIDE
Class that defines generic functionalities for display.
static void display(const vpImage< unsigned char > &I)
int m_windowXPosition
display position
int m_windowYPosition
display position
bool m_displayHasBeenInitialized
display has been initialized
void setScale(vpScaleType scaleType, unsigned int width, unsigned int height)
error that can be emitted by ViSP classes.
@ functionNotImplementedError
Function not implemented.
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
unsigned int getWidth() const
unsigned int getHeight() const
static double sqr(double x)
static int round(double x)
unsigned char B
Blue component.
unsigned char R
Red component.
unsigned char G
Green component.
unsigned char A
Additionnal component.
Defines a rectangle in the plane.