inspect_clustered_componentsT_inspect_clustered_componentsInspectClusteredComponentsInspectClusteredComponentsinspect_clustered_components (Operator)

Name

inspect_clustered_componentsT_inspect_clustered_componentsInspectClusteredComponentsInspectClusteredComponentsinspect_clustered_components — Inspect the rigid model components obtained from the training.

Signature

inspect_clustered_components( : ModelComponents : ComponentTrainingID, AmbiguityCriterion, MaxContourOverlap, ClusterThreshold : )

Herror T_inspect_clustered_components(Hobject* ModelComponents, const Htuple ComponentTrainingID, const Htuple AmbiguityCriterion, const Htuple MaxContourOverlap, const Htuple ClusterThreshold)

void InspectClusteredComponents(HObject* ModelComponents, const HTuple& ComponentTrainingID, const HTuple& AmbiguityCriterion, const HTuple& MaxContourOverlap, const HTuple& ClusterThreshold)

HRegion HComponentTraining::InspectClusteredComponents(const HString& AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold) const

HRegion HComponentTraining::InspectClusteredComponents(const char* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold) const

HRegion HComponentTraining::InspectClusteredComponents(const wchar_t* AmbiguityCriterion, double MaxContourOverlap, double ClusterThreshold) const   (Windows only)

static void HOperatorSet.InspectClusteredComponents(out HObject modelComponents, HTuple componentTrainingID, HTuple ambiguityCriterion, HTuple maxContourOverlap, HTuple clusterThreshold)

HRegion HComponentTraining.InspectClusteredComponents(string ambiguityCriterion, double maxContourOverlap, double clusterThreshold)

def inspect_clustered_components(component_training_id: HHandle, ambiguity_criterion: str, max_contour_overlap: float, cluster_threshold: float) -> HObject

Description

inspect_clustered_componentsinspect_clustered_componentsInspectClusteredComponentsInspectClusteredComponentsInspectClusteredComponentsinspect_clustered_components creates a representation of the rigid model components based on the training result ComponentTrainingIDComponentTrainingIDComponentTrainingIDComponentTrainingIDcomponentTrainingIDcomponent_training_id in form of contour regions. The resulting rigid model components are computed depending on the criterion that is used to solve the ambiguities AmbiguityCriterionAmbiguityCriterionAmbiguityCriterionAmbiguityCriterionambiguityCriterionambiguity_criterion, the maximum allowable contour overlap MaxContourOverlapMaxContourOverlapMaxContourOverlapMaxContourOverlapmaxContourOverlapmax_contour_overlap, and the cluster threshold ClusterThresholdClusterThresholdClusterThresholdClusterThresholdclusterThresholdcluster_threshold (see train_model_componentstrain_model_componentsTrainModelComponentsTrainModelComponentsTrainModelComponentstrain_model_components). The cluster threshold, for example, influences the merging of the initial components. The greater the threshold is chosen, the fewer initial components are merged. The determined rigid model components are returned in ModelComponentsModelComponentsModelComponentsModelComponentsmodelComponentsmodel_components.

Hence, after the components have been trained once by using train_model_componentstrain_model_componentsTrainModelComponentsTrainModelComponentsTrainModelComponentstrain_model_components, inspect_clustered_componentsinspect_clustered_componentsInspectClusteredComponentsInspectClusteredComponentsInspectClusteredComponentsinspect_clustered_components can be used to estimate the effect of different values for the parameters AmbiguityCriterionAmbiguityCriterionAmbiguityCriterionAmbiguityCriterionambiguityCriterionambiguity_criterion, MaxContourOverlapMaxContourOverlapMaxContourOverlapMaxContourOverlapmaxContourOverlapmax_contour_overlap, and ClusterThresholdClusterThresholdClusterThresholdClusterThresholdclusterThresholdcluster_threshold without performing the complete training procedure several times. Once the desired parameter values have been found, they can be efficiently adopted into the training result by using cluster_model_componentscluster_model_componentsClusterModelComponentsClusterModelComponentsClusterModelComponentscluster_model_components.

Execution Information

Parameters

