Centroid, Perimeter – Banner PresencePLUS P4 COLOR Series User Manual

Page 184

Advertising
background image

Centroid

The centroid (x

c

, y

c

) is the point at the center of mass of the blob. For simple blobs like solid circles, ellipses, or

rectangles, this is just the center of the shape. For more complicated shapes it is helpful to imagine a piece of cardboard
cut out in the shape of the blob. The centroid is the point where you could balance the cardboard on the tip of a pencil.
For complicated shapes-especially shapes with unfilled holes-the centroid might lie outside the shape.

The x coordinate of the centroid is calculated by adding up the x coordinates of each pixel in the blob and dividing by
the area. The y coordinate is similar:

Perimeter

The perimeter (P) gives an approximate measurement of the length of the circumference of the blob. Because blobs
are built from individual pixels, it is most practical to estimate the perimeter by counting the contributions of individual
pixels on the blob's boundary. The following table describes the exact values that are added to the perimeter for each
possible pixel configuration. In each example, the description refers to the center pixel in the corresponding pictures.

A pixel with no neighbors that belong to the same blob contributes
(3.14) linear pixels to the perimeter of the blob. This can only happen
in a blob that has an area of one. Since such small blobs are usually
ignored, this circumstance is rare.

A pixel with one neighbor that belongs to the same blob contributes
2.571 linear pixels to the perimeter of the blob.

A pixel with two neighbors that belong to the same blob, forming a
straight line, contributes exactly 2 linear pixels to the perimeter of the
blob.

A pixel with two neighbors that belong to the same blob, forming a
corner, contributes 1.414 linear pixels to the perimeter of the blob.

A pixel with three neighbors that belong to the same blob contributes
exactly 1 linear pixel to the perimeter of the blob. A pixel with three
neighbors that belong to the same blob contributes exactly 1 linear
pixel to the perimeter of the blob.

A pixel with four neighbors that belong to the same blob contributes
nothing to the perimeter of the blob.

Banner Engineering Corp.

Minneapolis, MN USA

184

2/2010

PresencePLUS Software Tools

Advertising
This manual is related to the following products: