cv_blobs/src/BlobResult.cc
void GetConnectedPoints(stack<Point2i>* stack,
                        const Rect& frameBounds,
                        const Point2i& curPoint,
                        Blob::ConnectionType connectionType) {
  assert(stack);

  if (connectionType == Blob::EIGHT_CONNECTED) {
    // Add the diagonals
    AddSafeConnected(stack, frameBounds, 
                     Point2i(curPoint.x - 1, curPoint.y - 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x - 1, curPoint.y + 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x + 1, curPoint.y - 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x + 1, curPoint.y + 1));
  }

  // Add the adjacent pixels
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x - 1, curPoint.y));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x + 1, curPoint.y));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x, curPoint.y - 1));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x, curPoint.y + 1));
}
// Pushes any connected points that aren't in the blob onto the top
// of the stack.
//
// Inputs:
// stack - The stack to add points to
// frameBounds - Image bounds
// curPoint - The point around which to add adjacent ones to
Pushes any connected points that aren't in the blob onto the top
of the stack.

The stack to add points to
frameBounds - Image bounds
curPoint - The point around which to add adjacent ones to
Pushes any connected points that aren ' t in the blob onto the top of the stack . The stack to add points to frameBounds - Image bounds curPoint - The point around which to add adjacent ones to
void GetConnectedPoints(stack<Point2i>* stack,
                        const Rect& frameBounds,
                        const Point2i& curPoint,
                        Blob::ConnectionType connectionType) {
  assert(stack);
  if (connectionType == Blob::EIGHT_CONNECTED) {
    AddSafeConnected(stack, frameBounds, 
                     Point2i(curPoint.x - 1, curPoint.y - 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x - 1, curPoint.y + 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x + 1, curPoint.y - 1));
    AddSafeConnected(stack, frameBounds,
                     Point2i(curPoint.x + 1, curPoint.y + 1));
  }
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x - 1, curPoint.y));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x + 1, curPoint.y));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x, curPoint.y - 1));
  AddSafeConnected(stack, frameBounds, Point2i(curPoint.x, curPoint.y + 1));
}
void GetConnectedPoints ( stack < Point2i > * stack , const Rect & frameBounds , const Point2i & curPoint , Blob :: ConnectionType connectionType ) { assert ( stack ) ; if ( connectionType == Blob :: EIGHT_CONNECTED ) { AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x - 1 , curPoint . y - 1 ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x - 1 , curPoint . y + 1 ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x + 1 , curPoint . y - 1 ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x + 1 , curPoint . y + 1 ) ) ; } AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x - 1 , curPoint . y ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x + 1 , curPoint . y ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x , curPoint . y - 1 ) ) ; AddSafeConnected ( stack , frameBounds , Point2i ( curPoint . x , curPoint . y + 1 ) ) ; }
Pushes any connected points that aren't in the blob onto the top
of the stack.
Pushes any connected points that aren ' t in the blob onto the top of the stack .
// Add the diagonals // Add the adjacent pixels