AliceVision
Photogrammetric Computer Vision Framework
Public Member Functions | Public Attributes | List of all members
aliceVision::sfmData::SfMData Class Reference

SfMData container Store structure and camera properties. More...

#include <SfMData.hpp>

Public Member Functions

 SfMData (const SfMData &other, bool unused)
 Copy constructor. More...
 
 SfMData (const SfMData &other, const Eigen::Vector3d &bbMin, const Eigen::Vector3d &bbMax)
 Copy constructor Use a bounding box to restrict the copied landmarks to the selected region.
 
bool operator== (const SfMData &other) const
 
bool operator!= (const SfMData &other) const
 
const ViewsgetViews () const
 Get views. More...
 
ViewsgetViews ()
 
const ImageInfosgetAncestors () const
 Get ancestors. More...
 
ImageInfosgetAncestors ()
 
const PosesgetPoses () const
 Get poses. More...
 
PosesgetPoses ()
 
const Rigs & getRigs () const
 Get rigs. More...
 
Rigs & getRigs ()
 
const IntrinsicsgetIntrinsics () const
 Get intrinsics. More...
 
IntrinsicsgetIntrinsics ()
 
const Landmarks & getLandmarks () const
 Get landmarks. More...
 
Landmarks & getLandmarks ()
 
const Constraints2D & getConstraints2D () const
 Get Constraints2D. More...
 
Constraints2D & getConstraints2D ()
 
const ConstraintsPoint & getConstraintsPoint () const
 Get ConstraintsPoints. More...
 
ConstraintsPoint & getConstraintsPoint ()
 
const SurveyPoints & getSurveyPoints () const
 Get SurveyPoints. More...
 
SurveyPoints & getSurveyPoints ()
 
const RotationPriors & getRotationPriors () const
 Get RotationPriors. More...
 
RotationPriors & getRotationPriors ()
 
const ImageGroupsgetImageGroups () const
 Get ImageGroups. More...
 
ImageGroupsgetImageGroups ()
 
const std::vector< std::string > & getRelativeFeaturesFolders () const
 Get relative features folder paths. More...
 
const std::vector< std::string > & getRelativeMatchesFolders () const
 Get relative matches folder paths. More...
 
std::vector< std::string > getFeaturesFolders () const
 Get absolute features folder paths. More...
 
std::vector< std::string > getMatchesFolders () const
 Get absolute matches folder paths. More...
 
std::set< IndexT > getValidViews () const
 List the view indexes that have valid camera intrinsic and pose. More...
 
std::set< IndexT > getReconstructedIntrinsics () const
 List the intrinsic indexes that have valid camera intrinsic and pose. More...
 
const camera::IntrinsicBasegetIntrinsicPtr (IndexT intrinsicId) const
 Return a pointer to an intrinsic if available or nullptr otherwise. More...
 
camera::IntrinsicBasegetIntrinsicPtr (IndexT intrinsicId)
 Return a pointer to an intrinsic if available or nullptr otherwise. More...
 
std::shared_ptr< camera::IntrinsicBasegetIntrinsicSharedPtr (IndexT intrinsicId)
 Return a shared pointer to an intrinsic if available or nullptr otherwise. More...
 
std::shared_ptr< camera::IntrinsicBasegetIntrinsicSharedPtr (const View &v)
 Return a shared pointer to an intrinsic if available or nullptr otherwise. More...
 
const std::shared_ptr< camera::IntrinsicBasegetIntrinsicSharedPtr (IndexT intrinsicId) const
 Return a shared pointer to an intrinsic if available or nullptr otherwise. More...
 
const std::shared_ptr< camera::IntrinsicBasegetIntrinsicSharedPtr (const View &v) const
 Return a shared pointer to an intrinsic if available or nullptr otherwise. More...
 
const camera::IntrinsicBasegetIntrinsic (IndexT intrinsicId) const
 Gives the intrinsic of the input intrinsic id. More...
 
