| OpenCV 3.4.8 Open Source Computer Vision

Functions
Reconstruction
Structure From Motion

## Functions
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. More...
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. More...
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. More...
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. More...

## 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

## Function Documentation

## § reconstruct() [1/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

  points2d | Input vector of vectors of 2d points (the inner vector is per image).
  Ps | Output vector with the 3x4 projections matrices of each image.
  points3d | Output array with estimated 3d points.
  K | Input/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_projective | if 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() [2/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

  points2d | Input vector of vectors of 2d points (the inner vector is per image).
  Rs | Output vector of 3x3 rotations of the camera.
  Ts | Output vector of 3x1 translations of the camera.
  points3d | Output array with estimated 3d points.
  K | Input/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_projective | if 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.

## § reconstruct() [3/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

  images | a vector of string with the images paths.
  Ps | Output vector with the 3x4 projections matrices of each image.
  points3d | Output array with estimated 3d points.
  K | Input/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_projective | if 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() [4/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

  images | a vector of string with the images paths.
  Rs | Output vector of 3x3 rotations of the camera.
  Ts | Output vector of 3x1 translations of the camera.
  points3d | Output array with estimated 3d points.
  K | Input/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_projective | if 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.