1 #include <visp3/core/vpConfig.h>
3 #include <visp3/blob/vpDot2.h>
4 #include <visp3/gui/vpDisplayFactory.h>
5 #include <visp3/io/vpImageIo.h>
9 #ifdef ENABLE_VISP_NAMESPACE
13 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
14 std::shared_ptr<vpDisplay> display;
25 #if defined(VISP_HAVE_DISPLAY)
26 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
32 std::cout <<
"No image viewer is available..." << std::endl;
47 std::cout <<
"Blob characteristics: " << std::endl;
48 std::cout <<
" width : " << blob.
getWidth() << std::endl;
49 std::cout <<
" height: " << blob.
getHeight() << std::endl;
50 #if VISP_VERSION_INT > VP_VERSION_INT(2, 7, 0)
51 std::cout <<
" area: " << blob.
getArea() << std::endl;
53 std::cout <<
" gray level min: " << blob.
getGrayLevelMin() << std::endl;
54 std::cout <<
" gray level max: " << blob.
getGrayLevelMax() << std::endl;
65 #if VISP_VERSION_INT > VP_VERSION_INT(2, 7, 0)
77 std::list<vpDot2> blob_list;
85 blob_list.push_back(blob);
88 std::cout <<
"Number of auto detected blob: " << blob_list.size() << std::endl;
89 std::cout <<
"A click to exit..." << std::endl;
95 for (std::list<vpDot2>::iterator it = blob_list.begin(); it != blob_list.end(); ++it) {
96 (*it).setGraphics(
true);
97 (*it).setGraphicsThickness(3);
111 std::cout <<
"Catch an exception: " << e << std::endl;
113 #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
114 if (display !=
nullptr) {
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 flush(const vpImage< unsigned char > &I)
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
unsigned int getGrayLevelMin() const
unsigned int getGrayLevelMax() const
void track(const vpImage< unsigned char > &I, bool canMakeTheWindowGrow=true)
void setGraphics(bool activate)
void setGraphicsThickness(unsigned int thickness)
double getEllipsoidShapePrecision() const
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)
void setGrayLevelMax(const unsigned int &max)
void setSizePrecision(const double &sizePrecision)
void setGrayLevelPrecision(const double &grayLevelPrecision)
void setGrayLevelMin(const unsigned int &min)
void setHeight(const double &height)
double getSizePrecision() const
double getGrayLevelPrecision() const
void setWidth(const double &width)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
void setArea(const double &area)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
error that can be emitted by ViSP classes.
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
unsigned int getWidth() const
unsigned int getHeight() const
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.
VISP_EXPORT int wait(double t0, double t)