register_object_model_3d_globalT_register_object_model_3d_globalRegisterObjectModel3dGlobalRegisterObjectModel3dGlobalregister_object_model_3d_global (Operator)
Name
register_object_model_3d_globalT_register_object_model_3d_globalRegisterObjectModel3dGlobalRegisterObjectModel3dGlobalregister_object_model_3d_global
— Improve the relative transformations between 3D object models based on
their overlaps.
Signature
void RegisterObjectModel3dGlobal(const HTuple& ObjectModels3D, const HTuple& HomMats3D, const HTuple& From, const HTuple& To, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* HomMats3DOut, HTuple* Scores)
static HHomMat3DArray HObjectModel3D::RegisterObjectModel3dGlobal(const HObjectModel3DArray& ObjectModels3D, const HHomMat3DArray& HomMats3D, const HTuple& From, const HTuple& To, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Scores)
HHomMat3DArray HObjectModel3D::RegisterObjectModel3dGlobal(const HHomMat3DArray& HomMats3D, const HString& From, Hlong To, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Scores) const
HHomMat3DArray HObjectModel3D::RegisterObjectModel3dGlobal(const HHomMat3DArray& HomMats3D, const char* From, Hlong To, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Scores) const
HHomMat3DArray HObjectModel3D::RegisterObjectModel3dGlobal(const HHomMat3DArray& HomMats3D, const wchar_t* From, Hlong To, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Scores) const
(
Windows only)
static void HOperatorSet.RegisterObjectModel3dGlobal(HTuple objectModels3D, HTuple homMats3D, HTuple from, HTuple to, HTuple genParamName, HTuple genParamValue, out HTuple homMats3DOut, out HTuple scores)
static HHomMat3D[] HObjectModel3D.RegisterObjectModel3dGlobal(HObjectModel3D[] objectModels3D, HHomMat3D[] homMats3D, HTuple from, HTuple to, HTuple genParamName, HTuple genParamValue, out HTuple scores)
HHomMat3D[] HObjectModel3D.RegisterObjectModel3dGlobal(HHomMat3D[] homMats3D, string from, int to, HTuple genParamName, HTuple genParamValue, out HTuple scores)
def register_object_model_3d_global(object_models_3d: MaybeSequence[HHandle], hom_mats_3d: Sequence[Union[int, float]], from_val: MaybeSequence[Union[int, str]], to: MaybeSequence[int], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, str, float]]) -> Tuple[Sequence[Union[int, float]], Sequence[float]]
Description
register_object_model_3d_globalregister_object_model_3d_globalRegisterObjectModel3dGlobalRegisterObjectModel3dGlobalregister_object_model_3d_global
improves the relative transformations
between 3D object models, which is called global registration.
In particular, under the assumption that all input 3D objects
models in ObjectModels3DObjectModels3DObjectModels3DobjectModels3Dobject_models_3d
have a known approximated
spatial relation,
all possible pairwise overlapping areas are calculated and optimized for
a better alignment. The resulting offset is
then synchronously minimized for all pairs. The entire
process is then repeated iteratively from the newly resulting starting poses.
The result in HomMats3DOutHomMats3DOutHomMats3DOuthomMats3DOuthom_mats_3dout
describes a transformation that
can be applied with affine_trans_object_model_3daffine_trans_object_model_3dAffineTransObjectModel3dAffineTransObjectModel3daffine_trans_object_model_3d
to the input
3D object models to transform all in a common reference frame.
ScoresScoresScoresscoresscores
contains for every 3D object model the number of found
neighbors with a sufficient
overlap. If no overlap is found for at least one object, an exception is
raised.
Three types for the interpretation of the starting poses in
HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
are available, which is controlled by the parameters
FromFromFromfromfrom
and ToToTototo
:
First, if FromFromFromfromfrom
is set to 'global'"global""global""global""global", the
parameter HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
must contain a rigid transformation with
12 entries for each 3D object model in ObjectModels3DObjectModels3DObjectModels3DobjectModels3Dobject_models_3d
that
describes its position in relation to a common global reference frame. In
this case, ToToTototo
must be empty. This case is suitable, e.g.,
if transformations are applied by a turning table or a robot to either
the camera or the object. In this case, all neighborhoods that are possible
are considered for the global optimization.
Second, if FromFromFromfromfrom
is set to
'previous'"previous""previous""previous""previous", the parameter HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
must contain a
rigid transformation for each subsequent pair of 3D object models in
ObjectModels3DObjectModels3DObjectModels3DobjectModels3Dobject_models_3d
(one less than for the first case).
An example for this
situation might be a matching applied consecutively to the previous
frame (e.g., with register_object_model_3d_pairregister_object_model_3d_pairRegisterObjectModel3dPairRegisterObjectModel3dPairregister_object_model_3d_pair
). ToToTototo
must
be empty again. In this case, all neighborhoods that are possible
are considered for the global optimization.
Third, you can describe any transformation in HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
by setting FromFromFromfromfrom
and ToToTototo
to the indices of the
3D object models for which the corresponding transformation is valid.
That is, a given transformation describes the transformation that is needed
to move the 3D object model with the index that is specified in
FromFromFromfromfrom
into the coordinate system of the 3D object model with the
corresponding index that is specified in ToToTototo
.
In this case, HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
should contain all possible neighborhood relations between the objects,
since no other than these neighborhoods are considered for
the optimization. Please consider, that for all 3D object
models at least one path of transformations to each other 3D object
model must be contained in the such specified transformations.
If ObjectModels3DObjectModels3DObjectModels3DobjectModels3Dobject_models_3d
contains 3D-primitives, they will internally
be transformed into point clouds and will be considered as such.
The accuracy of the returned poses is limited to around
0.1% of the size of the point clouds due to numerical reasons. The accuracy
further depends on the noise of the data points, the number of
data points and the shape of the point clouds.
The process of the global registration can be controlled further
by the following generic parameters in
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
:
- 'default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters":
-
Allows to choose between two
default parameter sets, i.e., it allows to switch between a
'fast'"fast""fast""fast""fast" and an 'accurate'"accurate""accurate""accurate""accurate" set
of parameters.
List of values:
'fast'"fast""fast""fast""fast", 'accurate'"accurate""accurate""accurate""accurate".
Default:
'accurate'"accurate""accurate""accurate""accurate".
- 'rel_sampling_distance'"rel_sampling_distance""rel_sampling_distance""rel_sampling_distance""rel_sampling_distance":
-
The relative
sampling rate of the 3D object models.
This value is relative to the object's diameter and refers to
the minimal distance between two sampled points. A higher value
leads to faster results, whereas a lower value leads to more accurate
results.
Suggested values:
0.03, 0.05, 0.07.
Default:
0.05 ('default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters" =
'accurate'"accurate""accurate""accurate""accurate"),
0.07 ('default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters" = 'fast'"fast""fast""fast""fast").
Restriction:
0 < 'rel_sampling_distance'"rel_sampling_distance""rel_sampling_distance""rel_sampling_distance""rel_sampling_distance" < 1
- 'pose_ref_sub_sampling'"pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling":
-
Number of points that are skipped
for the pose refinement. The value specifies the number of points
that are skipped per selected point. Increasing this value
allows faster convergence at the cost of less accurate results.
The internally used method for the refinement is asymmetric and
this parameter only affects the second model of each tested pair.
Suggested values:
1, 2, 20.
Default:
2 ('default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters" =
'accurate'"accurate""accurate""accurate""accurate"),
10 ('default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters" = 'fast'"fast""fast""fast""fast").
Restriction:
'pose_ref_sub_sampling'"pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling" > 0
- 'max_num_iterations'"max_num_iterations""max_num_iterations""max_num_iterations""max_num_iterations":
-
Number of iterations applied
to adjust the initial alignment. The better the initial alignment is,
the less iterations are necessary.
Suggested values:
1, 3, 10.
Default:
3.
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 supports canceling timeouts and interrupts.
Parameters
ObjectModels3DObjectModels3DObjectModels3DobjectModels3Dobject_models_3d
(input_control) object_model_3d(-array) →
HObjectModel3D, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handles of several 3D object models.
HomMats3DHomMats3DHomMats3DhomMats3Dhom_mats_3d
(input_control) hom_mat3d-array →
HHomMat3D, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Approximate relative transformations between
the 3D object models.
FromFromFromfromfrom
(input_control) number(-array) →
HTupleMaybeSequence[Union[int, str]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Type of interpretation for the transformations.
Default:
'global'
"global"
"global"
"global"
"global"
List of values:
0, 1, 2, 3, 4, 'global'"global""global""global""global", 'previous'"previous""previous""previous""previous"
ToToTototo
(input_control) number(-array) →
HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Target indices of the transformations if
FromFromFromfromfrom
specifies the source indices, otherwise
the parameter must be empty.
Default:
[]
List of values:
0, 1, 2, 3, 4
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
(input_control) string-array →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Names of the generic parameters that can be adjusted
for the global 3D object model registration.
Default:
[]
List of values:
'default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters", 'max_num_iterations'"max_num_iterations""max_num_iterations""max_num_iterations""max_num_iterations", 'pose_ref_sub_sampling'"pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling""pose_ref_sub_sampling", 'rel_sampling_distance'"rel_sampling_distance""rel_sampling_distance""rel_sampling_distance""rel_sampling_distance"
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
(input_control) number-array →
HTupleSequence[Union[int, str, float]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Values of the generic parameters that can be adjusted
for the global 3D object model registration.
Default:
[]
Suggested values:
0.03, 0.05, 0.07, 0.1, 0.25, 0.5, 1, 2, 5, 10, 20, 'fast'"fast""fast""fast""fast", 'accurate'"accurate""accurate""accurate""accurate"
HomMats3DOutHomMats3DOutHomMats3DOuthomMats3DOuthom_mats_3dout
(output_control) hom_mat3d-array →
HHomMat3D, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Resulting Transformations.
ScoresScoresScoresscoresscores
(output_control) number-array →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Number of overlapping neighbors for each
3D object model.
Result
register_object_model_3d_globalregister_object_model_3d_globalRegisterObjectModel3dGlobalRegisterObjectModel3dGlobalregister_object_model_3d_global
returns 2 (
H_MSG_TRUE)
if all parameters
are correct. If necessary, an exception is raised.
Possible Predecessors
read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dread_object_model_3d
,
xyz_to_object_model_3dxyz_to_object_model_3dXyzToObjectModel3dXyzToObjectModel3dxyz_to_object_model_3d
,
register_object_model_3d_pairregister_object_model_3d_pairRegisterObjectModel3dPairRegisterObjectModel3dPairregister_object_model_3d_pair
,
gen_object_model_3d_from_pointsgen_object_model_3d_from_pointsGenObjectModel3dFromPointsGenObjectModel3dFromPointsgen_object_model_3d_from_points
Possible Successors
affine_trans_object_model_3daffine_trans_object_model_3dAffineTransObjectModel3dAffineTransObjectModel3daffine_trans_object_model_3d
,
union_object_model_3dunion_object_model_3dUnionObjectModel3dUnionObjectModel3dunion_object_model_3d
,
sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d
,
triangulate_object_model_3dtriangulate_object_model_3dTriangulateObjectModel3dTriangulateObjectModel3dtriangulate_object_model_3d
See also
register_object_model_3d_pairregister_object_model_3d_pairRegisterObjectModel3dPairRegisterObjectModel3dPairregister_object_model_3d_pair
,
find_surface_modelfind_surface_modelFindSurfaceModelFindSurfaceModelfind_surface_model
,
refine_surface_model_poserefine_surface_model_poseRefineSurfaceModelPoseRefineSurfaceModelPoserefine_surface_model_pose
Module
3D Metrology