 |
Visual Servoing Platform
version 3.3.0
|
1 #include <visp3/blob/vpDot2.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/gui/vpDisplayOpenCV.h>
5 #include <visp3/gui/vpDisplayX.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);
101 std::cout <<
"Catch an exception: " << e << std::endl;
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
VISP_EXPORT int wait(double t0, double t)
void setGraphicsThickness(unsigned int t)
static void read(vpImage< unsigned char > &I, const std::string &filename)
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)
Display for windows using GDI (available on any windows 32 platform).
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
unsigned int getHeight() const
double getSizePrecision() const
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
unsigned int getWidth() const
static void display(const vpImage< unsigned char > &I)
void setSizePrecision(const double &sizePrecision)
void setHeight(const double &height)
void setGrayLevelPrecision(const double &grayLevelPrecision)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
double getEllipsoidShapePrecision() const
unsigned int getGrayLevelMin() const
void setArea(const double &area)
void setGrayLevelMax(const unsigned int &max)
static void flush(const vpImage< unsigned char > &I)
void setGrayLevelMin(const unsigned int &min)
void track(const vpImage< unsigned char > &I, bool canMakeTheWindowGrow=true)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
double getGrayLevelPrecision() const
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getGrayLevelMax() const
void setWidth(const double &width)
error that can be emited by ViSP classes.
void setGraphics(bool activate)