get_found_component_model — Return the components of a found instance of a component model.
get_found_component_model( : FoundComponents : ComponentModelID, ModelStart, ModelEnd, RowComp, ColumnComp, AngleComp, ScoreComp, ModelComp, ModelMatch, MarkOrientation : RowCompInst, ColumnCompInst, AngleCompInst, ScoreCompInst)
get_found_component_model returns the components of a found instance of the component model ComponentModelID in form of contour regions in FoundComponents as well as in numerical form.
The operator get_found_component_model is particularly useful in order to visualize the matches that have been obtained by find_component_model.
The pose of the returned components corresponds to their pose in the search image as returned by find_component_model. Hence, the parameters ModelStart, ModelEnd, RowComp, ColumnComp, AngleComp, ScoreComp, and ModelComp must be passed to get_found_component_model as they have been returned by find_component_model. In ModelMatch the index of the found instance of the component model must be passed. Consequently, ModelMatch must lie within the range between 0 and m-1, where m is the number of elements in ModelStart and ModelEnd, and hence corresponds to the number of found model instances. For example, if the best match should be retuned, ModelMatch 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 MarkOrientation to '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_components or create_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 RowCompInst, ColumnCompInst, AngleCompInst, and ScoreCompInst. The four tuples are always of length n, where n is the number of components in the component model ComponentModelID. If a component could not be found during the search, an empty region is passed in the corresponding element of FoundComponents and the value of the corresponding element in RowCompInst, ColumnCompInst, AngleCompInst, and ScoreCompInst is set to 0.
Found components of the selected component model instance.
Handle of the component model.
Start index of each found instance of the component model in the tuples describing the component matches.
End index of each found instance of the component model to the tuples describing the component matches.
Row coordinate of the found component matches.
Column coordinate of the found component matches.
Rotation angle of the found component matches.
Score of the found component matches.
Index of the found components.
Index of the found instance of the component model to be returned.
Mark the orientation of the components.
Default value: 'false'
List of values: 'false', 'true'
Row coordinate of all components of the selected model instance.
Column coordinate of all components of the selected model instance.
Rotation angle of all components of the selected model instance.
Score of all components of the selected model instance.
* 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
If the parameters are valid, the operator get_found_component_model returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.