Blobs

Each of the following functions references a Blobs data structure for the first parameter. Index (zero-based) determines which blob is being indexed from the structure. If the index is not specified, the index will default to zero (i.e., the first blob returned).

Function

Description

GetAngle(Blobs, Index)

Returns the angle of a blob's center of mass, relative to the center of the Region of Interest (ROI), that defines the area of the image that will be inspected.

 

The center of mass of a blob represents the blob's balance point. If a sheet of a uniform material were cut out in the shape of the blob, the point upon which the blob would balance is the center of mass. Note that the center of mass of a blob might not actually lie within the blob itself.

 

For example, assume that the black region depicted in the following image is a blob, identified by the ExtractBlobs function. The red dot represents the blob's center of mass.

The x-coordinate and y-coordinate of the center of mass are returned by the GetCol and GetRow Vision Data Access functions, respectively.

GetArea(Blobs, Index)

Returns the area (in pixels) of a blob.

 

The area of a blob is calculated by counting the number of pixels contained within the blob. For example, consider the enlarged blob, shown in the following image:

By counting the pixels, we can see that this blob has an area of 8 pixels.

GetCol(Blobs, Index)

Returns the x-coordinate (column) of a blob's center of mass.

GetColor(Blobs, Index)

Returns the color value (0 = black, 1 = white) of a blob.

GetElongation(Blobs, Index)

Returns an elongation value from the specified blob.

GetHigh(Blobs, Index)

Returns the height of the indexed blob.

GetHoles(Blobs, Index)

Returns the number of holes contained within the blob.

GetMaxCol(Blobs, Index)

Returns the Max Col value of the blob.

GetMaxColRow(Blobs, Index)

Returns the row coordinate at the maximum (right-most) column coordinate.

GetMaxRow(Blobs, Index)

Returns the Max Row value of the blob.

GetMaxRowCol(Blobs, Index)

 

Returns the column coordinate at the maximum (bottom-most) row coordinate.

GetMinCol(Blobs, Index)

Returns the minimum (left-most) column coordinate of the blob.

GetMinColRow(Blobs, Index)

Returns the row coordinate at the minimum (left-most) column coordinate.

GetMinRow(Blobs, Index)

Returns the Min Row value of the blob.

GetMinRowCol(Blobs, Index)

Returns the column coordinate at the minimum (top-most) row coordinate.

GetNFound(Blobs)

Returns the number of blobs found within the specified ROI.

GetPerimeter(Blobs, Index)

Returns the perimeter (in pixels) of the blob.

 

For example, consider an enlarged blob with an area of 8 pixels, as shown:

The perimeter of the blob is calculated by counting the number of external pixel edges, for every pixel contained in the blob.  In this case, the blob has 12 external edges that constitute the perimeter.

GetPolygon(Blobs, Index, [Show])

Returns a Polygon data structure, which represents the boundary points of the specified blob. The Polygon data structure can be used as an input for functions that have an External Region parameter, which allows for image processing to be performed within the boundary of a blob.

Note:
  • Optionally, the Show parameter can be specified. When set to 0 (the default), the polygon graphic will only be shown when the GetPolygon cell is selected; when set to 1, it will always be shown.
  • The polygon will not be graphically displayed if its length exceeds approximately 4950 points.

GetRow(Blobs, Index)

Returns the y-coordinate (row) value of the blob's center of mass.

GetScore(Blobs, Index)

Returns the Score value of the blob.

GetSpread(Blobs, Index)

Returns the Spread value of the blob.

GetThresh(Blobs)

Returns either the manual binary threshold value or the optimum value (if -1, automatic specified) of the blob.

GetWide(Blobs, Index)

Returns the width of the indexed blob.