prepare_object_model_3dT_prepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d (算子)
名称
prepare_object_model_3dT_prepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d — 为特定操作准备三维对象模型。
签名
void PrepareObjectModel3d(const HTuple& ObjectModel3D, const HTuple& Purpose, const HTuple& OverwriteData, const HTuple& GenParamName, const HTuple& GenParamValue)
static void HObjectModel3D::PrepareObjectModel3d(const HObjectModel3DArray& ObjectModel3D, const HString& Purpose, const HString& OverwriteData, const HTuple& GenParamName, const HTuple& GenParamValue)
void HObjectModel3D::PrepareObjectModel3d(const HString& Purpose, const HString& OverwriteData, const HTuple& GenParamName, const HTuple& GenParamValue) const
void HObjectModel3D::PrepareObjectModel3d(const char* Purpose, const char* OverwriteData, const HTuple& GenParamName, const HTuple& GenParamValue) const
void HObjectModel3D::PrepareObjectModel3d(const wchar_t* Purpose, const wchar_t* OverwriteData, const HTuple& GenParamName, const HTuple& GenParamValue) const
(
Windows only)
static void HOperatorSet.PrepareObjectModel3d(HTuple objectModel3D, HTuple purpose, HTuple overwriteData, HTuple genParamName, HTuple genParamValue)
static void HObjectModel3D.PrepareObjectModel3d(HObjectModel3D[] objectModel3D, string purpose, string overwriteData, HTuple genParamName, HTuple genParamValue)
void HObjectModel3D.PrepareObjectModel3d(string purpose, string overwriteData, HTuple genParamName, HTuple genParamValue)
描述
算子 prepare_object_model_3dprepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d prepares the 3D object model
ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d for a following operation given in PurposePurposePurposePurposepurposepurpose.
It computes values required for the operation and stores them in
ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d, thus speeding up the following operation.
It is not necessary to call prepare_object_model_3dprepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d. However, if the
3D object model is to be used multiple times for the same operation, it
can be faster to do so.
The following values are possible for PurposePurposePurposePurposepurposepurpose:
- 'shape_based_matching_3d'"shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d":
-
The 3D object model is prepared to be used in
create_shape_model_3dcreate_shape_model_3dCreateShapeModel3dCreateShapeModel3dCreateShapeModel3dcreate_shape_model_3d。For this, there are no generic
parameters to set.
- 'segmentation'"segmentation""segmentation""segmentation""segmentation""segmentation":
-
The 3D object model is prepared to be used in
segment_object_model_3dsegment_object_model_3dSegmentObjectModel3dSegmentObjectModel3dSegmentObjectModel3dsegment_object_model_3d。For the preparation the 3D
object model must have an attribute with the face triangles and
an attribute with the 3D point coordinates.
If the 3D object model has no attribute with the face triangles, a
simple triangulation is performed (even if OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data
is set to 'false'"false""false""false""false""false"). For this, the
3D object model must have an attribute with the 3D point
coordinates and an attribute with the mapping from the point
coordinates to image coordinates. Only points originating from
neighboring pixels are triangulated. Additionally, holes in the
image region can be filled with a Delaunay triangulation
(see 'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes" below). Only holes which are completely
surrounded by the image region are closed.
- 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation":
-
The 3D object model is prepared to be used in
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
- 'gen_xyz_mapping'"gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping":
-
The XYZ-mapping information of a 3D object model containing an ordered
point cloud is computed, i.e. image coordinates are assigned for each
3D point. For this, either the generic parameter 'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width"
or 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height" must be set, to indicate whether the point
cloud is ordered row-wise or column-wise and define the image dimensions
(see 'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width" and 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height" below).
Note that in many cases, it is recommended to use the 2D mapping data,
if available, for speed and robustness reasons. This is beneficial
especially when using sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d,
surface_normals_object_model_3dsurface_normals_object_model_3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dsurface_normals_object_model_3d, or when preparing a 3D object
model for surface-based matching, e.g., smoothing, removing outliers, and
reducing the domain.
The parameter OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data defines if the existing data
of an already prepared 3D object model shall be removed. If
OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data is set to 'true'"true""true""true""true""true", the prepared data,
defined with the parameter PurposePurposePurposePurposepurposepurpose, is overwritten. If
OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data is set to 'false'"false""false""false""false""false", the prepared data
is not overwritten. If there is no prepared data OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data
is ignored and data is saved in a 3D object model.
The parameter OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data can be used
for choosing another set of generic parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value. The parameter OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data
has no influence if the parameter PurposePurposePurposePurposepurposepurpose is
set to 'shape_based_matching_3d'"shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d", because for that, there
are no generic parameters to set.
The generic parameters can optionally be used to
influence the preparation.如需指定,可分别使用 GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 和 GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value 参数来设定这些参数及其对应值。GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 的可能取值如下:
- 'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'segmentation'"segmentation""segmentation""segmentation""segmentation""segmentation". The parameter
specifies which area holes of the point coordinates are closed
during a simple Delaunay triangulation. Only holes which are completely
surrounded by the image region are closed.
If 'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes" is set to 0,
no holes are triangulated. If the parameter
'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes" is set greater or equal than 1
pixel, the holes with an area less or equal than
'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes" are closed by a meshing.
建议值:
1, 10, 100.
默认值:
10.
- 'distance_to'"distance_to""distance_to""distance_to""distance_to""distance_to":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation".
The parameter specifies the type of data to which the distance shall be
computed to.
It is described in more detail in the documentation of
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
值列表:
'auto'"auto""auto""auto""auto""auto", 'triangles'"triangles""triangles""triangles""triangles""triangles",
'points'"points""points""points""points""points", 'primitive'"primitive""primitive""primitive""primitive""primitive".
默认值:
'auto'"auto""auto""auto""auto""auto".
- 'method'"method""method""method""method""method":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation".
The parameter specifies the method to be used for the distance computation.
It is described in more detail in the documentation of
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
值列表:
'auto'"auto""auto""auto""auto""auto", 'kd-tree'"kd-tree""kd-tree""kd-tree""kd-tree""kd-tree",
'voxel'"voxel""voxel""voxel""voxel""voxel", 'linear'"linear""linear""linear""linear""linear".
默认值:
'auto'"auto""auto""auto""auto""auto".
- 'max_distance'"max_distance""max_distance""max_distance""max_distance""max_distance":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation".
The parameter specifies the maximum distance of interest for the
distance computation. If it is set to 0, no maximum distance
is used.
It is described in more detail in the documentation of
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
建议值:
0, 0.1,
1, 10.
默认值:
0.
- 'sampling_dist_rel'"sampling_dist_rel""sampling_dist_rel""sampling_dist_rel""sampling_dist_rel""sampling_dist_rel":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation".
The parameter specifies the relative sampling distance when computing
the distance to triangles with the method 'voxel'"voxel""voxel""voxel""voxel""voxel".
It is described in more detail in the documentation of
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
建议值:
0.03, 0.01.
默认值:
0.03.
- 'sampling_dist_abs'"sampling_dist_abs""sampling_dist_abs""sampling_dist_abs""sampling_dist_abs""sampling_dist_abs":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation".
The parameter specifies the absolute sampling distance when computing
the distance to triangles with the method 'voxel'"voxel""voxel""voxel""voxel""voxel".
It is described in more detail in the documentation of
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d。
建议值:
1, 5, 10.
默认值:
None.
- 'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'gen_xyz_mapping'"gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping". The parameter
indicates that the point cloud is ordered row-wise and the passed
value is used as the width of the image. The height of the image is
calculated automatically. Only one of the two parameters
'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width" and 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height" can be set.
默认值:
None.
- 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height":
-
This parameter is only valid if
PurposePurposePurposePurposepurposepurpose is set to 'gen_xyz_mapping'"gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping". The parameter
indicates that the point cloud is ordered column-wise and the passed
value is used as the height of the image. The width of the image is
calculated automatically. Only one of the two parameters
'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width" and 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height" can be set.
默认值:
None.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d (输入控制) object_model_3d(-array) → HObjectModel3D, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)
3D 对象模型的句柄。
PurposePurposePurposePurposepurposepurpose (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Pur3D 对象模型的姿态。
默认值:
'shape_based_matching_3d'
"shape_based_matching_3d"
"shape_based_matching_3d"
"shape_based_matching_3d"
"shape_based_matching_3d"
"shape_based_matching_3d"
建议值:
'shape_based_matching_3d'"shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d""shape_based_matching_3d", 'segmentation'"segmentation""segmentation""segmentation""segmentation""segmentation", 'distance_computation'"distance_computation""distance_computation""distance_computation""distance_computation""distance_computation", 'gen_xyz_mapping'"gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping""gen_xyz_mapping"
OverwriteDataOverwriteDataOverwriteDataOverwriteDataoverwriteDataoverwrite_data (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Specify if already existing data should be overwritten.
默认值:
'true'
"true"
"true"
"true"
"true"
"true"
值列表:
'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) attribute.name-array → HTupleSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)
通用参数的名称。
默认值:
[]
值列表:
'distance_to'"distance_to""distance_to""distance_to""distance_to""distance_to", 'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes""max_area_holes", 'max_distance'"max_distance""max_distance""max_distance""max_distance""max_distance", 'method'"method""method""method""method""method", 'sampling_dist_abs'"sampling_dist_abs""sampling_dist_abs""sampling_dist_abs""sampling_dist_abs""sampling_dist_abs", 'sampling_dist_rel'"sampling_dist_rel""sampling_dist_rel""sampling_dist_rel""sampling_dist_rel""sampling_dist_rel", 'xyz_map_height'"xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height""xyz_map_height", 'xyz_map_width'"xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width""xyz_map_width"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制) attribute.value-array → HTupleSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)
通用参数的值。
默认值:
[]
建议值:
0, 1, 100, 'auto'"auto""auto""auto""auto""auto", 'triangles'"triangles""triangles""triangles""triangles""triangles", 'points'"points""points""points""points""points", 'primitive'"primitive""primitive""primitive""primitive""primitive", 'kd-tree'"kd-tree""kd-tree""kd-tree""kd-tree""kd-tree", 'voxel'"voxel""voxel""voxel""voxel""voxel", 'linear'"linear""linear""linear""linear""linear", 0.01, 0.03
示例(HDevelop)
read_object_model_3d ('object_model_3d', 'm', [], [], ObjectModel3D, Status)
prepare_object_model_3d (ObjectModel3D, 'gen_xyz_mapping', 'true',\
'xyz_map_width', Width)
object_model_3d_to_xyz (X, Y, Z, ObjectModel3D, 'from_xyz_map', [], [])
结果
算子 prepare_object_model_3dprepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d 在给定的参数正确时返回值 2 ( H_MSG_TRUE )。否则,将抛出异常。
可能的前趋
read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dReadObjectModel3dread_object_model_3d,
xyz_to_object_model_3dxyz_to_object_model_3dXyzToObjectModel3dXyzToObjectModel3dXyzToObjectModel3dxyz_to_object_model_3d
可能的后继
create_shape_model_3dcreate_shape_model_3dCreateShapeModel3dCreateShapeModel3dCreateShapeModel3dcreate_shape_model_3d,
create_surface_modelcreate_surface_modelCreateSurfaceModelCreateSurfaceModelCreateSurfaceModelcreate_surface_model,
distance_object_model_3ddistance_object_model_3dDistanceObjectModel3dDistanceObjectModel3dDistanceObjectModel3ddistance_object_model_3d,
find_surface_modelfind_surface_modelFindSurfaceModelFindSurfaceModelFindSurfaceModelfind_surface_model,
fit_primitives_object_model_3dfit_primitives_object_model_3dFitPrimitivesObjectModel3dFitPrimitivesObjectModel3dFitPrimitivesObjectModel3dfit_primitives_object_model_3d,
refine_surface_model_poserefine_surface_model_poseRefineSurfaceModelPoseRefineSurfaceModelPoseRefineSurfaceModelPoserefine_surface_model_pose,
segment_object_model_3dsegment_object_model_3dSegmentObjectModel3dSegmentObjectModel3dSegmentObjectModel3dsegment_object_model_3d,
simplify_object_model_3dsimplify_object_model_3dSimplifyObjectModel3dSimplifyObjectModel3dSimplifyObjectModel3dsimplify_object_model_3d,
sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d,
surface_normals_object_model_3dsurface_normals_object_model_3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dsurface_normals_object_model_3d
模块
三维计量