camera::IntrinsicBasegetIntrinsic (IndexT intrinsicId)
 Gives the intrinsic of the input intrinsic id. More...
 
std::set< IndexT > getViewsKeys () const
 Get a set of views keys. More...
 
bool isIntrinsicDefined (const View &view) const
 Check if the given view has defined intrinsic and pose. More...
 
bool isIntrinsicDefined (IndexT viewId) const
 Check if the given view has defined intrinsic and pose. More...
 
bool isPoseDefined (const View &view) const
 Check if the given view has a valid pose. More...
 
bool isPoseDefined (IndexT viewId) const
 Check if the given view has a defined pose. More...
 
bool isPoseAndIntrinsicDefined (const View &view) const
 Check if the given view has defined intrinsic. More...
 
bool isPoseAndIntrinsicDefined (const View *view) const
 Check if the given view has defined intrinsic. More...
 
bool isPoseAndIntrinsicDefined (IndexT viewId) const
 Check if the given view has defined intrinsic and pose. More...
 
bool existsPose (const View &view) const
 Check if the given view has an existing pose. More...
 
const ViewgetView (IndexT viewId) const
 Gives the view of the input view id. More...
 
ViewgetView (IndexT viewId)
 Gives the view of the input view id. More...
 
const View::ptr getViewPtr (IndexT viewId) const
 Gives the view of the input view id. More...
 
View::ptr getViewPtr (IndexT viewId)
 Gives the view of the input view id. More...
 
View::sptr getViewSharedPtr (IndexT viewId)
 Gives the view of the input view id. More...
 
const View::sptr getViewSharedPtr (IndexT viewId) const
 Gives the view of the input view id. More...
 
IndexT findView (const std::string &imageName) const
 Retrieve the view id in the sfmData from the image filename. More...
 
CameraPose getPose (const View &view) const
 Gives the pose of the input view. If this view is part of a rig, it returns rigPose + rigSubPose. More...
 
const CameraPosegetAbsolutePose (IndexT poseId) const
 Gives the pose with the given pose id. More...
 
CameraPosegetAbsolutePose (IndexT poseId)
 Gives the pose with the given pose id. More...
 
const RiggetRig (const View &view) const
 Get the rig of the given view. More...
 
std::set< feature::EImageDescriberType > getLandmarkDescTypes () const
 
std::map< feature::EImageDescriberType, int > getLandmarkDescTypesUsages () const
 
ExposureSetting getMedianCameraExposureSetting () const
 Get the median Camera Exposure Setting. More...
 
void addFeaturesFolder (const std::string &folder)
 Add the given folder to features folders. More...
 
void addFeaturesFolders (const std::vector< std::string > &folders)
 Add the given folders to features folders. More...
 
void addMatchesFolder (const std::string &folder)
 Add the given folder to matches folders. More...
 
void addMatchesFolders (const std::vector< std::string > &folders)
 Add the given folders to matches folders. More...
 
void setFeaturesFolders (const std::vector< std::string > &folders)
 Replace the current features folders by the given ones. More...
 
void setMatchesFolders (const std::vector< std::string > &folders)
 Replace the current matches folders by the given ones. More...
 
void setAbsolutePath (const std::string &path)
 Set the SfMData file absolute path. More...
 
void setPose (const View &view, const CameraPose &pose)
 Set the given pose for the given view if the view is part of a rig, this method update rig pose/sub-pose. More...
 
void setAbsolutePose (IndexT poseId, const CameraPose &pose)
 Set the given pose for the given poseId. More...
 
void erasePose (IndexT poseId, bool noThrow=false)
 Erase the pose for the given poseId. More...
 
void resetRigs ()
 Reset rigs sub-poses parameters.
 
void addAncestor (IndexT ancestorId, std::shared_ptr< ImageInfo > image)
 Add an ancestor image. More...
 
void combine (const SfMData &sfmData)
 Insert data from the given sfmData if possible. note: This operation doesn't override existing data. More...
 
void clear ()
 Remove everything in this sfmData.
 
void removeUnusedImageGroups ()
 Remove image groups which are unused.
 
