get_found_component_modelT_get_found_component_modelGetFoundComponentModelGetFoundComponentModelget_found_component_model (Operator)

Name

get_found_component_modelT_get_found_component_modelGetFoundComponentModelGetFoundComponentModelget_found_component_model — 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 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)

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

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

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)

def get_found_component_model(component_model_id: HHandle, model_start: MaybeSequence[int], model_end: MaybeSequence[int], row_comp: MaybeSequence[float], column_comp: MaybeSequence[float], angle_comp: MaybeSequence[float], score_comp: MaybeSequence[float], model_comp: MaybeSequence[int], model_match: int, mark_orientation: str) -> Tuple[HObject, Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def get_found_component_model_s(component_model_id: HHandle, model_start: MaybeSequence[int], model_end: MaybeSequence[int], row_comp: MaybeSequence[float], column_comp: MaybeSequence[float], angle_comp: MaybeSequence[float], score_comp: MaybeSequence[float], model_comp: MaybeSequence[int], model_match: int, mark_orientation: str) -> Tuple[HObject, float, float, float, float]

Description

get_found_component_modelget_found_component_modelGetFoundComponentModelGetFoundComponentModelGetFoundComponentModelget_found_component_model returns the components of a found instance of the component model ComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelIDcomponent_model_id in form of contour regions in FoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponentsfound_components as well as in numerical form.

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

The pose of the returned components corresponds to their pose in the search image as returned by find_component_modelfind_component_modelFindComponentModelFindComponentModelFindComponentModelfind_component_model. Hence, the parameters ModelStartModelStartModelStartModelStartmodelStartmodel_start, ModelEndModelEndModelEndModelEndmodelEndmodel_end, RowCompRowCompRowCompRowComprowComprow_comp, ColumnCompColumnCompColumnCompColumnCompcolumnCompcolumn_comp, AngleCompAngleCompAngleCompAngleCompangleCompangle_comp, ScoreCompScoreCompScoreCompScoreCompscoreCompscore_comp, and ModelCompModelCompModelCompModelCompmodelCompmodel_comp must be passed to get_found_component_modelget_found_component_modelGetFoundComponentModelGetFoundComponentModelGetFoundComponentModelget_found_component_model as they have been returned by find_component_modelfind_component_modelFindComponentModelFindComponentModelFindComponentModelfind_component_model. In ModelMatchModelMatchModelMatchModelMatchmodelMatchmodel_match the index of the found instance of the component model must be passed. Consequently, ModelMatchModelMatchModelMatchModelMatchmodelMatchmodel_match must lie within the range between 0 and m-1, where m is the number of elements in ModelStartModelStartModelStartModelStartmodelStartmodel_start and ModelEndModelEndModelEndModelEndmodelEndmodel_end, and hence corresponds to the number of found model instances. For example, if the best match should be returned, ModelMatchModelMatchModelMatchModelMatchmodelMatchmodel_match 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 MarkOrientationMarkOrientationMarkOrientationMarkOrientationmarkOrientationmark_orientation 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_componentsTrainModelComponentsTrainModelComponentsTrainModelComponentstrain_model_components or create_component_modelcreate_component_modelCreateComponentModelCreateComponentModelCreateComponentModelcreate_component_model) 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 RowCompInstRowCompInstRowCompInstRowCompInstrowCompInstrow_comp_inst, ColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInstcolumn_comp_inst, AngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInstangle_comp_inst, and ScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInstscore_comp_inst. The four tuples are always of length n, where n is the number of components in the component model ComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelIDcomponent_model_id. If a component could not be found during the search, an empty region is passed in the corresponding element of FoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponentsfound_components and the value of the corresponding element in RowCompInstRowCompInstRowCompInstRowCompInstrowCompInstrow_comp_inst, ColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInstcolumn_comp_inst, AngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInstangle_comp_inst, and ScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInstscore_comp_inst is set to 0.

Execution Information

Parameters

FoundComponentsFoundComponentsFoundComponentsFoundComponentsfoundComponentsfound_components (output_object)  region-array objectHRegionHObjectHRegionHobject *

Found components of the selected component model instance.

ComponentModelIDComponentModelIDComponentModelIDComponentModelIDcomponentModelIDcomponent_model_id (input_control)  component_model HComponentModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the component model.

ModelStartModelStartModelStartModelStartmodelStartmodel_start (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

ModelEndModelEndModelEndModelEndmodelEndmodel_end (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

RowCompRowCompRowCompRowComprowComprow_comp (input_control)  point.y(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of the found component matches.

ColumnCompColumnCompColumnCompColumnCompcolumnCompcolumn_comp (input_control)  point.x(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of the found component matches.

AngleCompAngleCompAngleCompAngleCompangleCompangle_comp (input_control)  angle.rad(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Rotation angle of the found component matches.

ScoreCompScoreCompScoreCompScoreCompscoreCompscore_comp (input_control)  real(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Score of the found component matches.

ModelCompModelCompModelCompModelCompmodelCompmodel_comp (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index of the found components.

ModelMatchModelMatchModelMatchModelMatchmodelMatchmodel_match (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

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

MarkOrientationMarkOrientationMarkOrientationMarkOrientationmarkOrientationmark_orientation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (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"

RowCompInstRowCompInstRowCompInstRowCompInstrowCompInstrow_comp_inst (output_control)  point.y(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of all components of the selected model instance.

ColumnCompInstColumnCompInstColumnCompInstColumnCompInstcolumnCompInstcolumn_comp_inst (output_control)  point.x(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of all components of the selected model instance.

AngleCompInstAngleCompInstAngleCompInstAngleCompInstangleCompInstangle_comp_inst (output_control)  angle.rad(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Rotation angle of all components of the selected model instance.

ScoreCompInstScoreCompInstScoreCompInstScoreCompInstscoreCompInstscore_comp_inst (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (real) (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_modelGetFoundComponentModelGetFoundComponentModelGetFoundComponentModelget_found_component_model returns the value TRUE. If necessary an exception is raised.

Possible Predecessors

find_component_modelfind_component_modelFindComponentModelFindComponentModelFindComponentModelfind_component_model

See also

train_model_componentstrain_model_componentsTrainModelComponentsTrainModelComponentsTrainModelComponentstrain_model_components, create_component_modelcreate_component_modelCreateComponentModelCreateComponentModelCreateComponentModelcreate_component_model

Module

Matching