47 #include <visp3/core/vpColor.h>
48 #include <visp3/core/vpImage.h>
49 #include <visp3/core/vpImagePoint.h>
50 #include <visp3/core/vpPolygon.h>
51 #include <visp3/core/vpRect.h>
52 #include <visp3/core/vpTracker.h>
139 double getArea()
const;
147 inline vpRect getBBox()
const
151 bbox.
setRect(this->bbox_u_min, this->bbox_v_min, this->bbox_u_max - this->bbox_u_min + 1,
152 this->bbox_v_max - this->bbox_v_min + 1);
163 double getDistance(
const vpDot2 &distantDot)
const;
173 void getEdges(std::list<vpImagePoint> &edges_list)
const { edges_list = this->ip_edges_list; };
183 std::list<vpImagePoint> getEdges()
const {
return (this->ip_edges_list); };
190 double getEllipsoidBadPointsPercentage()
const {
return allowedBadPointsPercentage_; }
192 double getEllipsoidShapePrecision()
const;
193 void getFreemanChain(std::list<unsigned int> &freeman_chain)
const;
195 inline double getGamma()
const {
return this->gamma; };
201 inline unsigned int getGrayLevelMin()
const {
return gray_level_min; };
207 inline unsigned int getGrayLevelMax()
const {
return gray_level_max; };
208 double getGrayLevelPrecision()
const;
210 double getHeight()
const;
211 double getMaxSizeSearchDistancePrecision()
const;
215 double getMeanGrayLevel()
const {
return (this->mean_gray_level); };
220 double getSizePrecision()
const;
221 double getWidth()
const;
226 unsigned int gray_lvl_max,
unsigned int size = 0);
229 friend VISP_EXPORT std::ostream &operator<<(std::ostream &os,
vpDot2 &d);
231 void print(std::ostream &os) { os << *
this << std::endl; }
233 unsigned int area_h, std::list<vpDot2> &niceDots);
237 void setArea(
const double &area);
241 inline void setCog(
const vpImagePoint &ip) { this->cog = ip; }
256 void setComputeMoments(
const bool activate) { compute_moment = activate; }
270 void setEllipsoidBadPointsPercentage(
const double &percentage = 0.0)
273 allowedBadPointsPercentage_ = 0.;
274 else if (percentage > 1.)
275 allowedBadPointsPercentage_ = 1.;
277 allowedBadPointsPercentage_ = percentage;
280 void setEllipsoidShapePrecision(
const double &ellipsoidShapePrecision);
294 void setGraphics(
const bool activate) { graphics = activate; }
301 void setGraphicsThickness(
unsigned int t) { this->thickness = t; };
314 inline void setGrayLevelMin(
const unsigned int &min)
317 this->gray_level_min = 255;
319 this->gray_level_min = min;
331 inline void setGrayLevelMax(
const unsigned int &max)
334 this->gray_level_max = 255;
336 this->gray_level_max = max;
338 void setGrayLevelPrecision(
const double &grayLevelPrecision);
339 void setHeight(
const double &height);
340 void setMaxSizeSearchDistancePrecision(
const double &maxSizeSearchDistancePrecision);
341 void setSizePrecision(
const double &sizePrecision);
342 void setWidth(
const double &width);
348 std::vector<vpImagePoint> &cogs,
vpImagePoint *cogStar = NULL);
419 virtual bool hasGoodLevel(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v)
const;
420 virtual bool hasReverseLevel(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v)
const;
422 virtual vpDot2 *getInstance();
429 unsigned int &border_u,
unsigned int &border_v);
440 unsigned int getFirstBorder_u()
const {
return this->firstBorder_u; }
449 unsigned int getFirstBorder_v()
const {
return this->firstBorder_v; }
451 bool computeFreemanChainElement(
const vpImage<unsigned char> &I,
const unsigned int &u,
const unsigned int &v,
452 unsigned int &element);
453 void computeFreemanParameters(
const int &u_p,
const int &v_p,
unsigned int &element,
int &du,
int &dv,
float &dS,
454 float &dMu,
float &dMv,
float &dMuv,
float &dMu2,
float &dMv2);
455 void updateFreemanPosition(
unsigned int &u,
unsigned int &v,
const unsigned int &dir);
460 bool isInArea(
const unsigned int &u,
const unsigned int &v)
const;
462 void getGridSize(
unsigned int &gridWidth,
unsigned int &gridHeight);
465 void setArea(
const vpRect &a);
474 unsigned int gray_level_min;
478 unsigned int gray_level_max;
481 double mean_gray_level;
482 double grayLevelPrecision;
484 double sizePrecision;
485 double ellipsoidShapePrecision;
486 double maxSizeSearchDistancePrecision;
487 double allowedBadPointsPercentage_;
492 std::list<unsigned int> direction_list;
493 std::list<vpImagePoint> ip_edges_list;
499 unsigned int thickness;
502 int bbox_u_min, bbox_u_max, bbox_v_min, bbox_v_max;
505 unsigned int firstBorder_u;
506 unsigned int firstBorder_v;
512 unsigned int thickness = 1);