MblobGetResultSingle()函数

Synopsis

Read the feature value of a single blob.

Format

void MblobGetResultSingle(BlobResId, LabelVal, Feature, TargetArrayPtr)

MIL_ID BlobResId; Blob analysis result buffer identifier
long LabelVal Label value of the blob
long Feature; Type of feature for which to get a result
void *TargetVarPtr; Variable in which to return result

Description

This function obtains the result for a specified feature, for a specific blob, from the blob analysis result buffer. The blob for which to obtain the result is determined by its label value.

The BlobResId parameter specifies the identifier of the blob analysis result buffer from which to get the result.

The LabelVal parameter specifies the label value of the blob for which to get the result. The label value can be obtained, using MblobGetLabel or MblobGetResult . Note, you cannot obtain results for blobs that have been deleted from the result buffer, using MblobSelect.

The Feature parameter specifies the feature for which results should be retrieved. The specified feature must have already been calculated with MblobCalculate. See MblobSelectFeature, MblobSelectFeret, and MblobSelectMoment for pre-defined values.

Some features may have been calculated with two results (grayscale and binary). Specifying the feature alone reads the grayscale result. Specifying the feature + M_BINARY reads the binary result. Unless a feature actually has two results, the result (whether grayscale or binary) is read simply by specifying the feature alone.

Results are normally returned in the target array as type “double”. If you want results to be returned as a different type, combine the specified feature with M_TYPE_CHAR, M_TYPE_SHORT, M_TYPE_LONG, or M_TYPE_FLOAT (for example, M_BLOB_AREA+M_TYPE_LONG).

The TargetVarPtr parameter specifies the address of the variable in which to write the result retrieved from the blob analysis result buffer.

The target variable must be of the correct data type (“double” by default, or whatever type you specified). Results that represent units of measure are expressed in pixels or degrees. If the pixel aspect ratio is not equal to 1, results that represent a position or length are expressed in units of “pixel height”.

See also

MblobAllocResult, MblobGetLabel, MblobGetResult, MblobCalculate, MblobSelect, MblobSelectFeature, MblobSelectFeret, MblobSelectMoment