void removeUnusedIntrinsics ()
 Remove intrinsics which are unused.
 
void removeUnusedCameraPoses ()
 Remove poses which are unused.
 
void removeInvalidObservations ()
 Remove observations pointing to invalid views.
 
void removeUnusedLandmarks ()
 Remove landmarks without any observations.
 
void repair ()
 repair the sfmData by removing everything that is unused or invalid
 
void resetParameterStates ()
 
void getBoundingBox (Eigen::Vector3d &bbMin, Eigen::Vector3d &bbMax)
 
bool isFullyReconstructed () const
 

Public Attributes

PosesUncertainty _posesUncertainty
 Uncertainty per pose.
 
LandmarksUncertainty _landmarksUncertainty
 Uncertainty per landmark.
 

Detailed Description

SfMData container Store structure and camera properties.

Constructor & Destructor Documentation

◆ SfMData()

aliceVision::sfmData::SfMData::SfMData ( const SfMData other,
bool  unused 
)

Copy constructor.

Parameters
otherthe copied sfmData
unuseda parameter to make sure we explicitly want this copy (for legacy)

Member Function Documentation

◆ addAncestor()

void aliceVision::sfmData::SfMData::addAncestor ( IndexT  ancestorId,
std::shared_ptr< ImageInfo image 
)
inline

Add an ancestor image.

Parameters
[in]ancestorIdThe ID of the ancestor that will be added
[in]imageThe image that will be added as the ancestor

◆ addFeaturesFolder()

void aliceVision::sfmData::SfMData::addFeaturesFolder ( const std::string &  folder)
inline

Add the given folder to features folders.

Note
If SfmData's absolutePath has been set, an absolute path will be converted to a relative one.
Parameters
[in]folderpath to a folder containing features

◆ addFeaturesFolders()

void aliceVision::sfmData::SfMData::addFeaturesFolders ( const std::vector< std::string > &  folders)

Add the given folders to features folders.

Note
If SfmData's absolutePath has been set, absolute paths will be converted to relative ones.
Parameters
[in]folderspaths to folders containing features

◆ addMatchesFolder()

void aliceVision::sfmData::SfMData::addMatchesFolder ( const std::string &  folder)
inline

Add the given folder to matches folders.

Note
If SfmData's absolutePath has been set, an absolute path will be converted to a relative one.
Parameters
[in]folderpath to a folder containing matches

◆ addMatchesFolders()

void aliceVision::sfmData::SfMData::addMatchesFolders ( const std::vector< std::string > &  folders)

Add the given folders to matches folders.

Note
If SfmData's absolutePath has been set, absolute paths will be converted to relative ones.
Parameters
[in]folderspaths to folders containing matches

◆ combine()

void aliceVision::sfmData::SfMData::combine ( const SfMData sfmData)

Insert data from the given sfmData if possible. note: This operation doesn't override existing data.

Parameters
[in]sfmDataA given SfMData

◆ erasePose()

void aliceVision::sfmData::SfMData::erasePose ( IndexT  poseId,
bool  noThrow = false 
)
inline

Erase the pose for the given poseId.

Parameters
[in]poseIdThe given poseId
[in]noThrowIf false, throw exception if no pose found

◆ existsPose()

bool aliceVision::sfmData::SfMData::existsPose ( const View view) const
inline

Check if the given view has an existing pose.

Parameters
[in]viewThe given view
Returns
true if the pose exists

◆ findView()

IndexT aliceVision::sfmData::SfMData::findView ( const std::string &  imageName) const

Retrieve the view id in the sfmData from the image filename.

Parameters
[in]namethe image name to find (uid or filename or path)
Returns
a view Id if a view is found or UndefinedIndexT

◆ getAbsolutePose() [1/2]

CameraPose& aliceVision::sfmData::SfMData::getAbsolutePose ( IndexT  poseId)
inline

Gives the pose with the given pose id.

Parameters
[in]poseIdThe given pose id

◆ getAbsolutePose() [2/2]

