MblobGetRuns

Synopsis

Get the blob run-length encoding information.

Format

void MblobGetRuns(BlobResId, LabelVal, ArrayType, RunXPtr, RunYPtr, RunLengthPtr)

MIL_ID BlobResId; Blob analysis result buffer identifier
long LabelVal; Label value of the blob
long ArrayType; Type of the arrays in which results will be returned.
void *RunXPtr; Array in which to return the X-coordinate of each run
void *RunYPtr; Array in which to return the Y-coordinate of each run
void *RunLengthPtr; Array in which to return the length of each run

Description

This function obtains the coordinate and length of each run (unbroken horizontal sequence of foreground pixels) in a specified blob from the blob analysis result buffer. Prior to using this function, M_NUMBER_OF_RUNS must have been added to the feature list (MblobSelectFeature) and a call to MblobCalculate must have been made.

The BlobResId parameter specifies the identifier of the blob analysis result buffer.

The LabelVal parameter specifies the label value of the blob for which to get run information. The label value for a blob can be obtained, using MblobGetLabel or MblobGetResult. You cannot obtain run-encoding information for blobs that have been deleted from the result buffer.

The ArrayType parameter specifies the type of the arrays in which the coordinate and length of the runs for a blob will be returned. The following array types can be used; M_TYPE_CHAR, M_TYPE_SHORT, or M_TYPE_LONG.

The RunXPtr parameter specifies the address of the array in which to write the X-coordinate of the start (leftmost pixel) of each run in the specified blob.

The RunYPtr parameter specifies the address of the array in which to write the Y-coordinate of the start of each run in the specified blob.

The RunLengthPtr parameter specifies the address of the array in which to write the length of each run in the specified blob.

Note, if either the RunXPtr, RunYPtr, or RunLengthPtr parameter is set to M_NULL, no data will be written in that particular array.

The coordinate and length buffers must be large enough to hold information for all runs in the specified blob. The number of runs for a blob can be obtained, using MblobGetResult or MblobGetResultSingle. The number of runs as well as the run-length encoding results are given in raw pixel values and are not affected by the pixel aspect ratio.

See also

MblobSelectFeature, MblobCalculate, MblobGetLabel, MblobGetResult, MblobGetResultSingle