42 #include <visp3/core/vpColor.h>
43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpImage.h>
45 #include <visp3/core/vpImagePoint.h>
46 #include <visp3/core/vpPolygon.h>
47 #include <visp3/core/vpRect.h>
48 #include <visp3/core/vpTracker.h>
148 const unsigned int index_0 = 0;
149 const unsigned int index_1 = 1;
150 const unsigned int index_2 = 2;
152 nij[index_0] = mu20 / m00;
153 nij[index_1] = mu11 / m00;
154 nij[index_2] = mu02 / m00;
159 double getArea()
const;
170 bbox.
setRect(m_bbox_u_min, m_bbox_v_min, (m_bbox_u_max - m_bbox_u_min) + 1,
171 (m_bbox_v_max - m_bbox_v_min) + 1);
183 double getDistance(
const vpDot2 &distantDot)
const;
191 void getEdges(std::list<vpImagePoint> &edges_list)
const { edges_list = m_ip_edges_list; };
200 std::list<vpImagePoint>
getEdges()
const {
return m_ip_edges_list; };
210 double getEllipsoidShapePrecision()
const;
211 void getFreemanChain(std::list<unsigned int> &freeman_chain)
const;
213 inline double getGamma()
const {
return m_gamma; };
226 double getGrayLevelPrecision()
const;
228 double getHeight()
const;
229 double getMaxSizeSearchDistPrecision()
const;
240 double getSizePrecision()
const;
241 double getWidth()
const;
246 unsigned int gray_lvl_max,
unsigned int size = 0);
249 friend VISP_EXPORT std::ostream &operator<<(std::ostream &os,
vpDot2 &d);
251 void print(std::ostream &os) { os << *
this << std::endl; }
253 unsigned int area_h, std::list<vpDot2> &niceDots);
257 void setArea(
const double &area);
292 if (percentage < 0.) {
293 m_allowedBadPointsPercentage = 0.;
295 else if (percentage > 1.) {
296 m_allowedBadPointsPercentage = 1.;
299 m_allowedBadPointsPercentage = percentage;
303 void setEllipsoidShapePrecision(
const double &ellipsoidShapePrecision);
340 const unsigned int val_max = 255;
342 m_gray_level_min = val_max;
345 m_gray_level_min = min;
359 const unsigned int val_max = 255;
361 m_gray_level_max = val_max;
364 m_gray_level_max = max;
368 void setGrayLevelPrecision(
const double &grayLevelPrecision);
369 void setHeight(
const double &height);
370 void setMaxSizeSearchDistPrecision(
const double &maxSizeSearchDistancePrecision);
371 void setSizePrecision(
const double &sizePrecision);
372 void setWidth(
const double &width);
378 std::vector<vpImagePoint> &cogs,
vpImagePoint *cogStar =
nullptr);
383 unsigned int thickness = 1);
387 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
460 virtual bool hasGoodLevel(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v)
const;
461 virtual bool hasReverseLevel(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v)
const;
463 virtual vpDot2 *getInstance();
470 unsigned int &border_u,
unsigned int &border_v);
479 unsigned int getFirstBorder_u()
const {
return m_firstBorder_u; }
487 unsigned int getFirstBorder_v()
const {
return m_firstBorder_v; }
489 bool computeFreemanChainElement(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v,
490 unsigned int &element);
491 void computeFreemanParameters(
const int &u_p,
const int &v_p,
unsigned int &element,
int &du,
int &dv,
float &dS,
492 float &dMu,
float &dMv,
float &dMuv,
float &dMu2,
float &dMv2);
493 void updateFreemanPosition(
unsigned int &u,
unsigned int &v,
const unsigned int &dir);
498 bool isInArea(
const unsigned int &u,
const unsigned int &v)
const;
500 void getGridSize(
unsigned int &gridWidth,
unsigned int &gridHeight);
503 void setArea(
const vpRect &a);
507 typedef struct vpSearchDotsInAreaGoodGermData
513 std::list<vpDot2> &m_niceDots;
514 std::list<vpDot2> &m_badDotsVector;
517 unsigned int &u,
unsigned int &v,
518 std::list<vpDot2> &niceDots, std::list<vpDot2> &badDotsVector)
523 , m_niceDots(niceDots)
524 , m_badDotsVector(badDotsVector)
528 } vpSearchDotsInAreaGoodGermData;
530 void searchDotsAreaGoodGerm(vpSearchDotsInAreaGoodGermData &data);
537 unsigned int m_gray_level_min;
539 unsigned int m_gray_level_max;
540 double m_mean_gray_level;
541 double m_grayLevelPrecision;
543 double m_sizePrecision;
544 double m_ellipsoidShapePrecision;
545 double m_maxSizeSearchDistPrecision;
546 double m_allowedBadPointsPercentage;
551 std::list<unsigned int> m_direction_list;
552 std::list<vpImagePoint> m_ip_edges_list;
555 bool m_compute_moment;
558 unsigned int m_thickness;
561 int m_bbox_u_min, m_bbox_u_max, m_bbox_v_min, m_bbox_v_max;
564 unsigned int m_firstBorder_u;
565 unsigned int m_firstBorder_v;
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
static const vpColor blue
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 setGraphics(bool activate)
void getEdges(std::list< vpImagePoint > &edges_list) const
void setGraphicsThickness(unsigned int thickness)
void print(std::ostream &os)
void setGrayLevelMax(const unsigned int &max)
double getEllipsoidBadPointsPercentage() const
void setGrayLevelMin(const unsigned int &min)
vpPolygon getPolygon() const
void setCog(const vpImagePoint &ip)
vpImagePoint getCog() const
void setEllipsoidBadPointsPercentage(const double &percentage=0.0)
double getMeanGrayLevel() const
void setComputeMoments(bool activate)
std::list< vpImagePoint > getEdges() const
vpColVector get_nij() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Implementation of a matrix and operations on matrices.
Defines a generic 2D polygon.
Defines a rectangle in the plane.
void setRect(double l, double t, double w, double h)
Class that defines what is a feature generic tracker.
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
void init()
Default initialization.