Skip to content

reconstruct_points_stereoReconstructPointsStereoReconstructPointsStereoreconstruct_points_stereoT_reconstruct_points_stereo🔗

Short description🔗

reconstruct_points_stereoReconstructPointsStereoReconstructPointsStereoreconstruct_points_stereoT_reconstruct_points_stereo — Reconstruct 3D points from calibrated multi-view stereo images.

Signature🔗

reconstruct_points_stereo( stereo_model StereoModelID, number Row, number Column, number CovIP, number CameraIdx, number PointIdx, out real X, out number Y, out number Z, out number CovWP, out number PointIdxOut )void ReconstructPointsStereo( const HTuple& StereoModelID, const HTuple& Row, const HTuple& Column, const HTuple& CovIP, const HTuple& CameraIdx, const HTuple& PointIdx, HTuple* X, HTuple* Y, HTuple* Z, HTuple* CovWP, HTuple* PointIdxOut )static void HOperatorSet.ReconstructPointsStereo( HTuple stereoModelID, HTuple row, HTuple column, HTuple covIP, HTuple cameraIdx, HTuple pointIdx, out HTuple x, out HTuple y, out HTuple z, out HTuple covWP, out HTuple pointIdxOut )def reconstruct_points_stereo( stereo_model_id: HHandle, row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]], cov_ip: Sequence[Union[float, int]], camera_idx: int, point_idx: int ) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[int]]

def reconstruct_points_stereo_s( stereo_model_id: HHandle, row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]], cov_ip: Sequence[Union[float, int]], camera_idx: int, point_idx: int ) -> Tuple[float, float, float, float, int]Herror T_reconstruct_points_stereo( const Htuple StereoModelID, const Htuple Row, const Htuple Column, const Htuple CovIP, const Htuple CameraIdx, const Htuple PointIdx, Htuple* X, Htuple* Y, Htuple* Z, Htuple* CovWP, Htuple* PointIdxOut )

void HStereoModel::ReconstructPointsStereo( const HTuple& Row, const HTuple& Column, const HTuple& CovIP, Hlong CameraIdx, Hlong PointIdx, HTuple* X, HTuple* Y, HTuple* Z, HTuple* CovWP, HTuple* PointIdxOut ) const

void HStereoModel::ReconstructPointsStereo( double Row, double Column, const HTuple& CovIP, Hlong CameraIdx, Hlong PointIdx, double* X, double* Y, double* Z, double* CovWP, Hlong* PointIdxOut ) const

void HStereoModel.ReconstructPointsStereo( HTuple row, HTuple column, HTuple covIP, int cameraIdx, int pointIdx, out HTuple x, out HTuple y, out HTuple z, out HTuple covWP, out HTuple pointIdxOut )

void HStereoModel.ReconstructPointsStereo( double row, double column, HTuple covIP, int cameraIdx, int pointIdx, out double x, out double y, out double z, out double covWP, out int pointIdxOut )

Description🔗

The operator reconstruct_points_stereoReconstructPointsStereo reconstructs 3D points from point correspondences found in the images of a calibrated multi-view stereo setup. The calibration information for the images is provided in the camera setup model that is associated with the stereo model StereoModelIDstereoModelIDstereo_model_id during its creation (see create_stereo_modelCreateStereoModel). Note that the stereo model type must be 'points_3d'"points_3d", otherwise the operator will return an error.

The point correspondences must be passed in the parameters Rowrowrow, Columncolumncolumn, CameraIdxcameraIdxcamera_idx, and PointIdxpointIdxpoint_idx in form of tuples of the same length. Each set (Row[I],Column[I],CameraIdx[I],PointIdx[I]) represents the image coordinates (Rowrowrow, Columncolumncolumn) of the 3D point (PointIdxpointIdxpoint_idx) in the image of a certain camera (CameraIdxcameraIdxcamera_idx).

The reconstructed 3D point coordinates are returned in the tuples Xxx, Yyy, and Zzz, relative to the coordinate system of the camera setup model (see create_camera_setup_modelCreateCameraSetupModel). The tuple PointIdxOutpointIdxOutpoint_idx_out contains the corresponding point indices.

