5#include <visp3/core/vpConfig.h>
7#include <visp3/gui/vpDisplayFactory.h>
9#include <visp3/core/vpColor.h>
12#include <visp3/core/vpMunkres.h>
15#include <visp3/core/vpUniRand.h>
20#if ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
22#if defined(VISP_HAVE_DISPLAY)
23#ifdef ENABLE_VISP_NAMESPACE
32 std::vector<vpImagePoint> rand_ips {};
33 while (rand_ips.size() < 10) {
34 rand_ips.emplace_back(rand.
uniform(10, I.getHeight() - 10), rand.
uniform(10, I.getWidth() - 10));
40#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
49 I.display->displayCircle(ip, 5, color,
true, 1);
59 std::for_each(begin(rand_ips), end(rand_ips), std::bind(display_point, std::placeholders::_1,
vpColor::red));
64 std::vector<vpImagePoint> user_ips {};
70 user_ips.push_back(ip);
73#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY)
74 if (display !=
nullptr) {
81 std::for_each(begin(user_ips), end(user_ips), std::bind(display_point, std::placeholders::_1,
vpColor::green));
89 std::vector<std::vector<double> > cost_matrix(rand_ips.size(), std::vector<double>(user_ips.size()));
90 for (
auto i = 0u;
i < rand_ips.size();
i++) {
91 for (
auto j = 0u;
j < user_ips.size();
j++) {
99 std::for_each(begin(rand_ips), end(rand_ips), std::bind(display_point, std::placeholders::_1,
vpColor::red));
100 std::for_each(begin(user_ips), end(user_ips), std::bind(display_point, std::placeholders::_1,
vpColor::green));
104 I.display->displayLine(rand_ips.at(i), user_ips.at(j),
vpColor::blue, 1);
114 std::cout <<
"Catch an exception: " <<
e << std::endl;
117#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY)
118 if (display !=
nullptr) {
Class to define RGB colors available for display functionalities.
static const vpColor blue
static const vpColor black
static const vpColor green
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
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)
Definition of the vpImage class member functions.
static std::vector< std::pair< unsigned int, unsigned int > > run(std::vector< std::vector< Type > > costs)
Class for generating random numbers with uniform probability density.
int uniform(int a, int b)
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.