ClassesClassesClassesClasses | | | | Operators

get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel (Operator)

Name

get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel — Return the components of a found instance of a component model.

Signature

get_found_component_model( : FoundComponents : ComponentModelID, ModelStart, ModelEnd, RowComp, ColumnComp, AngleComp, ScoreComp, ModelComp, ModelMatch, MarkOrientation : RowCompInst, ColumnCompInst, AngleCompInst, ScoreCompInst)

Herror get_found_component_model(Hobject* FoundComponents, const Hlong ComponentModelID, const Hlong ModelStart, const Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, const Hlong ModelComp, const Hlong ModelMatch, const char* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst)

Herror T_get_found_component_model(Hobject* FoundComponents, const Htuple ComponentModelID, const Htuple ModelStart, const Htuple ModelEnd, const Htuple RowComp, const Htuple ColumnComp, const Htuple AngleComp, const Htuple ScoreComp, const Htuple ModelComp, const Htuple ModelMatch, const Htuple MarkOrientation, Htuple* RowCompInst, Htuple* ColumnCompInst, Htuple* AngleCompInst, Htuple* ScoreCompInst)

Herror get_found_component_model(Hobject* FoundComponents, const HTuple& ComponentModelID, const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, const HTuple& ModelMatch, const HTuple& MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst)

Herror get_found_component_model(Hobject* FoundComponents, const HTuple& ComponentModelID, const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, const HTuple& ModelMatch, const HTuple& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst)

HRegionArray HComponentModel::GetFoundComponentModel(const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, const HTuple& ModelMatch, const HTuple& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst) const

void GetFoundComponentModel(HObject* FoundComponents, const HTuple& ComponentModelID, const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, const HTuple& ModelMatch, const HTuple& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst)

HRegion HComponentModel::GetFoundComponentModel(const HTuple& ModelStart, const HTuple& ModelEnd, const HTuple& RowComp, const HTuple& ColumnComp, const HTuple& AngleComp, const HTuple& ScoreComp, const HTuple& ModelComp, Hlong ModelMatch, const HString& MarkOrientation, HTuple* RowCompInst, HTuple* ColumnCompInst, HTuple* AngleCompInst, HTuple* ScoreCompInst) const

HRegion HComponentModel::GetFoundComponentModel(Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const HString& MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst) const

HRegion HComponentModel::GetFoundComponentModel(Hlong ModelStart, Hlong ModelEnd, double RowComp, double ColumnComp, double AngleComp, double ScoreComp, Hlong ModelComp, Hlong ModelMatch, const char* MarkOrientation, double* RowCompInst, double* ColumnCompInst, double* AngleCompInst, double* ScoreCompInst) const

void HOperatorSetX.GetFoundComponentModel(
[out] IHUntypedObjectX*FoundComponents, [in] VARIANT ComponentModelID, [in] VARIANT ModelStart, [in] VARIANT ModelEnd, [in] VARIANT RowComp, [in] VARIANT ColumnComp, [in] VARIANT AngleComp, [in] VARIANT ScoreComp, [in] VARIANT ModelComp, [in] VARIANT ModelMatch, [in] VARIANT MarkOrientation, [out] VARIANT* RowCompInst, [out] VARIANT* ColumnCompInst, [out] VARIANT* AngleCompInst, [out] VARIANT* ScoreCompInst)

IHRegionX* HComponentModelX.GetFoundComponentModel(
[in] VARIANT ModelStart, [in] VARIANT ModelEnd, [in] VARIANT RowComp, [in] VARIANT ColumnComp, [in] VARIANT AngleComp, [in] VARIANT ScoreComp, [in] VARIANT ModelComp, [in] Hlong ModelMatch, [in] BSTR MarkOrientation, [out] VARIANT* RowCompInst, [out] VARIANT* ColumnCompInst, [out] VARIANT* AngleCompInst, [out] VARIANT* ScoreCompInst)

