MblobSelect()函数

Synopsis

Select blobs for calculations and result retrieval.

Format

void MblobSelect(BlobResId, Operation, Feature, Condition, CondLow, CondHigh)

MIL_ID BlobResId; Blob analysis result buffer identifier
long Operation; Operation to perform on specified blobs
long Feature; Feature to be used for selection
long Condition; Conditional operator for selection
double CondLow; Low compare value for the condition
double CondHigh; High compare value for the condition

Description

This function selects blobs that meet a specified criterion. These blobs will be included in or excluded from future operations (calculations or result retrieval), or deleted entirely from the result buffer.

If this function is not called at least once, all blobs are included by default. If there is more than one call to this function, the effect of the calls is cumulative unless M_INCLUDE_ONLY or M_EXCLUDE_ONLY is specified as the operation to perform.

Once a blob has been excluded, it can normally be re-included only by specifying M_INCLUDE or M_INCLUDE_ONLY in a future call to this function (with the correct criterion). However, if you change the processing mode of a result buffer (with MblobControl), or use the result buffer with different images (in a call to MblobCalculate), all results in the buffer are discarded and all blobs are re-included.

The BlobResId parameter specifies the identifier of the blob analysis result buffer to be used in the blob selection process.

The Operation parameter specifies the operation to perform on the specified blobs as follows:

Operation Description
M_INCLUDE Include all blobs that meet the specified condition.
M_EXCLUDE Exclude all blobs that meet the specified condition.
M_INCLUDE_ONLY Include only those blobs that meet the specified condition (and exclude all others).
M_EXCLUDE_ONLY Exclude only those blobs that meet the specified condition (and include all others).
M_DELETE Delete all blobs that meet the specified condition.

Note, M_INCLUDE affects only the status of currently excluded blobs and M_EXCLUDE affects only currently included blobs. M_DELETE removes blobs permanently from the result buffer and, consequently, prevents these blobs from being re-included.

Including only (M_INCLUDE_ONLY) or excluding only (M_EXCLUDE_ONLY) those blobs that meet the specified condition does not take into consideration the present status of blobs (whether they are included or excluded), except for blobs that have been deleted (M_DELETE).

The Feature parameter specifies the feature to use as part of the selection criterion. See MblobSelectFeature, MblobSelectFeret, and MblobSelectMoment for a list of features. The specified result buffer must already contain the results for the specified feature.

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

You can also use the Feature parameter to specify a group of blobs (M_ALL_BLOBS, M_INCLUDED_BLOBS or M_EXCLUDED_BLOBS) to include, exclude, or delete from future calculations and result retrieval. For example, you can delete all currently excluded blobs from the list of blobs to be operated on.

The Condition parameter specifies the condition for the feature selection. This parameter can be set to one of two types of condition.

  • Conditions that use two limits (CondLow and CondHigh): M_OUT_RANGE, M_IN_RANGE
  • Conditions that use one limit (CondLow):
    M_EQUAL, M_NOT_EQUAL, M_GREATER, M_LESS, M_GREATER_OR_EQUAL, M_LESS_OR_EQUAL

When M_OUT_RANGE is selected, blobs with values for the specified feature less than CondLow, or greater than CondHigh, are included, excluded, or deleted from future operations on the specified result buffer.

When M_IN_RANGE is selected, blobs with values for the specified feature in the range CondLow to CondHigh, inclusive, are included, excluded, or deleted from future operations on the specified result buffer.

Any of the other conditions use the CondLow parameter to include, exclude, or delete blobs from future operations on the specified result buffer.

The CondLow and CondHigh parameters specify the upper and lower limits of the selected condition. If the condition uses only one limit, set the CondLow parameter to the required limit and set the CondHigh parameter to M_NULL.

See also

MblobSelectFeature, MblobSelectMoment, MblobSelectFeret, MblobCalculate, MblobGetNumber, MblobGetResult