Name
set_stereo_model_paramT_set_stereo_model_paramSetStereoModelParamset_stereo_model_paramSetStereoModelParamSetStereoModelParam — Set stereo model parameters.
The operator set_stereo_model_paramset_stereo_model_paramSetStereoModelParamset_stereo_model_paramSetStereoModelParamSetStereoModelParam can be used to set diverse
parameters for the stereo model StereoModelIDStereoModelIDStereoModelIDStereoModelIDStereoModelIDstereoModelID.
Two types of parameters can be set with this operator - general and
specific for surface reconstruction. Note that no specific parameters are
provided for 3D point reconstruction.
General parameters:
By setting ParamNameParamNameParamNameParamNameParamNameparamName to one of the following values,
general stereo model parameters can be set to the value passed in
ParamValueParamValueParamValueParamValueParamValueparamValue:
- 'bounding_box'"bounding_box""bounding_box""bounding_box""bounding_box""bounding_box":
-
a tuple [x1,y1,z1,x2,y2,z2] specifying two opposite corner
points P1=[x1,y1,z1] and P2=[x2,y2,z2] of a
bounding box for the reconstructions. The bounding box defines a
box in the space in the coordinate frame of the camera setup model
used for the reconstruction (specified by CameraSetupModelID
in create_stereo_modelcreate_stereo_modelCreateStereoModelcreate_stereo_modelCreateStereoModelCreateStereoModel). The reconstruction algorithms then clip
any resulting reconstruction to this bounding box.
Furthermore, reconstruct_surface_stereoreconstruct_surface_stereoReconstructSurfaceStereoreconstruct_surface_stereoReconstructSurfaceStereoReconstructSurfaceStereo requires a valid bounding
box for the estimation of the minimal and maximal disparity parameters
for the pairwise disparity estimation (see
set_stereo_model_image_pairsset_stereo_model_image_pairsSetStereoModelImagePairsset_stereo_model_image_pairsSetStereoModelImagePairsSetStereoModelImagePairs for more details).
For a valid bounding box, P1 must be the point on the front
lower left corner and P1 - on the back upper right corner of the
bounding box, i.e., x1<x2, y1<y2 and z1<z2.
While the surface reconstruction will terminate in case of an invalid
bounding box, the 3D point reconstruction algorithm simply ignores it,
and it reconstructs all points (it can), without clipping them. Thus, you
can turn off the result clipping for the 3D points reconstruction by
passing the tuple [0,0,0,0,0,-1].
Note that because 'bounding_box'"bounding_box""bounding_box""bounding_box""bounding_box""bounding_box" is a tuple-valued parameter, it
cannot be set in a single call of set_stereo_model_paramset_stereo_model_paramSetStereoModelParamset_stereo_model_paramSetStereoModelParamSetStereoModelParam together
with other model parameters (see the paragraph "A note on tuple-valued
model parameters" below).
Tuple format: [x1,y1,z1,x2,y2,z2]
- 'persistence'"persistence""persistence""persistence""persistence""persistence":
-
enables (ParamValueParamValueParamValueParamValueParamValueparamValue=1) or disables
(ParamValueParamValueParamValueParamValueParamValueparamValue=0) the 'persistence'"persistence""persistence""persistence""persistence""persistence" mode of the
stereo model. When in persistence mode, the model stores
intermediate results of the reconstruction (currently only for
reconstruct_surface_stereoreconstruct_surface_stereoReconstructSurfaceStereoreconstruct_surface_stereoReconstructSurfaceStereoReconstructSurfaceStereo), which can be inspected later
by get_stereo_model_objectget_stereo_model_objectGetStereoModelObjectget_stereo_model_objectGetStereoModelObjectGetStereoModelObject.
Note that the model might need
significant memory space in this mode. This can worsen the performance
of the reconstruction algorithms and even lead to running out of
memory, in particular for setups with many cameras and/or large images.
Therefore, we recommend to enable this mode only for inspection and
debugging a reconstruction with small data sets.
List of values: 0 (default), 1
Surface reconstruction parameters:
By setting ParamNameParamNameParamNameParamNameParamNameparamName to one of the following values, additional
parameters specific for surface reconstruction can be set with
ParamValueParamValueParamValueParamValueParamValueparamValue for a stereo model of type 'surface_pairwise'"surface_pairwise""surface_pairwise""surface_pairwise""surface_pairwise""surface_pairwise":
- 'rectif_interpolation'"rectif_interpolation""rectif_interpolation""rectif_interpolation""rectif_interpolation""rectif_interpolation":
-
Interpolation mode for the rectification maps (see
set_stereo_model_image_pairsset_stereo_model_image_pairsSetStereoModelImagePairsset_stereo_model_image_pairsSetStereoModelImagePairsSetStereoModelImagePairs). Note that after changing this
parameter you must call set_stereo_model_image_pairsset_stereo_model_image_pairsSetStereoModelImagePairsset_stereo_model_image_pairsSetStereoModelImagePairsSetStereoModelImagePairs again
for the changes to take effect.
List of values: 'none'"none""none""none""none""none" (default),
'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear"
- 'rectif_sub_sampling'"rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling":
-
Sub-sampling factor for the rectification maps (see
set_stereo_model_image_pairsset_stereo_model_image_pairsSetStereoModelImagePairsset_stereo_model_image_pairsSetStereoModelImagePairsSetStereoModelImagePairs). Note that after changing this
parameter you must call set_stereo_model_image_pairsset_stereo_model_image_pairsSetStereoModelImagePairsset_stereo_model_image_pairsSetStereoModelImagePairsSetStereoModelImagePairs again
for the changes to take efect.
Suggested values: 0.5, 0.66, 1.0
(default), 1.5,
2.0, 3.0, 4.0
- 'sub_sampling_step'"sub_sampling_step""sub_sampling_step""sub_sampling_step""sub_sampling_step""sub_sampling_step":
-
Sub-sampling step for the X, Y and Z image data resulting from
the pairwise disparity estimation, before this data is used
in its turn for the surface reconstruction (see
reconstruct_surface_stereoreconstruct_surface_stereoReconstructSurfaceStereoreconstruct_surface_stereoReconstructSurfaceStereoReconstructSurfaceStereo).
Suggested values: 1, 2 (default),
3
- 'disparity_method'"disparity_method""disparity_method""disparity_method""disparity_method""disparity_method":
-
Method used to create disparity images from
the image pairs (see reconstruct_surface_stereoreconstruct_surface_stereoReconstructSurfaceStereoreconstruct_surface_stereoReconstructSurfaceStereoReconstructSurfaceStereo). Currently,
only the method 'binocular'"binocular""binocular""binocular""binocular""binocular" is supported, which internally calls
the HALCON operator binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
List of values: 'binocular'"binocular""binocular""binocular""binocular""binocular" (default)
If the method 'binocular'"binocular""binocular""binocular""binocular""binocular" was selected for
'disparity_method'"disparity_method""disparity_method""disparity_method""disparity_method""disparity_method", the following parameters are available:
-
'binocular_method'"binocular_method""binocular_method""binocular_method""binocular_method""binocular_method":
Sets the parameter Method of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
List of values: 'ncc'"ncc""ncc""ncc""ncc""ncc" (default),
'sad'"sad""sad""sad""sad""sad", 'ssd'"ssd""ssd""ssd""ssd""ssd"
-
'binocular_num_levels'"binocular_num_levels""binocular_num_levels""binocular_num_levels""binocular_num_levels""binocular_num_levels":
Sets the parameter NumLevels of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
Suggested values: 1 (default), 2,
3, 4
-
'binocular_mask_width'"binocular_mask_width""binocular_mask_width""binocular_mask_width""binocular_mask_width""binocular_mask_width":
Sets the parameter MaskWidth of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
Suggested values: 5, 7, 9,
11 (default),
21
-
'binocular_mask_height'"binocular_mask_height""binocular_mask_height""binocular_mask_height""binocular_mask_height""binocular_mask_height":
Sets the parameter MaskHeight of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
Suggested values: 5, 7, 9,
11 (default),
21
-
'binocular_texture_thresh'"binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh":
Sets the parameter TextureThresh of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
Suggested values: 0.0 (default),
10.0, 30.0
-
'binocular_score_thresh'"binocular_score_thresh""binocular_score_thresh""binocular_score_thresh""binocular_score_thresh""binocular_score_thresh":
Sets the parameter ScoreThresh of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
Suggested values: -1.0, 0.0, 0.3,
0.5 (default), 0.7
-
'binocular_filter'"binocular_filter""binocular_filter""binocular_filter""binocular_filter""binocular_filter":
Sets the parameter Filter of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
List of values: 'none'"none""none""none""none""none" (default),
'left_right_check'"left_right_check""left_right_check""left_right_check""left_right_check""left_right_check"
-
'binocular_sub_disparity'"binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity":
Sets the parameter SubDisparity of binocular_disparitybinocular_disparityBinocularDisparitybinocular_disparityBinocularDisparityBinocularDisparity.
List of values: 'none'"none""none""none""none""none" (default),
'interpolation'"interpolation""interpolation""interpolation""interpolation""interpolation"
- 'point_meshing'"point_meshing""point_meshing""point_meshing""point_meshing""point_meshing":
-
Enables the post-processing step for meshing the reconstructed
surface points. Currently, only a Poisson solver is supported (see
reconstruct_surface_stereoreconstruct_surface_stereoReconstructSurfaceStereoreconstruct_surface_stereoReconstructSurfaceStereoReconstructSurfaceStereo for more details).
List of values: 'none'"none""none""none""none""none" (default),
'poisson'"poisson""poisson""poisson""poisson""poisson"
If the Poisson-based meshing is enabled, the following parameters can be
set:
-
'poisson_depth'"poisson_depth""poisson_depth""poisson_depth""poisson_depth""poisson_depth":
Depth of the solver octree. More detail (i.e., a higher resolution)
of the resulting mesh is achieved with deeper trees. However, this
requires more time and memory.
Suggested values:
6, 8 (default), 10
Assertion: 3 <= 'poisson_depth'"poisson_depth""poisson_depth""poisson_depth""poisson_depth""poisson_depth" <=
12
-
'poisson_solver_divide'"poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide":
Depth of block Gauss-Seidel solver used for solving the Poisson
equation. At the price of a small time overhead, this parameter
reduces the memory consumption of the underlying meshing
algorithm. Proposed values are depths by 0 to 2 smaller compared to
the main octree depth.
Suggested values: 6, 8 (default),
10
Assertion: 3 <= 'poisson_solver_divide'"poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide"
<= 'poisson_depth'"poisson_depth""poisson_depth""poisson_depth""poisson_depth""poisson_depth"
-
'poisson_samples_per_node'"poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node":
Minimum number of points that should fall in a single octree
leaf. This parameter is used to handle noisy data, e.g., noise-free
data can be distributed over many leaves, whereas more noisy data
should be stored in a single leaf to compensate for the noise. As a
side effect, bigger values of this parameter distribute the data in
less leaves, which results in a smaller octree, which means a speedup
but possibly less detail of the reconstruction.
Suggested values: 1, 5, 10,
30 (default),
40
These parameters can be read back by get_stereo_model_paramget_stereo_model_paramGetStereoModelParamget_stereo_model_paramGetStereoModelParamGetStereoModelParam.
A note on tuple-valued model parameters
Most of the stereo model parameters are single-valued. Thus,
you can provide a list (i.e., tuple) of parameter names and a
list (tuple) of values that has the same length as the input tuple.
In contrast, when setting a tuple-valued parameter, you must pass a
tuple of values. When setting such a parameter together with
other parameters, the value-to-parameter-name correspondence is not
obvious anymore. Thus, tuple-valued parameters like
'bounding_box'"bounding_box""bounding_box""bounding_box""bounding_box""bounding_box" should always be set in a separate call to
set_stereo_model_paramset_stereo_model_paramSetStereoModelParamset_stereo_model_paramSetStereoModelParamSetStereoModelParam.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Handle of the stereo model.
Names of the parameters to be set.
List of values: 'binocular_filter'"binocular_filter""binocular_filter""binocular_filter""binocular_filter""binocular_filter", 'binocular_mask_height'"binocular_mask_height""binocular_mask_height""binocular_mask_height""binocular_mask_height""binocular_mask_height", 'binocular_mask_width'"binocular_mask_width""binocular_mask_width""binocular_mask_width""binocular_mask_width""binocular_mask_width", 'binocular_method'"binocular_method""binocular_method""binocular_method""binocular_method""binocular_method", 'binocular_num_levels'"binocular_num_levels""binocular_num_levels""binocular_num_levels""binocular_num_levels""binocular_num_levels", 'binocular_score_thresh'"binocular_score_thresh""binocular_score_thresh""binocular_score_thresh""binocular_score_thresh""binocular_score_thresh", 'binocular_sub_disparity'"binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity""binocular_sub_disparity", 'binocular_texture_thresh'"binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh""binocular_texture_thresh", 'bounding_box'"bounding_box""bounding_box""bounding_box""bounding_box""bounding_box", 'disparity_method'"disparity_method""disparity_method""disparity_method""disparity_method""disparity_method", 'persistence'"persistence""persistence""persistence""persistence""persistence", 'point_meshing'"point_meshing""point_meshing""point_meshing""point_meshing""point_meshing", 'poisson_depth'"poisson_depth""poisson_depth""poisson_depth""poisson_depth""poisson_depth", 'poisson_samples_per_node'"poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node""poisson_samples_per_node", 'poisson_solver_divide'"poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide""poisson_solver_divide", 'rectif_interpolation'"rectif_interpolation""rectif_interpolation""rectif_interpolation""rectif_interpolation""rectif_interpolation", 'rectif_sub_sampling'"rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling""rectif_sub_sampling", 'sub_sampling_step'"sub_sampling_step""sub_sampling_step""sub_sampling_step""sub_sampling_step""sub_sampling_step"
Values of the parameters to be set.
Suggested values: 0, 0.3, 0.5, 1, 2, 3, 'binocular'"binocular""binocular""binocular""binocular""binocular", 'ncc'"ncc""ncc""ncc""ncc""ncc", 'none'"none""none""none""none""none", 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'interpolation'"interpolation""interpolation""interpolation""interpolation""interpolation", 'left_right_check'"left_right_check""left_right_check""left_right_check""left_right_check""left_right_check", 'poisson'"poisson""poisson""poisson""poisson""poisson"
3D Metrology