src/ccstruct/blobs.cpp
void TBLOB::GetEdgeCoords(const TBOX &box, std::vector<std::vector<int>> &x_coords,
                          std::vector<std::vector<int>> &y_coords) const {
  x_coords.clear();
  x_coords.resize(box.height());
  y_coords.clear();
  y_coords.resize(box.width());
  CollectEdges(box, nullptr, nullptr, &x_coords, &y_coords);
  // Sort the output vectors.
  for (auto &coord : x_coords) {
    std::sort(coord.begin(), coord.end());
  }
  for (auto &coord : y_coords) {
    std::sort(coord.begin(), coord.end());
  }
}
// Adds edges to the given vectors.
// For all the edge steps in all the outlines, or polygonal approximation
// where there are no edge steps, collects the steps into x_coords/y_coords.
// x_coords is a collection of the x-coords of vertical edges for each
// y-coord starting at box.bottom().
// y_coords is a collection of the y-coords of horizontal edges for each
// x-coord starting at box.left().
// Eg x_coords[0] is a collection of the x-coords of edges at y=bottom.
// Eg x_coords[1] is a collection of the x-coords of edges at y=bottom + 1.
Adds edges to the given vectors.
For all the edge steps in all the outlines, or polygonal approximation
where there are no edge steps, collects the steps into x_coords/y_coords.
x_coords is a collection of the x-coords of vertical edges for each
y-coord starting at box.bottom().
y_coords is a collection of the y-coords of horizontal edges for each
x-coord starting at box.left().
Eg x_coords[0] is a collection of the x-coords of edges at y=bottom.
Eg x_coords[1] is a collection of the x-coords of edges at y=bottom + 1.
Adds edges to the given vectors . For all the edge steps in all the outlines or polygonal approximation where there are no edge steps collects the steps into x_coords / y_coords . x_coords is a collection of the x - coords of vertical edges for each y - coord starting at box . bottom () . y_coords is a collection of the y - coords of horizontal edges for each x - coord starting at box . left () . Eg x_coords [ 0 ] is a collection of the x - coords of edges at y = bottom . Eg x_coords [ 1 ] is a collection of the x - coords of edges at y = bottom + 1 .
void TBLOB::GetEdgeCoords(const TBOX &box, std::vector<std::vector<int>> &x_coords,
                          std::vector<std::vector<int>> &y_coords) const {
  x_coords.clear();
  x_coords.resize(box.height());
  y_coords.clear();
  y_coords.resize(box.width());
  CollectEdges(box, nullptr, nullptr, &x_coords, &y_coords);
  for (auto &coord : x_coords) {
    std::sort(coord.begin(), coord.end());
  }
  for (auto &coord : y_coords) {
    std::sort(coord.begin(), coord.end());
  }
}
void TBLOB :: GetEdgeCoords ( const TBOX & box , std :: vector < std :: vector < int > > & x_coords , std :: vector < std :: vector < int > > & y_coords ) const { x_coords . clear ( ) ; x_coords . resize ( box . height ( ) ) ; y_coords . clear ( ) ; y_coords . resize ( box . width ( ) ) ; CollectEdges ( box , nullptr , nullptr , & x_coords , & y_coords ) ; for ( auto & coord : x_coords ) { std :: sort ( coord . begin ( ) , coord . end ( ) ) ; } for ( auto & coord : y_coords ) { std :: sort ( coord . begin ( ) , coord . end ( ) ) ; } }
Adds edges to the given vectors.
Adds edges to the given vectors .
// Sort the output vectors.