Returns the box gaps between this and its neighbours_ in an array indexed by BlobNeighbourDir.
| 174 | // Returns the box gaps between this and its neighbours_ in an array |
| 175 | // indexed by BlobNeighbourDir. |
| 176 | void 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. |
no test coverage detected