4 #include <visp3/gui/vpDisplayD3D.h> 5 #include <visp3/gui/vpDisplayGDI.h> 6 #include <visp3/gui/vpDisplayGTK.h> 7 #include <visp3/gui/vpDisplayOpenCV.h> 8 #include <visp3/gui/vpDisplayX.h> 10 #include <visp3/core/vpColor.h> 13 #include <visp3/core/vpMunkres.h> 16 #include <visp3/core/vpUniRand.h> 20 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) && \ 21 (!defined(_MSC_VER) || ( (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) && (_MSC_VER >= 1911) ) ) 23 #if defined(VISP_HAVE_DISPLAY) 30 std::vector<vpImagePoint> rand_ips{};
31 while (rand_ips.size() < 10) {
32 rand_ips.emplace_back(rand.uniform(10, I.
getHeight() - 10), rand.uniform(10, I.
getWidth() - 10));
39 #if defined(VISP_HAVE_X11) 41 #elif defined(VISP_HAVE_GDI) 43 #elif defined(VISP_HAVE_OPENCV) 45 #elif defined(VISP_HAVE_GTK) 47 #elif defined(VISP_HAVE_D3D9) 50 std::cout <<
"No image viewer is available..." << std::endl;
66 std::for_each(begin(rand_ips), end(rand_ips), std::bind(display_point, std::placeholders::_1,
vpColor::red));
71 std::vector<vpImagePoint> user_ips{};
77 user_ips.push_back(ip);
82 std::for_each(begin(user_ips), end(user_ips), std::bind(display_point, std::placeholders::_1,
vpColor::green));
90 std::vector<std::vector<double> > cost_matrix(rand_ips.size(), std::vector<double>(user_ips.size()));
91 for (
auto i = 0u; i < rand_ips.size(); i++) {
92 for (
auto j = 0u; j < user_ips.size(); j++) {
100 std::for_each(begin(rand_ips), end(rand_ips), std::bind(display_point, std::placeholders::_1,
vpColor::red));
101 std::for_each(begin(user_ips), end(user_ips), std::bind(display_point, std::placeholders::_1,
vpColor::green));
114 std::cout <<
"Catch an exception: " << e << std::endl;
116 #endif // defined(VISP_HAVE_DISPLAY)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static const vpColor black
Display for windows using GDI (available on any windows 32 platform).
Class to define RGB colors available for display functionnalities.
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
error that can be emited by ViSP classes.
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed...
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
static std::vector< std::pair< unsigned int, unsigned int > > run(std::vector< std::vector< Type > > costs)
static void displayCircle(const vpImage< unsigned char > &I, const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
unsigned int getHeight() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class for generating random numbers with uniform probability density.
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
unsigned int getWidth() const
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 const vpColor blue