const CameraPose& aliceVision::sfmData::SfMData::getAbsolutePose ( IndexT  poseId) const
inline

Gives the pose with the given pose id.

Parameters
[in]poseIdThe given pose id

◆ getAncestors()

const ImageInfos& aliceVision::sfmData::SfMData::getAncestors ( ) const
inline

Get ancestors.

Returns
ancestors

◆ getBoundingBox()

void aliceVision::sfmData::SfMData::getBoundingBox ( Eigen::Vector3d &  bbMin,
Eigen::Vector3d &  bbMax 
)

Compute the landmarks axis aligned bounding box

Parameters
bbMinthe output minimal values of the bounding box
bbMaxthe output maximal values of the bounding box

◆ getConstraints2D()

const Constraints2D& aliceVision::sfmData::SfMData::getConstraints2D ( ) const
inline

Get Constraints2D.

Returns
Constraints2D

◆ getConstraintsPoint()

const ConstraintsPoint& aliceVision::sfmData::SfMData::getConstraintsPoint ( ) const
inline

Get ConstraintsPoints.

Returns
ConstraintsPoints

◆ getFeaturesFolders()

std::vector< std::string > aliceVision::sfmData::SfMData::getFeaturesFolders ( ) const

Get absolute features folder paths.

Returns
features folders paths

◆ getImageGroups()

const ImageGroups& aliceVision::sfmData::SfMData::getImageGroups ( ) const
inline

Get ImageGroups.

Returns
ImageGroups

◆ getIntrinsic() [1/2]

camera::IntrinsicBase& aliceVision::sfmData::SfMData::getIntrinsic ( IndexT  intrinsicId)
inline

Gives the intrinsic of the input intrinsic id.

Parameters
[in]intrinsicIdThe given intrinsic ID
Returns
the corresponding intrinsic reference

◆ getIntrinsic() [2/2]

const camera::IntrinsicBase& aliceVision::sfmData::SfMData::getIntrinsic ( IndexT  intrinsicId) const
inline

Gives the intrinsic of the input intrinsic id.

Parameters
[in]intrinsicIdThe given intrinsic ID
Returns
the corresponding intrinsic reference

◆ getIntrinsicPtr() [1/2]

camera::IntrinsicBase* aliceVision::sfmData::SfMData::getIntrinsicPtr ( IndexT  intrinsicId)
inline

Return a pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]intrinsicIdthe ID of the intrinsic to get

◆ getIntrinsicPtr() [2/2]

const camera::IntrinsicBase* aliceVision::sfmData::SfMData::getIntrinsicPtr ( IndexT  intrinsicId) const
inline

Return a pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]intrinsicIdthe ID of the intrinsic to get

◆ getIntrinsics()

const Intrinsics& aliceVision::sfmData::SfMData::getIntrinsics ( ) const
inline

Get intrinsics.

Returns
intrinsics

◆ getIntrinsicSharedPtr() [1/4]

std::shared_ptr<camera::IntrinsicBase> aliceVision::sfmData::SfMData::getIntrinsicSharedPtr ( const View v)
inline

Return a shared pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]vthe view to get the intrinsic from

◆ getIntrinsicSharedPtr() [2/4]

const std::shared_ptr<camera::IntrinsicBase> aliceVision::sfmData::SfMData::getIntrinsicSharedPtr ( const View v) const
inline

Return a shared pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]vthe view to get the intrinsic from

◆ getIntrinsicSharedPtr() [3/4]

std::shared_ptr<camera::IntrinsicBase> aliceVision::sfmData::SfMData::getIntrinsicSharedPtr ( IndexT  intrinsicId)
inline

Return a shared pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]intrinsicIdthe ID of the intrinsic to get

◆ getIntrinsicSharedPtr() [4/4]

const std::shared_ptr<camera::IntrinsicBase> aliceVision::sfmData::SfMData::getIntrinsicSharedPtr ( IndexT  intrinsicId) const
inline

Return a shared pointer to an intrinsic if available or nullptr otherwise.

