MCPcopy Create free account
hub / github.com/creatale/node-dv / NeighbourGaps

Method NeighbourGaps

deps/tesseract/ccstruct/blobbox.cpp:176–189  ·  view source on GitHub ↗

Returns the box gaps between this and its neighbours_ in an array indexed by BlobNeighbourDir.

Source from the content-addressed store, hash-verified

174// Returns the box gaps between this and its neighbours_ in an array
175// indexed by BlobNeighbourDir.
176void BLOBNBOX::NeighbourGaps(int gaps[BND_COUNT]) const {
177 for (int dir = 0; dir < BND_COUNT; ++dir) {
178 gaps[dir] = MAX_INT16;
179 BLOBNBOX* neighbour = neighbours_[dir];
180 if (neighbour != NULL) {
181 const TBOX& n_box = neighbour->bounding_box();
182 if (dir == BND_LEFT || dir == BND_RIGHT) {
183 gaps[dir] = box.x_gap(n_box);
184 } else {
185 gaps[dir] = box.y_gap(n_box);
186 }
187 }
188 }
189}
190// Returns the min and max horizontal and vertical gaps (from NeighbourGaps)
191// modified so that if the max exceeds the max dimension of the blob, and
192// the min is less, the max is replaced with the min.

Callers 1

HandleClickMethod · 0.80

Calls 1

bounding_boxMethod · 0.45

Tested by

no test coverage detected