OpenCV  5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
Functions
Reconstruction

Detailed Description

Note
  • Notice that it is compiled only when Ceres Solver is correctly installed.
    Check installation instructions in the following tutorial: SFM module installation

Functions

void cv::sfm::reconstruct (const std::vector< String > images, OutputArray Ps, OutputArray points3d, InputOutputArray K, bool is_projective=false)
 Reconstruct 3d points from 2d images while performing autocalibration.
 
void cv::sfm::reconstruct (const std::vector< String > images, OutputArray Rs, OutputArray Ts, InputOutputArray K, OutputArray points3d, bool is_projective=false)
 Reconstruct 3d points from 2d images while performing autocalibration.
 
void cv::sfm::reconstruct (InputArrayOfArrays points2d, OutputArray Ps, OutputArray points3d, InputOutputArray K, bool is_projective=false)
 Reconstruct 3d points from 2d correspondences while performing autocalibration.
 
void cv::sfm::reconstruct (InputArrayOfArrays points2d, OutputArray Rs, OutputArray Ts, InputOutputArray K, OutputArray points3d, bool is_projective=false)
 Reconstruct 3d points from 2d correspondences while performing autocalibration.
 

Function Documentation

◆ reconstruct() [1/4]

void cv::sfm::reconstruct ( const std::vector< String images,
OutputArray  Ps,
OutputArray  points3d,
InputOutputArray  K,
bool  is_projective = false 
)

#include <opencv2/sfm/reconstruct.hpp>

Reconstruct 3d points from 2d images while performing autocalibration.

Parameters
imagesa vector of string with the images paths.
PsOutput vector with the 3x4 projections matrices of each image.
points3dOutput array with estimated 3d points.
KInput/Output camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\). Input parameters used as initial guess.
is_projectiveif true, the cameras are supposed to be projective.

This method calls below signature and extracts projection matrices from estimated K, R and t.

Note
  • The images must be ordered as they were an image sequence. Additionally, each frame should be as close as posible to the previous and posterior.
  • For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images.

◆ reconstruct() [2/4]

void cv::sfm::reconstruct ( const std::vector< String images,
OutputArray  Rs,
OutputArray  Ts,
InputOutputArray  K,
OutputArray  points3d,
bool  is_projective = false 
)

#include <opencv2/sfm/reconstruct.hpp>

Reconstruct 3d points from 2d images while performing autocalibration.

Parameters
imagesa vector of string with the images paths.
RsOutput vector of 3x3 rotations of the camera.
TsOutput vector of 3x1 translations of the camera.
points3dOutput array with estimated 3d points.
KInput/Output camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\). Input parameters used as initial guess.
is_projectiveif true, the cameras are supposed to be projective.

Internally calls libmv simple pipeline routine with some default parameters by instatiating SFMLibmvEuclideanReconstruction class.

Note
  • The images must be ordered as they were an image sequence. Additionally, each frame should be as close as posible to the previous and posterior.
  • For now DAISY features are used in order to compute the 2d points tracks and it only works for 3-4 images.
  • To see a working example for scene reconstruction, check the following tutorial: Scene Reconstruction.

◆ reconstruct() [3/4]

void cv::sfm::reconstruct ( InputArrayOfArrays  points2d,
OutputArray  Ps,
OutputArray  points3d,
InputOutputArray  K,
bool  is_projective = false 
)

#include <opencv2/sfm/reconstruct.hpp>

Reconstruct 3d points from 2d correspondences while performing autocalibration.

Parameters
points2dInput vector of vectors of 2d points (the inner vector is per image).
PsOutput vector with the 3x4 projections matrices of each image.
points3dOutput array with estimated 3d points.
KInput/Output camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\). Input parameters used as initial guess.
is_projectiveif true, the cameras are supposed to be projective.

This method calls below signature and extracts projection matrices from estimated K, R and t.

Note
  • Tracks must be as precise as possible. It does not handle outliers and is very sensible to them.

◆ reconstruct() [4/4]

void cv::sfm::reconstruct ( InputArrayOfArrays  points2d,
OutputArray  Rs,
OutputArray  Ts,
InputOutputArray  K,
OutputArray  points3d,
bool  is_projective = false 
)

#include <opencv2/sfm/reconstruct.hpp>

Reconstruct 3d points from 2d correspondences while performing autocalibration.

Parameters
points2dInput vector of vectors of 2d points (the inner vector is per image).
RsOutput vector of 3x3 rotations of the camera.
TsOutput vector of 3x1 translations of the camera.
points3dOutput array with estimated 3d points.
KInput/Output camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\). Input parameters used as initial guess.
is_projectiveif true, the cameras are supposed to be projective.

Internally calls libmv simple pipeline routine with some default parameters by instatiating SFMLibmvEuclideanReconstruction class.

Note
  • Tracks must be as precise as possible. It does not handle outliers and is very sensible to them.
  • To see a working example for camera motion reconstruction, check the following tutorial: Camera Motion Estimation.