Parameters
[in]intrinsicIdthe ID of the intrinsic to get

◆ getLandmarks()

const Landmarks& aliceVision::sfmData::SfMData::getLandmarks ( ) const
inline

Get landmarks.

Returns
landmarks

◆ getMatchesFolders()

std::vector< std::string > aliceVision::sfmData::SfMData::getMatchesFolders ( ) const

Get absolute matches folder paths.

Returns
matches folder paths

◆ getMedianCameraExposureSetting()

ExposureSetting aliceVision::sfmData::SfMData::getMedianCameraExposureSetting ( ) const
inline

Get the median Camera Exposure Setting.

Returns

◆ getPose()

CameraPose aliceVision::sfmData::SfMData::getPose ( const View view) const
inline

Gives the pose of the input view. If this view is part of a rig, it returns rigPose + rigSubPose.

Parameters
[in]viewThe given view
Warning
: This function returns a CameraPose (a temporary object and not a reference), because in the RIG context, this pose is the composition of the rig pose and the sub-pose.

◆ getPoses()

const Poses& aliceVision::sfmData::SfMData::getPoses ( ) const
inline

Get poses.

Returns
poses

◆ getReconstructedIntrinsics()

std::set< IndexT > aliceVision::sfmData::SfMData::getReconstructedIntrinsics ( ) const

List the intrinsic indexes that have valid camera intrinsic and pose.

Returns
intrinsic indexes list

◆ getRelativeFeaturesFolders()

const std::vector<std::string>& aliceVision::sfmData::SfMData::getRelativeFeaturesFolders ( ) const
inline

Get relative features folder paths.

Returns
features folders paths

◆ getRelativeMatchesFolders()

const std::vector<std::string>& aliceVision::sfmData::SfMData::getRelativeMatchesFolders ( ) const
inline

Get relative matches folder paths.

Returns
matches folder paths

◆ getRig()

const Rig& aliceVision::sfmData::SfMData::getRig ( const View view) const
inline

Get the rig of the given view.

Parameters
[in]viewThe given view
Returns
rig of the given view

◆ getRigs()

const Rigs& aliceVision::sfmData::SfMData::getRigs ( ) const
inline

Get rigs.

Returns
rigs

◆ getRotationPriors()

const RotationPriors& aliceVision::sfmData::SfMData::getRotationPriors ( ) const
inline

Get RotationPriors.

Returns
RotationPriors

◆ getSurveyPoints()

const SurveyPoints& aliceVision::sfmData::SfMData::getSurveyPoints ( ) const
inline

Get SurveyPoints.

Returns
SurveyPoints

◆ getValidViews()

std::set< IndexT > aliceVision::sfmData::SfMData::getValidViews ( ) const

List the view indexes that have valid camera intrinsic and pose.

Returns
view indexes list

◆ getView() [1/2]

View& aliceVision::sfmData::SfMData::getView ( IndexT  viewId)
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view reference

◆ getView() [2/2]

const View& aliceVision::sfmData::SfMData::getView ( IndexT  viewId) const
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view reference

◆ getViewPtr() [1/2]

View::ptr aliceVision::sfmData::SfMData::getViewPtr ( IndexT  viewId)
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view ptr

◆ getViewPtr() [2/2]

const View::ptr aliceVision::sfmData::SfMData::getViewPtr ( IndexT  viewId) const
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view ptr

◆ getViews()

const Views& aliceVision::sfmData::SfMData::getViews ( ) const
inline

Get views.

Returns
views

◆ getViewSharedPtr() [1/2]

View::sptr aliceVision::sfmData::SfMData::getViewSharedPtr ( IndexT  viewId)
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view ptr

◆ getViewSharedPtr() [2/2]

const View::sptr aliceVision::sfmData::SfMData::getViewSharedPtr ( IndexT  viewId) const
inline

Gives the view of the input view id.

Parameters
[in]viewIdThe given view ID
Returns
the corresponding view ptr

◆ getViewsKeys()