static void HOperatorSet.GetFoundComponentModel(out HObject foundComponents, HTuple componentModelID, HTuple modelStart, HTuple modelEnd, HTuple rowComp, HTuple columnComp, HTuple angleComp, HTuple scoreComp, HTuple modelComp, HTuple modelMatch, HTuple markOrientation, out HTuple rowCompInst, out HTuple columnCompInst, out HTuple angleCompInst, out HTuple scoreCompInst)

HRegion HComponentModel.GetFoundComponentModel(HTuple modelStart, HTuple modelEnd, HTuple rowComp, HTuple columnComp, HTuple angleComp, HTuple scoreComp, HTuple modelComp, int modelMatch, string markOrientation, out HTuple rowCompInst, out HTuple columnCompInst, out HTuple angleCompInst, out HTuple scoreCompInst)

HRegion HComponentModel.GetFoundComponentModel(int modelStart, int modelEnd, double rowComp, double columnComp, double angleComp, double scoreComp, int modelComp, int modelMatch, string markOrientation, out double rowCompInst, out double columnCompInst, out double angleCompInst, out double scoreCompInst)

Description

get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel returns the components of a found instance of the component model ComponentModelIDComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelID in form of contour regions in FoundComponentsFoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponents as well as in numerical form.

The operator get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel is particularly useful in order to visualize the matches that have been obtained by find_component_modelfind_component_modelFindComponentModelfind_component_modelFindComponentModelFindComponentModel.

The pose of the returned components corresponds to their pose in the search image as returned by find_component_modelfind_component_modelFindComponentModelfind_component_modelFindComponentModelFindComponentModel. Hence, the parameters ModelStartModelStartModelStartModelStartModelStartmodelStart, ModelEndModelEndModelEndModelEndModelEndmodelEnd, RowCompRowCompRowCompRowCompRowComprowComp, ColumnCompColumnCompColumnCompColumnCompColumnCompcolumnComp, AngleCompAngleCompAngleCompAngleCompAngleCompangleComp, ScoreCompScoreCompScoreCompScoreCompScoreCompscoreComp, and ModelCompModelCompModelCompModelCompModelCompmodelComp must be passed to get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel as they have been returned by find_component_modelfind_component_modelFindComponentModelfind_component_modelFindComponentModelFindComponentModel. In ModelMatchModelMatchModelMatchModelMatchModelMatchmodelMatch the index of the found instance of the component model must be passed. Consequently, ModelMatchModelMatchModelMatchModelMatchModelMatchmodelMatch must lie within the range between 0 and m-1, where m is the number of elements in ModelStartModelStartModelStartModelStartModelStartmodelStart and ModelEndModelEndModelEndModelEndModelEndmodelEnd, and hence corresponds to the number of found model instances. For example, if the best match should be retuned, ModelMatchModelMatchModelMatchModelMatchModelMatchmodelMatch should be set to 0.

When dealing with rotationally symmetric components, one may wish to mark the current orientation of the found component. This can be achieved by setting MarkOrientationMarkOrientationMarkOrientationMarkOrientationMarkOrientationmarkOrientation to 'true'"true""true""true""true""true". In this case, the contour region of each component is complemented by an arrow at its reference point that points in the reference direction. The reference direction of a component is based on the orientation of the component in the model image (see train_model_componentstrain_model_componentsTrainModelComponentstrain_model_componentsTrainModelComponentsTrainModelComponents or create_component_modelcreate_component_modelCreateComponentModelcreate_component_modelCreateComponentModelCreateComponentModel) and is represented by an arrow that starts at the reference point and points to the right in the horizontal direction.

