linesegment2d_detector.h
Go to the documentation of this file.
1 #ifndef LINEFILTER_H
2 #define LINEFILTER_H
3 
4 #include <memory>
6 
7 namespace tuw {
8 
9 class LineSegment2DDetectorParameter;
10 using LineSegment2DDetectorParameterPtr = std::shared_ptr< LineSegment2DDetectorParameter >;
11 using LineSegment2DDetectorParameterConstPtr = std::shared_ptr< LineSegment2DDetectorParameter const>;
16 public:
18  : threshold_split_neighbor ( true )
19  , threshold_split ( .05 )
20  , min_length ( .1 )
21  , min_points_per_line ( 20 )
22  , min_points_per_unit ( 10 ) {
23  }
26  double min_length;
29 };
30 
32 using LineSegment2DDetectorPtr = std::shared_ptr< LineSegment2DDetector >;
33 using LineSegment2DDetectorConstPtr = std::shared_ptr< LineSegment2DDetector const>;
38 public:
42  class LineSegment : public LineSegment2D {
43  public:
45  LineSegment() : LineSegment2D(), id_ ( 0 ) {};
46  void set ( unsigned int idx0, unsigned int idx1, const std::vector<Point2D> &points );
47  void updatePoints ( const std::vector<Point2D> &points );
48  bool isSupportPoint ( int idx );
49  unsigned int nrSupportPoint();
50  unsigned int id_;
51  unsigned int idx0_, idx1_;
52  std::vector<Point2D> points_;
53  };
55  void start ( const std::vector<Point2D> &points);
56  std::vector<LineSegment2D> &start ( const std::vector<Point2D> &points, std::vector<LineSegment2D> &detected_segments );
57  const std::vector<LineSegment> & result ( );
59 private:
60  void split ( LineSegment &line, const std::vector<Point2D> &points );
61  std::vector< std::pair<unsigned int, unsigned int> > connected_measurments_;
62  std::vector<LineSegment> segments_;
63 };
64 
65 };
66 #endif // LINE2DFILTER_H
ROSCPP_DECL void start()
std::shared_ptr< LineSegment2DDetectorParameter > LineSegment2DDetectorParameterPtr
Prototype.
std::shared_ptr< LineSegment2DDetector const > LineSegment2DDetectorConstPtr
std::vector< std::pair< unsigned int, unsigned int > > connected_measurments_
Definition: command.h:8
LineSegment2DDetectorParameter config_
std::shared_ptr< LineSegment2DDetectorParameter const > LineSegment2DDetectorParameterConstPtr
std::shared_ptr< LineSegment2DDetector > LineSegment2DDetectorPtr
Prototype.
std::vector< LineSegment > segments_


tuw_geometry
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:33:08