std::set<IndexT> aliceVision::sfmData::SfMData::getViewsKeys ( ) const
inline

Get a set of views keys.

Returns
set of views keys

◆ isFullyReconstructed()

bool aliceVision::sfmData::SfMData::isFullyReconstructed ( ) const

Are all views fully estimated ?

Returns
true if no views have invalid pose or intrinsic

◆ isIntrinsicDefined() [1/2]

bool aliceVision::sfmData::SfMData::isIntrinsicDefined ( const View view) const
inline

Check if the given view has defined intrinsic and pose.

Parameters
[in]viewThe given view
Returns
true if intrinsic defined

◆ isIntrinsicDefined() [2/2]

bool aliceVision::sfmData::SfMData::isIntrinsicDefined ( IndexT  viewId) const
inline

Check if the given view has defined intrinsic and pose.

Parameters
[in]viewIDThe given viewID
Returns
true if intrinsic and pose defined

◆ isPoseAndIntrinsicDefined() [1/3]

bool aliceVision::sfmData::SfMData::isPoseAndIntrinsicDefined ( const View view) const
inline

Check if the given view has defined intrinsic.

Parameters
[in]viewThe given view
Returns
true if intrinsic and pose defined

◆ isPoseAndIntrinsicDefined() [2/3]

bool aliceVision::sfmData::SfMData::isPoseAndIntrinsicDefined ( const View view) const
inline

Check if the given view has defined intrinsic.

Parameters
[in]viewThe given view
Returns
true if intrinsic and pose defined

◆ isPoseAndIntrinsicDefined() [3/3]

bool aliceVision::sfmData::SfMData::isPoseAndIntrinsicDefined ( IndexT  viewId) const
inline

Check if the given view has defined intrinsic and pose.

Parameters
[in]viewIDThe given view ID
Returns
true if intrinsic and pose defined

◆ isPoseDefined() [1/2]

bool aliceVision::sfmData::SfMData::isPoseDefined ( const View view) const
inline

Check if the given view has a valid pose.

Parameters
[in]viewThe given view
Returns
true if pose defined

◆ isPoseDefined() [2/2]

bool aliceVision::sfmData::SfMData::isPoseDefined ( IndexT  viewId) const
inline

Check if the given view has a defined pose.

Parameters
[in]viewIDThe given viewID
Returns
true if pose defined

◆ resetParameterStates()

void aliceVision::sfmData::SfMData::resetParameterStates ( )

@Brief For all required items, update the state with respect to the associated lock

◆ setAbsolutePath()

void aliceVision::sfmData::SfMData::setAbsolutePath ( const std::string &  path)

Set the SfMData file absolute path.

Note
Internal relative features/matches folders will be remapped to be relative to the new absolute path.
Parameters
[in]pathThe absolute path to the SfMData file folder

◆ setAbsolutePose()

void aliceVision::sfmData::SfMData::setAbsolutePose ( IndexT  poseId,
const CameraPose pose 
)
inline

Set the given pose for the given poseId.

Parameters
[in]poseIdThe given poseId
[in]poseThe given pose

◆ setFeaturesFolders()

void aliceVision::sfmData::SfMData::setFeaturesFolders ( const std::vector< std::string > &  folders)
inline

Replace the current features folders by the given ones.

Note
If SfmData's absolutePath has been set, absolute paths will be converted to relative ones.
Parameters
[in]folderspaths to folders containing features

◆ setMatchesFolders()

void aliceVision::sfmData::SfMData::setMatchesFolders ( const std::vector< std::string > &  folders)
inline

Replace the current matches folders by the given ones.

Note
If SfmData's absolutePath has been set, absolute paths will be converted to relative ones.
Parameters
[in]folderspaths to folders containing matches

◆ setPose()

void aliceVision::sfmData::SfMData::setPose ( const View view,
const CameraPose pose 
)

Set the given pose for the given view if the view is part of a rig, this method update rig pose/sub-pose.

Parameters
[in]viewThe given view
[in]poseThe given pose

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