set_stereo_model_image_pairs — Specify image pairs to be used for surface stereo reconstruction.
The operator set_stereo_model_image_pairs stores a list of image pairs for a stereo model StereoModelID of type 'surface_pairwise' or 'surface_fusion'. Calling the operator for a model of another type will raise an error. In the mode 'surface_pairwise' or 'surface_fusion', surfaces are reconstructed by computing disparity images for image pairs. You specify these image pairs by passing tuples of camera indices in the parameters From and To. Then, e.g., the disparity image from the camera with index From to the camera with index To is computed and so on.
The camera indices must be valid for the camera setup model assigned to the stereo model (see create_stereo_model), otherwise an error is returned. If an image pairs list already exists in the stereo model, it is substituted by the current one.
Besides storing the list of image pairs, the operator set_stereo_model_image_pairs prepares a pair of rectification image maps for each image pair, which are used repeatedly in successive calls to reconstruct_surface_stereo to rectify the images to a normalized binocular stereo pair; refer to gen_binocular_rectification_map for further details. Two of the gen_binocular_rectification_map parameters are exported as stereo model parameters and can be modified by set_stereo_model_param or just inspected by get_stereo_model_param:
Interpolation mode corresponding to the parameter Interpolation of gen_binocular_rectification_map.
sub-sampling factor corresponding to the parameter sub-sampling of gen_binocular_rectification_map.
Note that after modifying these parameters, set_stereo_model_image_pairs must be executed again for the changes to take effect.
The current list of image pairs in the model can be inspected by get_stereo_model_image_pairs.
This operator modifies the state of the following input parameter:
Handle of the stereo model.
Camera indices for the from cameras in the image pairs.
Number of elements: From > 0
Camera indices for the to cameras in the image pairs.
Number of elements: To == From