src/textord/textlineprojection.cpp
int TextlineProjection::DistanceOfBoxFromPartition(const TBOX &box, const ColPartition &part,
                                                   const DENORM *denorm, bool debug) const {
  // Compute a partition box that uses the median top/bottom of the blobs
  // within and median left/right for vertical.
  TBOX part_box = part.bounding_box();
  if (part.IsHorizontalType()) {
    part_box.set_top(part.median_top());
    part_box.set_bottom(part.median_bottom());
  } else {
    part_box.set_left(part.median_left());
    part_box.set_right(part.median_right());
  }
  // Now use DistanceOfBoxFromBox to make the actual calculation.
  return DistanceOfBoxFromBox(box, part_box, part.IsHorizontalType(), denorm, debug);
}
// Compute the distance of the box from the partition using curved projection
// space. As DistanceOfBoxFromBox, except that the direction is taken from
// the ColPartition and the median bounds of the ColPartition are used as
// the to_box.
Compute the distance of the box from the partition using curved projection
space. As DistanceOfBoxFromBox, except that the direction is taken from
the ColPartition and the median bounds of the ColPartition are used as
the to_box.
Compute the distance of the box from the partition using curved projection space . As DistanceOfBoxFromBox except that the direction is taken from the ColPartition and the median bounds of the ColPartition are used as the to_box .
int TextlineProjection::DistanceOfBoxFromPartition(const TBOX &box, const ColPartition &part,
                                                   const DENORM *denorm, bool debug) const {
  TBOX part_box = part.bounding_box();
  if (part.IsHorizontalType()) {
    part_box.set_top(part.median_top());
    part_box.set_bottom(part.median_bottom());
  } else {
    part_box.set_left(part.median_left());
    part_box.set_right(part.median_right());
  }
  return DistanceOfBoxFromBox(box, part_box, part.IsHorizontalType(), denorm, debug);
}
int TextlineProjection :: DistanceOfBoxFromPartition ( const TBOX & box , const ColPartition & part , const DENORM * denorm , bool debug ) const { TBOX part_box = part . bounding_box ( ) ; if ( part . IsHorizontalType ( ) ) { part_box . set_top ( part . median_top ( ) ) ; part_box . set_bottom ( part . median_bottom ( ) ) ; } else { part_box . set_left ( part . median_left ( ) ) ; part_box . set_right ( part . median_right ( ) ) ; } return DistanceOfBoxFromBox ( box , part_box , part . IsHorizontalType ( ) , denorm , debug ) ; }
Compute the distance of the box from the partition using curved projection
space.
Compute the distance of the box from the partition using curved projection space .
// Compute a partition box that uses the median top/bottom of the blobs // within and median left/right for vertical. // Now use DistanceOfBoxFromBox to make the actual calculation.