Berkeley SfM
Public Member Functions | Protected Attributes | List of all members
bsfm::FundamentalMatrixSolver Class Referenceabstract

#include <fundamental_matrix_solver.h>

Inheritance diagram for bsfm::FundamentalMatrixSolver:
bsfm::EightPointAlgorithmSolver

Public Member Functions

 FundamentalMatrixSolver ()
 
virtual ~FundamentalMatrixSolver ()
 
virtual void AddMatchedImagePair (const PairwiseImageMatch &matched_image_data)
 
virtual void AddMatchedImagePairs (const PairwiseImageMatchList &matched_image_data)
 
virtual void SetOptions (const FundamentalMatrixSolverOptions &options)
 
virtual bool ComputeFundamentalMatrices (std::vector< Matrix3d > &fundamental_matrices)
 
virtual bool ComputeFundamentalMatrix (const FeatureMatchList &matched_features, Matrix3d &fundamental_matrix) const =0
 

Protected Attributes

PairwiseImageMatchList matched_image_data_
 
FundamentalMatrixSolverOptions options_
 

Detailed Description

Definition at line 61 of file fundamental_matrix_solver.h.

Constructor & Destructor Documentation

bsfm::FundamentalMatrixSolver::FundamentalMatrixSolver ( )
inline

Definition at line 63 of file fundamental_matrix_solver.h.

63 {}
virtual bsfm::FundamentalMatrixSolver::~FundamentalMatrixSolver ( )
inlinevirtual

Definition at line 64 of file fundamental_matrix_solver.h.

64 {}

Member Function Documentation

void bsfm::FundamentalMatrixSolver::AddMatchedImagePair ( const PairwiseImageMatch matched_image_data)
virtual

Definition at line 45 of file fundamental_matrix_solver.cpp.

46  {
47  matched_image_data_.push_back(matched_image_data);
48 }
PairwiseImageMatchList matched_image_data_
void bsfm::FundamentalMatrixSolver::AddMatchedImagePairs ( const PairwiseImageMatchList matched_image_data)
virtual

Definition at line 51 of file fundamental_matrix_solver.cpp.

52  {
54  matched_image_data.begin(),
55  matched_image_data.end());
56 }
PairwiseImageMatchList matched_image_data_
bool bsfm::FundamentalMatrixSolver::ComputeFundamentalMatrices ( std::vector< Matrix3d > &  fundamental_matrices)
virtual

Definition at line 63 of file fundamental_matrix_solver.cpp.

64  {
65  // Clear the output.
66  fundamental_matrices.clear();
67 
68  // Determine a fundamental matrix for each pair of images.
69  for (const auto& pair_data : matched_image_data_) {
70  Matrix3d fundamental_matrix;
71  if (ComputeFundamentalMatrix(pair_data.feature_matches_,
72  fundamental_matrix)) {
73  fundamental_matrices.push_back(fundamental_matrix);
74  } else {
75  VLOG(1) << "Failed to compute funamental matrix.";
76  }
77  }
78 
79  // Return whether or not we computed any fundamental matrices.
80  if (fundamental_matrices.empty()) {
81  VLOG(1) << "Unable to compute a fundamental matrix for any of the input "
82  "image pairs.";
83  return false;
84  }
85 
86  return true;
87 }
virtual bool ComputeFundamentalMatrix(const FeatureMatchList &matched_features, Matrix3d &fundamental_matrix) const =0
PairwiseImageMatchList matched_image_data_
virtual bool bsfm::FundamentalMatrixSolver::ComputeFundamentalMatrix ( const FeatureMatchList matched_features,
Matrix3d &  fundamental_matrix 
) const
pure virtual
void bsfm::FundamentalMatrixSolver::SetOptions ( const FundamentalMatrixSolverOptions options)
virtual

Definition at line 58 of file fundamental_matrix_solver.cpp.

59  {
60  options_ = options;
61 }
FundamentalMatrixSolverOptions options_

Member Data Documentation

PairwiseImageMatchList bsfm::FundamentalMatrixSolver::matched_image_data_
protected

Definition at line 92 of file fundamental_matrix_solver.h.

FundamentalMatrixSolverOptions bsfm::FundamentalMatrixSolver::options_
protected

Definition at line 95 of file fundamental_matrix_solver.h.


The documentation for this class was generated from the following files: