Blob bounding box🔗

Calculates the areas, centroids and bounding boxes of labeled objects. The boxes are aligned so that the X-axis points right, the Y-axis points down and the origin is at the upper left corner. If the bounding boxes should be tightly aligned around the objects, use blob geometry analysis tool with aligned flag turned on.

Inputs🔗

  • labels: A labeled image. Each connected blob in the output image is marked with a distinct numeric label. Pixels that belong to the first detected blob are ones, the pixels that belong to the second one with twos and so on. Background is zero.

Outputs🔗

  • area: The number of pixels on each blob. A N-by-1 matrix.

  • centroid: The center-of-mass point (x,y) for each blob. A N-by-2-matrix.

  • upperLeft: The upper left corner of the blob’s bounding box. Each row in the matrix contains the (x,y) coordinates of a point. A N-by-2 matrix.

  • upperRight: The upper right corner of the blob’s bounding box.

  • lowerLeft: The lower left corner of the blob’s bounding box.

  • lowerRight: The lower right corner of the blob’s bounding box.

  • size: The size of the bounding box of each detected blob in world coordinates (width, height). A N-by-2 matrix.

  • frame: A coordinate frame for each detected blob. Each frame is a 4-by-4 matrix totaling in a 4N-by-4 matrix.