Skip to content

create_deep_matching_3dCreateDeepMatching3dCreateDeepMatching3dcreate_deep_matching_3dT_create_deep_matching_3d🔗

Short description🔗

create_deep_matching_3dCreateDeepMatching3dCreateDeepMatching3dcreate_deep_matching_3dT_create_deep_matching_3d — Create a Deep 3D Matching model.

Signature🔗

create_deep_matching_3d( object_model_3d ObjectModel3D, attribute.value Symmetry, attribute.name GenParamName, attribute.value GenParamValue, out deep_matching_3d Deep3DMatchingModel )void CreateDeepMatching3d( const HTuple& ObjectModel3D, const HTuple& Symmetry, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Deep3DMatchingModel )static void HOperatorSet.CreateDeepMatching3d( HTuple objectModel3D, HTuple symmetry, HTuple genParamName, HTuple genParamValue, out HTuple deep3DMatchingModel )def create_deep_matching_3d( object_model_3d: HHandle, symmetry: Union[HHandle, str], gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, float, int]] ) -> HHandle

Herror T_create_deep_matching_3d( const Htuple ObjectModel3D, const Htuple Symmetry, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Deep3DMatchingModel )

void HDeepMatching3D::HDeepMatching3D( const HObjectModel3D& ObjectModel3D, const HTuple& Symmetry, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDeepMatching3D::HDeepMatching3D( const HObjectModel3D& ObjectModel3D, const HString& Symmetry, const HString& GenParamName, const HString& GenParamValue )

void HDeepMatching3D::HDeepMatching3D( const HObjectModel3D& ObjectModel3D, const char* Symmetry, const char* GenParamName, const char* GenParamValue )

void HDeepMatching3D::HDeepMatching3D( const HObjectModel3D& ObjectModel3D, const wchar_t* Symmetry, const wchar_t* GenParamName, const wchar_t* GenParamValue ) (Windows only)

public HDeepMatching3D( HObjectModel3D objectModel3D, HTuple symmetry, HTuple genParamName, HTuple genParamValue )

public HDeepMatching3D( HObjectModel3D objectModel3D, string symmetry, string genParamName, string genParamValue )

void HDeepMatching3D::CreateDeepMatching3d( const HObjectModel3D& ObjectModel3D, const HTuple& Symmetry, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDeepMatching3D::CreateDeepMatching3d( const HObjectModel3D& ObjectModel3D, const HString& Symmetry, const HString& GenParamName, const HString& GenParamValue )

void HDeepMatching3D::CreateDeepMatching3d( const HObjectModel3D& ObjectModel3D, const char* Symmetry, const char* GenParamName, const char* GenParamValue )

void HDeepMatching3D::CreateDeepMatching3d( const HObjectModel3D& ObjectModel3D, const wchar_t* Symmetry, const wchar_t* GenParamName, const wchar_t* GenParamValue ) (Windows only)

void HDeepMatching3D.CreateDeepMatching3d( HObjectModel3D objectModel3D, HTuple symmetry, HTuple genParamName, HTuple genParamValue )

void HDeepMatching3D.CreateDeepMatching3d( HObjectModel3D objectModel3D, string symmetry, string genParamName, string genParamValue )

Description🔗

create_deep_matching_3dCreateDeepMatching3d creates a Deep 3D Matching model for finding the poses of the 3D object model ObjectModel3DobjectModel3Dobject_model_3d and returns its handle in Deep3DMatchingModeldeep3DMatchingModeldeep_3dmatching_model.

If the 3D object model is symmetric, symmetry information has to be set with the parameter Symmetrysymmetrysymmetry. It defines the symmetries of the 3D object model ObjectModel3DobjectModel3Dobject_model_3d in a dictionary. Currently discrete symmetries are supported and set in the dictionary key 'symmetry_poses'"symmetry_poses" with the value consisting of HALCON poses (see create_poseCreatePose). All poses that keep the model identical under transformation have to be set, including the identity. By default, this parameter is set to 'no_symmetry'"no_symmetry" (as a string instead of a dictionary) which means that no symmetry is active.

Internally create_deep_matching_3dCreateDeepMatching3d reads pretrained backbone models and creates the model components for object detection and 3D pose estimation. The backbone for 3D pose estimation is filled with the 3D object model ObjectModel3DobjectModel3Dobject_model_3d and possibly its symmetry information for training.

The behavior of the operator can be influenced by setting GenParamNamegenParamNamegen_param_name to the value passed in GenParamValuegenParamValuegen_param_value:

  • 'backbone_name_detector'"backbone_name_detector": Sets the backbone of the deep learning model for object detection. A list of possible backbones can be found in the documentation of create_dl_model_detectionCreateDlModelDetection.

    Default: 'pretrained_dl_classifier_compact.hdl'"pretrained_dl_classifier_compact.hdl".

  • 'backbone_name_pose_estimation'"backbone_name_pose_estimation": Sets the backbone of the deep learning model for 3D pose estimation.

    HALCON provides pretrained backbones to be used for Deep 3D Matching. The following pretrained neural networks are provided:

    • 'pretrained_dl_3d_pose_estimation_compact.hdl'"pretrained_dl_3d_pose_estimation_compact.hdl": This is a smaller neural network designed for easier tasks and is more memory and runtime efficient.

      This network expects the images to be of the type byte. Additionally, the network is designed for certain image properties. The corresponding values can be retrieved with get_dl_model_paramGetDlModelParam and listed below:

      • 'image_width'"image_width": 256

      • 'image_height'"image_height": 256

      • 'image_num_channels'"image_num_channels": 3

      Restriction: The network architecture does not allow changes concerning the image dimensions.

    • 'pretrained_dl_3d_pose_estimation_enhanced.hdl'"pretrained_dl_3d_pose_estimation_enhanced.hdl": This is a larger neural network designed for more difficult tasks and requires more memory and runtime.

      This network expects the images to be of the type byte. Additionally, the network is designed for certain image properties. The corresponding values can be retrieved with get_dl_model_paramGetDlModelParam and listed below:

      • 'image_width'"image_width": 256

      • 'image_height'"image_height": 256

      • 'image_num_channels'"image_num_channels": 3

      Restriction: The network architecture does not allow changes concerning the image dimensions.

    List of values: 'pretrained_dl_3d_pose_estimation_compact.hdl'"pretrained_dl_3d_pose_estimation_compact.hdl", 'pretrained_dl_3d_pose_estimation_enhanced.hdl'"pretrained_dl_3d_pose_estimation_enhanced.hdl".

    Default: 'pretrained_dl_3d_pose_estimation_enhanced.hdl'"pretrained_dl_3d_pose_estimation_enhanced.hdl".

  • 'detector_params'"detector_params": Dictionary with parameters used to configure the backbone of the deep learning model for object detection. A list with the settable parameters can be found in the documentation of create_dl_model_detectionCreateDlModelDetection.

The deep learning models used for Deep 3D Matching can be obtained by get_deep_matching_3d_paramGetDeepMatching3dParam and trained using train_dl_model_batchTrainDlModelBatch.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

ObjectModel3DobjectModel3Dobject_model_3d (input_control) object_model_3d → (handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)HHandleHtuple (handle)

3D model to search.

Symmetrysymmetrysymmetry (input_control) attribute.value → (string / handle)HTuple (HString / HHandle)HTuple (string / HHandle)Union[HHandle, str]Htuple (char* / handle)

Symmetries of the 3D model.

Default: 'no_symmetry'"no_symmetry"

GenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Names of parameters.

Default: [][]
Suggested values: 'backbone_name_detector', 'backbone_name_pose_estimation'"backbone_name_detector", "backbone_name_pose_estimation"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → (string / real / integer)HTuple (HString / double / Hlong)HTuple (string / double / int / long)MaybeSequence[Union[str, float, int]]Htuple (char* / double / Hlong)

Values of parameters.

Default: [][]
Suggested values: 'pretrained_dl_classifier_compact.hdl', 'pretrained_dl_3d_pose_estimation_compact.hdl', 'pretrained_dl_3d_pose_estimation_enhanced.hdl'"pretrained_dl_classifier_compact.hdl", "pretrained_dl_3d_pose_estimation_compact.hdl", "pretrained_dl_3d_pose_estimation_enhanced.hdl"

Deep3DMatchingModeldeep3DMatchingModeldeep_3dmatching_model (output_control) deep_matching_3d → (handle)HTuple (HHandle)HDeepMatching3D, HTuple (IntPtr)HHandleHtuple (handle)

Deep 3D Matching model.

Example🔗

(HDevelop)

* The following example demonstrates the setting of a discrete symmetry.
read_object_model_3d ('pipe_joint', 'm', [], [], ObjectModel3D, Status)
create_pose (0, 0, 0, 0, 0, 0, 'Rp+T', 'gba', 'point', OriginPose)
create_pose (0, 0, 0, 0, 0, 180, 'Rp+T', 'gba', 'point', SymmetryPose)
Symmetry := dict{symmetry_poses: [OriginPose, SymmetryPose]}
create_deep_matching_3d (ObjectModel3D, Symmetry, [], [], Deep3DMatchingModel)

Module🔗

3D Metrology