src/ccstruct/detlinefit.cpp
void DetLineFit::ComputeConstrainedDistances(const FCOORD &direction, double min_dist,
                                             double max_dist) {
  distances_.clear();
  square_length_ = direction.sqlength();
  // Compute the distance of each point from the line.
  for (auto &pt : pts_) {
    FCOORD pt_vector = pt.pt;
    // Compute |line_vector||pt_vector|sin(angle between)
    double dist = direction * pt_vector;
    if (min_dist <= dist && dist <= max_dist) {
      distances_.emplace_back(dist, pt.pt);
    }
  }
}
// Computes all the cross product distances of the points perpendicular to
// the given direction, ignoring distances outside of the give distance range,
// storing the actual (signed) cross products in distances_.
Computes all the cross product distances of the points perpendicular to
the given direction, ignoring distances outside of the give distance range,
storing the actual (signed) cross products in distances_.
Computes all the cross product distances of the points perpendicular to the given direction ignoring distances outside of the give distance range storing the actual ( signed ) cross products in distances_ .
void DetLineFit::ComputeConstrainedDistances(const FCOORD &direction, double min_dist,
                                             double max_dist) {
  distances_.clear();
  square_length_ = direction.sqlength();
  for (auto &pt : pts_) {
    FCOORD pt_vector = pt.pt;
    double dist = direction * pt_vector;
    if (min_dist <= dist && dist <= max_dist) {
      distances_.emplace_back(dist, pt.pt);
    }
  }
}
void DetLineFit :: ComputeConstrainedDistances ( const FCOORD & direction , double min_dist , double max_dist ) { distances_ . clear ( ) ; square_length_ = direction . sqlength ( ) ; for ( auto & pt : pts_ ) { FCOORD pt_vector = pt . pt ; double dist = direction * pt_vector ; if ( min_dist <= dist && dist <= max_dist ) { distances_ . emplace_back ( dist , pt . pt ) ; } } }
Computes all the cross product distances of the points perpendicular to
the given direction, ignoring distances outside of the give distance range,
storing the actual (signed) cross products in distances_.
Computes all the cross product distances of the points perpendicular to the given direction ignoring distances outside of the give distance range storing the actual ( signed ) cross products in distances_ .
// Compute the distance of each point from the line. // Compute |line_vector||pt_vector|sin(angle between)