The reconstruction algorithm works as follows: First, it identifies point correspondences for a given 3D point by collecting all sets with the same PointIdxpointIdxpoint_idx. Then, it uses the Rowrowrow, Columncolumncolumn, and CameraIdxcameraIdxcamera_idx information from the collected sets to project lines of sight from each camera through the corresponding image point [Row,Column]. If there are at least 2 lines of sight for the point PointIdxpointIdxpoint_idx, they are intersected and the result is stored as the set (X[J],Y[J],Z[J],PointIdxOut[J]). The intersection is performed with a least-squares algorithm, without taking into account potentially invalid lines of sight (e.g., if an image point was falsely specified as corresponding to a certain 3D point).

To compute the covariance matrices for the reconstructed 3D points, statistical information about the extracted image coordinates, i.e., the covariance matrices of the image points (see , e.g., points_foerstnerPointsFoerstner) are needed as input and must be passed in the parameter CovIPcovIPcov_ip. Otherwise, if no covariance matrices for the 3D points are needed or no covariance matrices for the image points are available, an empty tuple can be passed in CovIPcovIPcov_ip. Then no covariance matrix for the reconstructed 3D points is computed.

The covariance matrix of an image point is:

\[\begin{eqnarray*} \qquad \textrm{CovIP} = \mvMatrix{ (sigma\_r)^2 & sigma\_rc & \\ sigma\_rc & (sigma\_c)^2 & } \end{eqnarray*}\]

The covariance matrices are symmetric 2x2 matrices, whose entries in the main diagonal represent the variances of the image point in row-direction and column-direction, respectively. For each image point, a covariance matrix must be passed in CovIPcovIPcov_ip in form of a tuple with 4 elements:

\[\begin{eqnarray*} [(sigma\_r)^{2}, sigma\_rc, sigma\_rc, (sigma\_c)^{2}]. \end{eqnarray*}\]

Thus, |CovIP|=4*|Row| and CovIP[I*4:I*4+3] is the covariance matrix for the I-th image point.

The computed covariance matrix for a successfully reconstructed 3D point is represented by a symmetric 3x3 matrix:

\[\begin{eqnarray*} \qquad \textrm{CovWP} = \mvMatrix{ (sigma\_x)^2 & sigma\_xy & sigma\_xz \\ sigma\_yx & (sigma\_y)^2 & sigma\_yz \\ sigma\_zx & sigma\_zy & (sigma\_z)^2 } \end{eqnarray*}\]

The diagonal entries represent the variances of the reconstructed 3D point in x-, y-, and z-direction. The computed matrices are returned in the parameter CovWPcovWPcov_wp in form of tuples each with 9 elements:

\[\begin{eqnarray*} [(sigma\_x)^2, sigma\_xy, sigma\_xz, sigma\_yx, (sigma\_y)^2, sigma\_yz, sigma\_zx, sigma\_zy, (sigma\_z)^2]. \end{eqnarray*}\]

Thus, |CovWP|=9*|X| and CovWP[J*9:J*9+8] is the covariance matrix for the J-th 3D point. Note that if the camera setup associated with the stereo model contains the covariance matrices for the camera parameters, these covariance matrices are considered in the computation of CovWPcovWPcov_wp too.

If the stereo model has a valid bounding box set (see set_stereo_model_paramSetStereoModelParam), the resulting points are clipped to this bounding box, i.e., points outside it are not returned. If the bounding box associated with the stereo model is invalid, it is ignored and all points that could be reconstructed are returned.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

StereoModelIDstereoModelIDstereo_model_id (input_control) stereo_model → (handle)HTuple (HHandle)HStereoModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the stereo model.

Rowrowrow (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Row coordinates of the detected points.

Columncolumncolumn (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Column coordinates of the detected points.

CovIPcovIPcov_ip (input_control) number-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Covariance matrices of the detected points.

Default: [][]

CameraIdxcameraIdxcamera_idx (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Indices of the observing cameras.

Suggested values: 0, 1, 20, 1, 2

PointIdxpointIdxpoint_idx (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Indices of the observed world points.

Suggested values: 0, 1, 20, 1, 2

Xxx (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

X coordinates of the reconstructed 3D points.

Yyy (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Y coordinates of the reconstructed 3D points.

Zzz (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Z coordinates of the reconstructed 3D points.

CovWPcovWPcov_wp (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Covariance matrices of the reconstructed 3D points.

PointIdxOutpointIdxOutpoint_idx_out (output_control) number(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Indices of the reconstructed 3D points.

Combinations with other operators🔗

Combinations

Alternatives

reconstruct_surface_stereoReconstructSurfaceStereo, intersect_lines_of_sightIntersectLinesOfSight

Module🔗

3D Metrology