8 if((idx0_ < idx1_) && (idx0_ >= 0) && (idx1_ < points.size())) {
10 points_.reserve(idx1_-idx0_+1);
11 for(
unsigned int i = idx0_; i <= idx1_; i++) {
12 points_.push_back(points[i]);
17 if( (idx < idx0_) || (idx > idx1_)) {
24 return idx1_ - idx0_ + 2;
27 idx0_ = idx0, idx1_ = idx1;
37 if(points.size() > 0) {
39 std::pair< unsigned int, unsigned int> idx;
42 while(idx.first < points.size()) {
43 idx.second = idx.first + 1;
44 float threshold = 4 * points[idx.second].distanceTo(points[idx.second+1]);
45 while(idx.second < points.size()) {
47 float d = points[idx.second].distanceTo(points[idx.second+1]);
55 if((idx.second - idx.first) > 2) {
58 idx.first = idx.second+1;
66 line.
set(idx0, idx1, points);
74 detected_segments.reserve(detected_segments.size() +
segments_.size());
76 detected_segments.push_back(l);
78 return detected_segments;
81 unsigned int idxMax=line.
idx0_;
84 for(
unsigned int i = line.
idx0_; i < line.
idx1_; i++) {
bool isSupportPoint(int idx)
void set(unsigned int idx0, unsigned int idx1, const std::vector< Point2D > &points)
void start(const std::vector< Point2D > &points)
const double length() const
std::vector< std::pair< unsigned int, unsigned int > > connected_measurments_
const std::vector< LineSegment > & result()
LineSegment2DDetectorParameter config_
LineSegment2D & set(const double &x0, const double &y0, const double &x1, const double &y1)
bool threshold_split_neighbor
void split(LineSegment &line, const std::vector< Point2D > &points)
double distanceTo(const Point2D &p, double &dx, double &dy) const
std::vector< LineSegment > segments_
unsigned int nrSupportPoint()
void updatePoints(const std::vector< Point2D > &points)