ModelComponentsModelComponentsModelComponentsModelComponentsmodelComponentsmodel_components (output_object)  region(-array) objectHRegionHObjectHRegionHobject *

Contour regions of rigid model components.

ComponentTrainingIDComponentTrainingIDComponentTrainingIDComponentTrainingIDcomponentTrainingIDcomponent_training_id (input_control)  component_training HComponentTraining, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the training result.

AmbiguityCriterionAmbiguityCriterionAmbiguityCriterionAmbiguityCriterionambiguityCriterionambiguity_criterion (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Criterion for solving the ambiguities.

Default value: 'rigidity' "rigidity" "rigidity" "rigidity" "rigidity" "rigidity"

List of values: 'distance'"distance""distance""distance""distance""distance", 'distance_orientation'"distance_orientation""distance_orientation""distance_orientation""distance_orientation""distance_orientation", 'orientation'"orientation""orientation""orientation""orientation""orientation", 'rigidity'"rigidity""rigidity""rigidity""rigidity""rigidity"

MaxContourOverlapMaxContourOverlapMaxContourOverlapMaxContourOverlapmaxContourOverlapmax_contour_overlap (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Maximum contour overlap of the found initial components.

Default value: 0.2

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Minimum increment: 0.01

Recommended increment: 0.05

Restriction: 0 <= MaxContourOverlap && MaxContourOverlap <= 1

ClusterThresholdClusterThresholdClusterThresholdClusterThresholdclusterThresholdcluster_threshold (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Threshold for clustering the initial components.

Default value: 0.5

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Restriction: 0 <= ClusterThreshold && ClusterThreshold <= 1

Example (HDevelop)

* Get the model image.
read_image (ModelImage, 'model_image.tif')
* Define the regions for the initial components.
gen_rectangle2 (InitialComponentRegions, 212, 233, 0.62, 167, 29)
gen_rectangle2 (Rectangle2, 298, 363, 1.17, 162, 34)
gen_rectangle2 (Rectangle3, 63, 444, -0.26, 50, 27)
gen_rectangle2 (Rectangle4, 120, 473, 0, 33, 20)
concat_obj (InitialComponentRegions, Rectangle2, InitialComponentRegions)
concat_obj (InitialComponentRegions, Rectangle3, InitialComponentRegions)
concat_obj (InitialComponentRegions, Rectangle4, InitialComponentRegions)
* Get the training images
gen_empty_obj (TrainingImages)
for i := 1 to 4 by 1
    read_image (TrainingImage, 'training_image-'+i$'02'+'.tif')
    concat_obj (TrainingImages, TrainingImage, TrainingImages)
endfor
* Extract the model components and train the relations.
train_model_components (ModelImage, InitialComponentRegions, \
                        TrainingImages, ModelComponents, 22, 60, 30, 0.65, \
                        0, 0, rad(60), 'speed', 'rigidity', 0.2, 0.5, \
                        ComponentTrainingID)
* Find the best value for the parameter ClusterThreshold.
inspect_clustered_components (ModelComponents, ComponentTrainingID, \
                              'rigidity', 0.2, 0.4)
* Adopt the ClusterThreshold into the training result.
cluster_model_components (ModelComponents, ModelComponents, \
                          ComponentTrainingID, 'rigidity', 0.2, 0.4)
* Create the component model based on the training result.
create_trained_component_model (ComponentTrainingID, -rad(30), rad(60), 10, \
                                0.5, 'auto', 'auto', 'none', \
                                'use_polarity', 'false', ComponentModelID, \
                                RootRanking)

Result

If the handle of the training result is valid, the operator inspect_clustered_componentsinspect_clustered_componentsInspectClusteredComponentsInspectClusteredComponentsInspectClusteredComponentsinspect_clustered_components returns the value TRUE. If necessary an exception is raised.

Possible Predecessors

train_model_componentstrain_model_componentsTrainModelComponentsTrainModelComponentsTrainModelComponentstrain_model_components

Possible Successors

cluster_model_componentscluster_model_componentsClusterModelComponentsClusterModelComponentsClusterModelComponentscluster_model_components

Module

Matching