49 const std::string& windowCaption = std::string(),
50 unsigned int initWidth = 400,
unsigned int initHeight = 400);
54 const std::string& windowCaption,
unsigned int initWidth = 400,
55 unsigned int initHeight = 400);
77 bool showNumbers =
false);
81 const std::vector<float>& y,
83 bool showNumbers =
false);
91 template <
class FEATURELIST>
109 template <
class FEATURELIST>
119 unsigned int w = imgColor.
getWidth();
121 imgColor.
line(0, h / 2, w - 1, h / 2, TColor::green());
122 imgColor.
line(w / 4, 0, w / 4, h, TColor::green());
123 imgColor.
line(w / 2, 0, w / 2, h, TColor::green());
124 imgColor.
line(3 * w / 4, 0, 3 * w / 4, h, TColor::green());
138 template <
class MATCHEDLIST>
141 const MATCHEDLIST& mList,
143 bool showNumbers =
false)
155 for (
typename MATCHEDLIST::const_iterator i = mList.begin();
156 i != mList.end(); ++i, ++nf)
158 const auto x1 =
round(i->first.keypoint.pt.x);
159 const auto y1 =
round(i->first.keypoint.pt.y);
160 const auto x2 =
round(i->second.keypoint.pt.x);
161 const auto y2 =
round(i->second.keypoint.pt.y);
163 imgColor.drawCircle(x1, y1, 4, color);
164 imgColor.drawCircle(x2 + w, y2, 4, color);
170 buf, 15,
"%d[%u]", nf, (
unsigned int)i->first.keypoint.ID);
171 imgColor.textOut(x1 - 10, y1, buf, color);
173 buf, 15,
"%d[%u]", nf, (
unsigned int)i->second.keypoint.ID);
174 imgColor.textOut(x2 + w + 10, y2, buf, color);
187 template <
class FEATURELIST>
190 const FEATURELIST& leftList,
const FEATURELIST& rightList,
198 ASSERT_(leftList.size() == rightList.size());
199 imgColor.joinImagesHorz(img1, img2);
203 for (
typename FEATURELIST::const_iterator iL = leftList.begin(),
204 iR = rightList.begin();
205 iL != leftList.end(); ++iL, ++iR)
207 imgColor.drawCircle(
round((*iL)->x),
round((*iL)->y), 4, color);
208 imgColor.drawCircle(
round((*iR)->x + w),
round((*iR)->y), 4, color);
211 round((*iR)->y), color);
234 void resize(
unsigned int width,
unsigned int height)
override;
238 void setPos(
int x,
int y)
override;
void line(int x0, int y0, int x1, int y1, const mrpt::img::TColor color, unsigned int width=1, TPenStyle penStyle=psSolid) override
Draws a line.
bool m_enableCursorCoordinates
Enables or disables the visualization of cursor coordinates on the window caption.
Template for column vectors of dynamic size, compatible with Eigen.
void setCursorCross(bool cursorIsCross) override
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true) ...
void showImagesAndMatchedPoints(const mrpt::img::CImage &img1, const mrpt::img::CImage &img2, const MATCHEDLIST &mList, const mrpt::img::TColor &color=mrpt::img::TColor::red(), bool showNumbers=false)
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
~CDisplayWindow() override
Destructor.
size_t getHeight() const override
Returns the height of the image in pixels.
void enableCursorCoordinatesVisualization(bool enable)
Enables or disables the visualization of cursor coordinates on the window caption (default = enabled)...
void joinImagesHorz(const CImage &im1, const CImage &im2)
Joins two images side-by-side horizontally.
void setWindowTitle(const std::string &str) override
Changes the window title text.
void plot(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y)
Plots a graph in MATLAB-like style.
CImage colorImage() const
Returns a color (RGB) version of the grayscale image, or a shallow copy of itself if it is already a ...
#define ASSERT_(f)
Defines an assertion mechanism.
size_t getWidth() const override
Returns the width of the image in pixels.
void showImageAndPoints(const mrpt::img::CImage &img, const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const mrpt::img::TColor &color=mrpt::img::TColor::red(), bool showNumbers=false)
Show a given color or grayscale image on the window and print a set of points on it.
bool getLastMousePosition(int &x, int &y) const override
Gets the last x,y pixel coordinates of the mouse.
This class creates a window as a graphical user interface (GUI) for displaying images to the user...
void resize(unsigned int width, unsigned int height) override
Resizes the window, stretching the image to fit into the display area.
void showImagesAndMatchedPoints(const mrpt::img::CImage &img1, const mrpt::img::CImage &img2, const FEATURELIST &leftList, const FEATURELIST &rightList, const mrpt::img::TColor &color=mrpt::img::TColor::red())
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
void setPos(int x, int y) override
Changes the position of the window on the screen.
void showImageAndPoints(const mrpt::img::CImage &img, const FEATURELIST &list, const mrpt::img::TColor &color=mrpt::img::TColor::red(), bool showIDs=false)
Show a given color or grayscale image on the window and print a set of points on it.
static constexpr TColor red()
Predefined colors.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void drawFeatures(const FEATURELIST &list, const TColor &color=TColor::red(), const bool showIDs=false, const bool showResponse=false, const bool showScale=false, const char marker='+')
Draws a set of marks (or scaled circles for features with scale) onto the image, given a generic cont...
void showImage(const mrpt::img::CImage &img)
Show a given color or grayscale image on the window.
CDisplayWindow(const std::string &windowCaption=std::string(), unsigned int initWidth=400, unsigned int initHeight=400)
Constructor.
static CDisplayWindow::Ptr Create(const std::string &windowCaption, unsigned int initWidth=400, unsigned int initHeight=400)
Class factory returning a smart pointer.
The base class for GUI window classes based on wxWidgets.
void showTiledImageAndPoints(const mrpt::img::CImage &img, const FEATURELIST &list, const mrpt::img::TColor &color=mrpt::img::TColor::red())
Show a given color or grayscale image on the window and print a set of points on it and a set of line...
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
A class for storing images as grayscale or RGB bitmaps.
int round(const T value)
Returns the closer integer (int) to x.