Skip to content

create_deformable_surface_modelCreateDeformableSurfaceModelCreateDeformableSurfaceModelcreate_deformable_surface_modelT_create_deformable_surface_modelπŸ”—

Short descriptionπŸ”—

create_deformable_surface_modelCreateDeformableSurfaceModelCreateDeformableSurfaceModelcreate_deformable_surface_modelT_create_deformable_surface_model β€” Create the data structure needed to perform deformable surface-based matching.

SignatureπŸ”—

create_deformable_surface_model( object_model_3d ObjectModel3D, real RelSamplingDistance, attribute.name GenParamName, attribute.value GenParamValue, out deformable_surface_model DeformableSurfaceModel )void CreateDeformableSurfaceModel( const HTuple& ObjectModel3D, const HTuple& RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DeformableSurfaceModel )static void HOperatorSet.CreateDeformableSurfaceModel( HTuple objectModel3D, HTuple relSamplingDistance, HTuple genParamName, HTuple genParamValue, out HTuple deformableSurfaceModel )def create_deformable_surface_model( object_model_3d: HHandle, rel_sampling_distance: float, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, float, int]] ) -> HHandle

Herror T_create_deformable_surface_model( const Htuple ObjectModel3D, const Htuple RelSamplingDistance, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DeformableSurfaceModel )

void HDeformableSurfaceModel::HDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDeformableSurfaceModel::HDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HString& GenParamName, const HString& GenParamValue )

void HDeformableSurfaceModel::HDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const char* GenParamName, const char* GenParamValue )

void HDeformableSurfaceModel::HDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const wchar_t* GenParamName, const wchar_t* GenParamValue ) (Windows only)

public HDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, HTuple genParamName, HTuple genParamValue )

public HDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, string genParamName, string genParamValue )

HDeformableSurfaceModel HObjectModel3D::CreateDeformableSurfaceModel( double RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDeformableSurfaceModel HObjectModel3D::CreateDeformableSurfaceModel( double RelSamplingDistance, const HString& GenParamName, const HString& GenParamValue ) const

HDeformableSurfaceModel HObjectModel3D::CreateDeformableSurfaceModel( double RelSamplingDistance, const char* GenParamName, const char* GenParamValue ) const

HDeformableSurfaceModel HObjectModel3D::CreateDeformableSurfaceModel( double RelSamplingDistance, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

void HDeformableSurfaceModel::CreateDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue )

void HDeformableSurfaceModel::CreateDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HString& GenParamName, const HString& GenParamValue )

void HDeformableSurfaceModel::CreateDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const char* GenParamName, const char* GenParamValue )

void HDeformableSurfaceModel::CreateDeformableSurfaceModel( const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const wchar_t* GenParamName, const wchar_t* GenParamValue ) (Windows only)

HDeformableSurfaceModel HObjectModel3D.CreateDeformableSurfaceModel( double relSamplingDistance, HTuple genParamName, HTuple genParamValue )

HDeformableSurfaceModel HObjectModel3D.CreateDeformableSurfaceModel( double relSamplingDistance, string genParamName, string genParamValue )

void HDeformableSurfaceModel.CreateDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, HTuple genParamName, HTuple genParamValue )

void HDeformableSurfaceModel.CreateDeformableSurfaceModel( HObjectModel3D objectModel3D, double relSamplingDistance, string genParamName, string genParamValue )

DescriptionπŸ”—

The operator create_deformable_surface_modelCreateDeformableSurfaceModel creates a model for deformable surface-based matching for the 3D object stored in the 3D object model ObjectModel3DobjectModel3Dobject_model_3d. The 3D object model can, for example, have been read previously from a file by using read_object_model_3dReadObjectModel3d or it can have been created by using xyz_to_object_model_3dXyzToObjectModel3d. The created surface model is returned in DeformableSurfaceModeldeformableSurfaceModeldeformable_surface_model.

The creation of the deformable surface model requires that the 3D object model contains points and normals. The following combinations are possible:

Note that the direction and orientation (inward or outward) of the normals of the model are important for matching.

The deformable surface model is created by sampling the 3D object model with a certain distance. The sampling distance must be specified in the parameter RelSamplingDistancerelSamplingDistancerel_sampling_distance and is parametrized relative to the diameter of the axis-parallel bounding box of the 3D object model. For example, if RelSamplingDistancerelSamplingDistancerel_sampling_distance is set to 0.05 and the diameter of ObjectModel3DobjectModel3Dobject_model_3d is 10 cm, the points sampled from the object’s surface will be approximately 5 mm apart. The sampled points can be obtained with the operator get_deformable_surface_model_paramGetDeformableSurfaceModelParam using the value 'sampled_model'"sampled_model". Note that outlier points in the object model should be avoided, as they would corrupt the diameter. Reducing RelSamplingDistancerelSamplingDistancerel_sampling_distance leads to more points, and in turn to a more stable but slower matching. Increasing RelSamplingDistancerelSamplingDistancerel_sampling_distance leads to less points, and in turn to a less stable but faster matching.

Β 
(1) (2) (3) (4)

(1) Original 3D model. (2) 3D model sampled with RelSamplingDistancerelSamplingDistancerel_sampling_distance = 0.020.02. (3) RelSamplingDistancerelSamplingDistancerel_sampling_distance = 0.030.03. (4) RelSamplingDistancerelSamplingDistancerel_sampling_distance = 0.050.05.