For convenience, the pose parameters as well as the score of each component of the found model instance are additionally returned in numerical form in RowCompInstRowCompInstRowCompInstRowCompInstRowCompInstrowCompInst, ColumnCompInstColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInst, AngleCompInstAngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInst, and ScoreCompInstScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInst. The four tuples are always of length n, where n is the number of components in the component model ComponentModelIDComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelID. If a component could not be found during the search, an empty region is passed in the corresponding element of FoundComponentsFoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponents and the value of the corresponding element in RowCompInstRowCompInstRowCompInstRowCompInstRowCompInstrowCompInst, ColumnCompInstColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInst, AngleCompInstAngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInst, and ScoreCompInstScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInst is set to 0.

Parallelization

Parameters

FoundComponentsFoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponents (output_object)  region-array objectHRegionHRegionHRegionArrayHRegionXHobject *

Found components of the selected component model instance.

ComponentModelIDComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelID (input_control)  component_model HComponentModel, HTupleHTupleHComponentModel, HTupleHComponentModelX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the component model.

ModelStartModelStartModelStartModelStartModelStartmodelStart (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Start index of each found instance of the component model in the tuples describing the component matches.

ModelEndModelEndModelEndModelEndModelEndmodelEnd (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

End index of each found instance of the component model to the tuples describing the component matches.

RowCompRowCompRowCompRowCompRowComprowComp (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the found component matches.

ColumnCompColumnCompColumnCompColumnCompColumnCompcolumnComp (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the found component matches.

AngleCompAngleCompAngleCompAngleCompAngleCompangleComp (input_control)  angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Rotation angle of the found component matches.

ScoreCompScoreCompScoreCompScoreCompScoreCompscoreComp (input_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Score of the found component matches.

ModelCompModelCompModelCompModelCompModelCompmodelComp (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Index of the found components.

ModelMatchModelMatchModelMatchModelMatchModelMatchmodelMatch (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Index of the found instance of the component model to be returned.

MarkOrientationMarkOrientationMarkOrientationMarkOrientationMarkOrientationmarkOrientation (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Mark the orientation of the components.

Default value: 'false' "false" "false" "false" "false" "false"

List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

RowCompInstRowCompInstRowCompInstRowCompInstRowCompInstrowCompInst (output_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of all components of the selected model instance.

ColumnCompInstColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInst (output_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of all components of the selected model instance.

AngleCompInstAngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInst (output_control)  angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Rotation angle of all components of the selected model instance.

ScoreCompInstScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInst (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Score of all components of the selected model instance.

Example (HDevelop)

* Read a component model from file.
read_component_model ('pliers.cpm', ComponentModelID)
* Find the component model in a run-time image.
read_image (SearchImage, 'search_image.tif')
find_component_model (SearchImage, ComponentModelID, RootRanking, 0, \
                      rad(360), 0.5, 0, 0.5, 'stop_search', 'prune_branch', \
                      'none', 0.8, 'least_squares', 0, 0.8, ModelStart, \
                      ModelEnd, Score, RowComp, ColumnComp, AngleComp, \
                      ScoreComp, ModelComp)
* Visualize the found instances.
for i := 0 to |ModelStart|-1 by 1
    get_found_component_model (FoundComponents, ComponentModelID, \
                               ModelStart, ModelEnd, RowComp, ColumnComp, \
                               AngleComp, ScoreComp, ModelComp, i, 'false', \
                               RowCompInst, ColumnCompInst, AngleCompInst, \
                               ScoreCompInst)
    dev_display (FoundComponents)
endfor

Result

If the parameters are valid, the operator get_found_component_modelget_found_component_modelGetFoundComponentModelget_found_component_modelGetFoundComponentModelGetFoundComponentModel returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

find_component_modelfind_component_modelFindComponentModelfind_component_modelFindComponentModelFindComponentModel

See also

train_model_componentstrain_model_componentsTrainModelComponentstrain_model_componentsTrainModelComponentsTrainModelComponents, create_component_modelcreate_component_modelCreateComponentModelcreate_component_modelCreateComponentModelCreateComponentModel

Module

Matching


ClassesClassesClassesClasses | | | | Operators