1 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/blob/vpDot2.h>
6 #include <visp3/io/vpImageIo.h>
16 #if defined(VISP_HAVE_X11)
18 #elif defined(VISP_HAVE_GDI)
20 #elif defined(VISP_HAVE_OPENCV)
23 std::cout <<
"No image viewer is available..." << std::endl;
38 std::cout <<
"Blob characteristics: " << std::endl;
39 std::cout <<
" width : " << blob.
getWidth() << std::endl;
40 std::cout <<
" height: " << blob.
getHeight() << std::endl;
41 #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0)
42 std::cout <<
" area: " << blob.
getArea() << std::endl;
44 std::cout <<
" gray level min: " << blob.
getGrayLevelMin() << std::endl;
45 std::cout <<
" gray level max: " << blob.
getGrayLevelMax() << std::endl;
56 #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0)
68 std::list<vpDot2> blob_list;
76 blob_list.push_back(blob);
79 std::cout <<
"Number of auto detected blob: " << blob_list.size() << std::endl;
80 std::cout <<
"A click to exit..." << std::endl;
86 for(std::list<vpDot2>::iterator it=blob_list.begin(); it != blob_list.end(); ++it) {
87 (*it).setGraphics(
true);
88 (*it).setGraphicsThickness(3);
102 std::cout <<
"Catch an exception: " << e << std::endl;
VISP_EXPORT int wait(double t0, double t)
void setGrayLevelMax(const unsigned int &max)
void searchDotsInArea(const vpImage< unsigned char > &I, int area_u, int area_v, unsigned int area_w, unsigned int area_h, std::list< vpDot2 > &niceDots)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getWidth() const
Display for windows using GDI (available on any windows 32 platform).
double getGrayLevelPrecision() const
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.
double getEllipsoidShapePrecision() const
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
double getSizePrecision() const
void setGraphicsThickness(unsigned int t)
void setGrayLevelPrecision(const double &grayLevelPrecision)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
unsigned int getGrayLevelMin() const
void setArea(const double &area)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
void setGrayLevelMin(const unsigned int &min)
void setWidth(const double &width)
void setSizePrecision(const double &sizePrecision)
static void read(vpImage< unsigned char > &I, const std::string &filename)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
void setHeight(const double &height)
unsigned int getHeight() const
unsigned int getGrayLevelMax() const
void setGraphics(const bool activate)