1 #include <visp3/core/vpConfig.h>
2 #include <visp3/io/vpImageIo.h>
3 #include <visp3/core/vpImageConvert.h>
4 #include <visp3/core/vpImageTools.h>
5 #include <visp3/gui/vpDisplayX.h>
9 #ifdef ENABLE_VISP_NAMESPACE
24 reinterpret_cast<unsigned char *
>(H.bitmap),
25 reinterpret_cast<unsigned char *
>(S.bitmap),
26 reinterpret_cast<unsigned char *
>(V.bitmap), I.
getSize());
29 int h = 14, s = 255, v = 209;
31 int h_low = std::max<int>(0, h - offset), h_high = std::min<int>(h + offset, 255);
32 int s_low = std::max<int>(0, s - offset), s_high = std::min<int>(s + offset, 255);
33 int v_low = std::max<int>(0, v - offset), v_high = std::min<int>(v + offset, 255);
34 std::vector<int> hsv_range;
35 hsv_range.push_back(h_low);
36 hsv_range.push_back(h_high);
37 hsv_range.push_back(s_low);
38 hsv_range.push_back(s_high);
39 hsv_range.push_back(v_low);
40 hsv_range.push_back(v_high);
46 reinterpret_cast<unsigned char *
>(S.bitmap),
47 reinterpret_cast<unsigned char *
>(V.bitmap),
49 reinterpret_cast<unsigned char *
>(mask.bitmap),
56 #if defined(VISP_HAVE_X11)
57 vpDisplayX d_I(I, 0, 0,
"Current frame");
58 vpDisplayX d_mask(mask, I.
getWidth()+75, 0,
"HSV mask");
59 vpDisplayX d_I_segmented(I_segmented, 2*mask.getWidth()+80, 0,
"Segmented frame");
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
static void RGBaToHSV(const unsigned char *rgba, double *hue, double *saturation, double *value, unsigned int size)
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
unsigned int getWidth() const
unsigned int getSize() const
Type * bitmap
points toward the bitmap
unsigned int getHeight() const