By default, deformable surface models created with create_deformable_surface_modelCreateDeformableSurfaceModel can handle a moderate amount of deformation. The operator add_deformable_surface_model_sampleAddDeformableSurfaceModelSample can be used to add additional training samples, thus expanding the range of possible deformations. The amount of deformation that can be found can also be controlled with the generic parameters 'scale_min'"scale_min", 'scale_max'"scale_max" and 'bending_max'"bending_max" (see below).

The generic parameter pair GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value is used to set additional parameters for the model generation. GenParamNamegenParamNamegen_param_name contains the tuple of parameter names that shall be set and GenParamValuegenParamValuegen_param_value contains the corresponding values. The following values are possible for GenParamNamegenParamNamegen_param_name:

  • 'model_invert_normals'"model_invert_normals": Invert the orientation of the surface normals of the model. The normal orientation needs to be known for the model generation. If both the model and the scene are acquired with the same setup, the normals will already point in the same direction. If the model was loaded from a CAD file, the normals might point into the opposite direction. If you experience the effect that the model is found on the β€˜outside’ of the scene surface and the model was created from a CAD file, try to set this parameter to 'true'"true". Also, make sure that the normals in the CAD file all point either outward or inward, i.e., are oriented consistently.

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

    Default: 'false'"false"

  • 'scale_min'"scale_min" and 'scale_max'"scale_max": The minimum and maximum allowed scaling of the model. Note that if you set one of the two parameters, the other one must be set too.

    Suggested values:0.80.8, 11, 1.21.2

    Default: No scaling

    Restriction: 00 < 'scale_min'"scale_min" < 'scale_max'"scale_max"

  • 'bending_max'"bending_max": Controls the maximum automatic deformation of the model. The model is deformed automatically by bending it with an angle up to the value of 'bending_max'"bending_max". This allows for deformations to be found that are within this bending range. The angle is passed in degrees.

    Suggested values:55, 1010, 3030

    Default: 2020

    Restriction: 00 <= 'bending_max'"bending_max" < 9090

  • 'stiffness'"stiffness": Control the stiffness of the model when performing the refinement. Larger values of this parameter lead to a more stiff model that can be less deformed. Smaller values lead to a less stiff model that allows more deformation.

    Suggested values:0.20.2, 0.50.5, 0.80.8

    Default: 0.50.5

    Restriction: 00 < 'stiffness'"stiffness" <= 11

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.

This operator supports canceling timeouts and interrupts.

ParametersπŸ”—

ObjectModel3DobjectModel3Dobject_model_3d (input_control) object_model_3d β†’ (handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the 3D object model.

RelSamplingDistancerelSamplingDistancerel_sampling_distance (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Sampling distance relative to the object’s diameter

Default: 0.050.05
Suggested values: 0.1, 0.05, 0.03, 0.02, 0.010.1, 0.05, 0.03, 0.02, 0.01
Restriction: 0 < RelSamplingDistance < 1

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

Names of the generic parameters.

Default: [][]
Suggested values: 'model_invert_normals', 'scale_min', 'scale_max', 'bending_max', 'stiffness'"model_invert_normals", "scale_min", "scale_max", "bending_max", "stiffness"

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 the generic parameters.

Default: [][]
Suggested values: 'true', 'false', 1, 0.9, 1.1, 5, 10, 20, 30, 0.05, 0.1, 0.2"true", "false", 1, 0.9, 1.1, 5, 10, 20, 30, 0.05, 0.1, 0.2

DeformableSurfaceModeldeformableSurfaceModeldeformable_surface_model (output_control) deformable_surface_model β†’ (handle)HTuple (HHandle)HDeformableSurfaceModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the deformable surface model.

ResultπŸ”—

create_deformable_surface_modelCreateDeformableSurfaceModel returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

read_object_model_3dReadObjectModel3d, xyz_to_object_model_3dXyzToObjectModel3d, get_object_model_3d_paramsGetObjectModel3dParams

Possible successors

add_deformable_surface_model_sampleAddDeformableSurfaceModelSample, add_deformable_surface_model_reference_pointAddDeformableSurfaceModelReferencePoint, find_deformable_surface_modelFindDeformableSurfaceModel, refine_deformable_surface_modelRefineDeformableSurfaceModel, get_deformable_surface_model_paramGetDeformableSurfaceModelParam, write_deformable_surface_modelWriteDeformableSurfaceModel, clear_deformable_surface_modelClearDeformableSurfaceModel

Alternatives

read_deformable_surface_modelReadDeformableSurfaceModel

See also

find_deformable_surface_modelFindDeformableSurfaceModel, refine_deformable_surface_modelRefineDeformableSurfaceModel, read_deformable_surface_modelReadDeformableSurfaceModel, add_deformable_surface_model_sampleAddDeformableSurfaceModelSample, add_deformable_surface_model_reference_pointAddDeformableSurfaceModelReferencePoint, write_deformable_surface_modelWriteDeformableSurfaceModel, clear_deformable_surface_modelClearDeformableSurfaceModel

ReferencesπŸ”—

Bertram Drost, Slobodan Ilic: ``Graph-Based Deformable 3D Object Matching.’’ Proceedings of the 37th German Conference on Pattern Recognition, pp. 222-233, 2015.

ModuleπŸ”—

3D Metrology