1 #include <visp/vpDisplayGDI.h>
3 #include <visp/vpDisplayOpenCV.h>
4 #include <visp/vpDisplayX.h>
5 #include <visp/vpDot2.h>
6 #include <visp/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;
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)
unsigned int getWidth() const
Display for windows using GDI (available on any windows 32 platform).
double getGrayLevelPrecision() const
Define the X11 console to display images.
error that can be emited by ViSP classes.
double getEllipsoidShapePrecision() const
static int wait(double t0, double t)
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.
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)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
void setHeight(const double &height)
unsigned int getHeight() const
virtual bool getClick(bool blocking=true)=0
static void read(vpImage< unsigned char > &I, const char *filename)
unsigned int getGrayLevelMax() const
void setGraphics(const bool activate)