![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <database.h>
Public Member Functions | |
| Database () | |
| Database (const std::string &path) | |
| ~Database () | |
| void | Open (const std::string &path) |
| void | Close () |
| bool | ExistsCamera (const camera_t camera_id) const |
| bool | ExistsImage (const image_t image_id) const |
| bool | ExistsImageWithName (std::string name) const |
| bool | ExistsKeypoints (const image_t image_id) const |
| bool | ExistsDescriptors (const image_t image_id) const |
| bool | ExistsMatches (const image_t image_id1, const image_t image_id2) const |
| bool | ExistsInlierMatches (const image_t image_id1, const image_t image_id2) const |
| size_t | NumCameras () const |
| size_t | NumImages () const |
| size_t | NumKeypoints () const |
| size_t | MaxNumKeypoints () const |
| size_t | NumKeypointsForImage (const image_t image_id) const |
| size_t | NumDescriptors () const |
| size_t | MaxNumDescriptors () const |
| size_t | NumDescriptorsForImage (const image_t image_id) const |
| size_t | NumMatches () const |
| size_t | NumInlierMatches () const |
| size_t | NumMatchedImagePairs () const |
| size_t | NumVerifiedImagePairs () const |
| Camera | ReadCamera (const camera_t camera_id) const |
| std::vector< Camera > | ReadAllCameras () const |
| Image | ReadImage (const image_t image_id) const |
| Image | ReadImageWithName (const std::string &name) const |
| std::vector< Image > | ReadAllImages () const |
| FeatureKeypoints | ReadKeypoints (const image_t image_id) const |
| FeatureDescriptors | ReadDescriptors (const image_t image_id) const |
| FeatureMatches | ReadMatches (const image_t image_id1, const image_t image_id2) const |
| std::vector< std::pair< image_pair_t, FeatureMatches > > | ReadAllMatches () const |
| TwoViewGeometry | ReadTwoViewGeometry (const image_t image_id1, const image_t image_id2) const |
| void | ReadTwoViewGeometries (std::vector< image_pair_t > *image_pair_ids, std::vector< TwoViewGeometry > *two_view_geometries) const |
| void | ReadTwoViewGeometryNumInliers (std::vector< std::pair< image_t, image_t >> *image_pairs, std::vector< int > *num_inliers) const |
| camera_t | WriteCamera (const Camera &camera, const bool use_camera_id=false) const |
| image_t | WriteImage (const Image &image, const bool use_image_id=false) const |
| void | WriteKeypoints (const image_t image_id, const FeatureKeypoints &keypoints) const |
| void | WriteDescriptors (const image_t image_id, const FeatureDescriptors &descriptors) const |
| void | WriteMatches (const image_t image_id1, const image_t image_id2, const FeatureMatches &matches) const |
| void | WriteTwoViewGeometry (const image_t image_id1, const image_t image_id2, const TwoViewGeometry &two_view_geometry) const |
| void | UpdateCamera (const Camera &camera) const |
| void | UpdateImage (const Image &image) const |
| void | DeleteMatches (const image_t image_id1, const image_t image_id2) const |
| void | DeleteInlierMatches (const image_t image_id1, const image_t image_id2) const |
| void | ClearAllTables () const |
| void | ClearCameras () const |
| void | ClearImages () const |
| void | ClearDescriptors () const |
| void | ClearKeypoints () const |
| void | ClearMatches () const |
| void | ClearTwoViewGeometries () const |
Static Public Member Functions | |
| static image_pair_t | ImagePairToPairId (const image_t image_id1, const image_t image_id2) |
| static void | PairIdToImagePair (const image_pair_t pair_id, image_t *image_id1, image_t *image_id2) |
| static bool | SwapImagePair (const image_t image_id1, const image_t image_id2) |
| static void | Merge (const Database &database1, const Database &database2, Database *merged_database) |
Static Public Attributes | |
| static const int | kSchemaVersion = 1 |
| static const size_t | kMaxNumImages |
Definition at line 29 of file database.h.
| colmap::Database::Database | ( | ) |
Definition at line 248 of file database.cc.
|
explicit |
Definition at line 250 of file database.cc.
References Open(), and cloudViewer::t::geometry::path.
| colmap::Database::~Database | ( | ) |
Definition at line 252 of file database.cc.
References Close().
| void colmap::Database::ClearAllTables | ( | ) | const |
Definition at line 827 of file database.cc.
References ClearCameras(), ClearDescriptors(), ClearImages(), ClearKeypoints(), ClearMatches(), and ClearTwoViewGeometries().
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::RunDatabaseCleaner().
| void colmap::Database::ClearCameras | ( | ) | const |
Definition at line 836 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and ClearAllTables().
| void colmap::Database::ClearDescriptors | ( | ) | const |
Definition at line 846 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), ClearAllTables(), and colmap::RunDatabaseCleaner().
| void colmap::Database::ClearImages | ( | ) | const |
Definition at line 841 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), ClearAllTables(), and colmap::RunDatabaseCleaner().
| void colmap::Database::ClearKeypoints | ( | ) | const |
Definition at line 851 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), ClearAllTables(), and colmap::RunDatabaseCleaner().
| void colmap::Database::ClearMatches | ( | ) | const |
Definition at line 856 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), ClearAllTables(), and colmap::RunDatabaseCleaner().
| void colmap::Database::ClearTwoViewGeometries | ( | ) | const |
Definition at line 861 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), ClearAllTables(), and colmap::RunDatabaseCleaner().
| void colmap::Database::Close | ( | ) |
Definition at line 286 of file database.cc.
References SQLITE3_EXEC.
Referenced by BOOST_AUTO_TEST_CASE(), Open(), and ~Database().
| void colmap::Database::DeleteInlierMatches | ( | const image_t | image_id1, |
| const image_t | image_id2 | ||
| ) | const |
Definition at line 818 of file database.cc.
References ImagePairToPairId(), and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::FeatureMatcherCache::DeleteInlierMatches().
Definition at line 809 of file database.cc.
References ImagePairToPairId(), and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::FeatureMatcherCache::DeleteMatches().
| bool colmap::Database::ExistsCamera | ( | const camera_t | camera_id | ) | const |
Definition at line 295 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), and WriteCamera().
| bool colmap::Database::ExistsDescriptors | ( | const image_t | image_id | ) | const |
Definition at line 311 of file database.cc.
Referenced by colmap::ImageReader::Next(), and colmap::FeatureMatcherCache::Setup().
| bool colmap::Database::ExistsImage | ( | const image_t | image_id | ) | const |
Definition at line 299 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), and WriteImage().
| bool colmap::Database::ExistsImageWithName | ( | std::string | name | ) | const |
Definition at line 303 of file database.cc.
References name.
Referenced by Merge(), colmap::ImageReader::Next(), and colmap::Reconstruction::TranscribeImageIdsToDatabase().
| bool colmap::Database::ExistsInlierMatches | ( | const image_t | image_id1, |
| const image_t | image_id2 | ||
| ) | const |
Definition at line 321 of file database.cc.
References ImagePairToPairId().
Referenced by colmap::FeatureMatcherCache::ExistsInlierMatches(), and colmap::TwoViewGeometriesTab::Reload().
| bool colmap::Database::ExistsKeypoints | ( | const image_t | image_id | ) | const |
Definition at line 307 of file database.cc.
Referenced by colmap::ImageReader::Next(), and colmap::FeatureMatcherCache::Setup().
Definition at line 315 of file database.cc.
References ImagePairToPairId().
Referenced by BOOST_AUTO_TEST_CASE(), colmap::FeatureMatcherCache::ExistsMatches(), and colmap::MatchesTab::Reload().
|
inlinestatic |
Definition at line 339 of file database.h.
References kMaxNumImages, and SwapImagePair().
Referenced by colmap::CorrespondenceGraph::AddCorrespondences(), BOOST_AUTO_TEST_CASE(), DeleteInlierMatches(), DeleteMatches(), ExistsInlierMatches(), ExistsMatches(), colmap::IncrementalMapper::FindInitialImagePair(), colmap::Reconstruction::ImagePair(), colmap::SiftFeatureMatcher::Match(), colmap::CorrespondenceGraph::NumCorrespondencesBetweenImages(), ReadMatches(), ReadTwoViewGeometry(), colmap::IncrementalMapper::RegisterInitialImagePair(), WriteMatches(), and WriteTwoViewGeometry().
| size_t colmap::Database::MaxNumDescriptors | ( | ) | const |
Definition at line 345 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::MaxNumKeypoints | ( | ) | const |
Definition at line 333 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 866 of file database.cc.
References descriptors, ExistsImageWithName(), image, PairIdToImagePair(), ReadAllCameras(), ReadAllImages(), ReadAllMatches(), ReadDescriptors(), ReadKeypoints(), ReadTwoViewGeometries(), WriteCamera(), WriteDescriptors(), WriteImage(), WriteKeypoints(), WriteMatches(), and WriteTwoViewGeometry().
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::RunDatabaseMerger().
| size_t colmap::Database::NumCameras | ( | ) | const |
Definition at line 327 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), cloudViewer::CameraTab::Reload(), and colmap::CameraTab::Reload().
| size_t colmap::Database::NumDescriptors | ( | ) | const |
Definition at line 341 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::NumDescriptorsForImage | ( | const image_t | image_id | ) | const |
Definition at line 349 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::NumImages | ( | ) | const |
Definition at line 329 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), ReadAllImages(), cloudViewer::ImageTab::Reload(), colmap::ImageTab::Reload(), cloudViewer::MatchMatrixWidget::Show(), and colmap::MatchMatrixWidget::Show().
| size_t colmap::Database::NumInlierMatches | ( | ) | const |
Definition at line 355 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), and ReadTwoViewGeometryNumInliers().
| size_t colmap::Database::NumKeypoints | ( | ) | const |
Definition at line 331 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE(), cloudViewer::ImageTab::Reload(), and colmap::ImageTab::Reload().
| size_t colmap::Database::NumKeypointsForImage | ( | const image_t | image_id | ) | const |
Definition at line 337 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::NumMatchedImagePairs | ( | ) | const |
Definition at line 359 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::NumMatches | ( | ) | const |
Definition at line 353 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| size_t colmap::Database::NumVerifiedImagePairs | ( | ) | const |
Definition at line 361 of file database.cc.
Referenced by BOOST_AUTO_TEST_CASE().
| void colmap::Database::Open | ( | const std::string & | path | ) |
Definition at line 254 of file database.cc.
References Close(), cloudViewer::t::geometry::path, SQLITE3_CALL, and SQLITE3_EXEC.
Referenced by Database().
|
inlinestatic |
Definition at line 352 of file database.h.
References kMaxNumImages.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::DatabaseCache::Load(), Merge(), ReadTwoViewGeometryNumInliers(), and colmap::IncrementalTriangulator::Retriangulate().
| std::vector< Camera > colmap::Database::ReadAllCameras | ( | ) | const |
Definition at line 380 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::DatabaseCache::Load(), Merge(), cloudViewer::CameraTab::Reload(), and colmap::CameraTab::Reload().
| std::vector< Image > colmap::Database::ReadAllImages | ( | ) | const |
Definition at line 423 of file database.cc.
References NumImages(), and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::DatabaseCache::Load(), Merge(), cloudViewer::ImageTab::Reload(), colmap::ImageTab::Reload(), cloudViewer::MatchMatrixWidget::Show(), and colmap::MatchMatrixWidget::Show().
| std::vector< std::pair< image_pair_t, FeatureMatches > > colmap::Database::ReadAllMatches | ( | ) | const |
Definition at line 479 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and Merge().
Definition at line 365 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::ImageReader::Next().
| FeatureDescriptors colmap::Database::ReadDescriptors | ( | const image_t | image_id | ) | const |
Definition at line 448 of file database.cc.
References descriptors, and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), Merge(), colmap::RunVocabTreeRetriever(), and colmap::FeatureMatcherCache::Setup().
Definition at line 392 of file database.cc.
References image, and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE().
| Image colmap::Database::ReadImageWithName | ( | const std::string & | name | ) | const |
Definition at line 407 of file database.cc.
References image, name, and SQLITE3_CALL.
Referenced by colmap::ImageReader::Next(), and colmap::Reconstruction::TranscribeImageIdsToDatabase().
| FeatureKeypoints colmap::Database::ReadKeypoints | ( | const image_t | image_id | ) | const |
Definition at line 436 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::DatabaseCache::Load(), Merge(), colmap::RunVocabTreeRetriever(), colmap::FeatureMatcherCache::Setup(), cloudViewer::TwoViewInfoTab::ShowMatches(), and colmap::TwoViewInfoTab::ShowMatches().
| FeatureMatches colmap::Database::ReadMatches | ( | const image_t | image_id1, |
| const image_t | image_id2 | ||
| ) | const |
Definition at line 461 of file database.cc.
References ImagePairToPairId(), SQLITE3_CALL, and SwapImagePair().
Referenced by BOOST_AUTO_TEST_CASE(), colmap::FeatureMatcherCache::GetMatches(), and colmap::MatchesTab::Reload().
| void colmap::Database::ReadTwoViewGeometries | ( | std::vector< image_pair_t > * | image_pair_ids, |
| std::vector< TwoViewGeometry > * | two_view_geometries | ||
| ) | const |
Definition at line 539 of file database.cc.
References colmap::TwoViewGeometry::config, colmap::TwoViewGeometry::E, colmap::TwoViewGeometry::F, colmap::TwoViewGeometry::H, colmap::TwoViewGeometry::inlier_matches, colmap::TwoViewGeometry::qvec, SQLITE3_CALL, and colmap::TwoViewGeometry::tvec.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::DatabaseCache::Load(), and Merge().
| TwoViewGeometry colmap::Database::ReadTwoViewGeometry | ( | const image_t | image_id1, |
| const image_t | image_id2 | ||
| ) | const |
Definition at line 498 of file database.cc.
References colmap::TwoViewGeometry::config, colmap::TwoViewGeometry::E, colmap::TwoViewGeometry::F, colmap::TwoViewGeometry::H, ImagePairToPairId(), colmap::TwoViewGeometry::inlier_matches, colmap::TwoViewGeometry::Invert(), colmap::TwoViewGeometry::qvec, SQLITE3_CALL, SwapImagePair(), and colmap::TwoViewGeometry::tvec.
Referenced by BOOST_AUTO_TEST_CASE(), and colmap::TwoViewGeometriesTab::Reload().
| void colmap::Database::ReadTwoViewGeometryNumInliers | ( | std::vector< std::pair< image_t, image_t >> * | image_pairs, |
| std::vector< int > * | num_inliers | ||
| ) | const |
Definition at line 579 of file database.cc.
References NumInlierMatches(), PairIdToImagePair(), and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), colmap::SceneClustering::Create(), cloudViewer::MatchMatrixWidget::Show(), and colmap::MatchMatrixWidget::Show().
|
inlinestatic |
Definition at line 366 of file database.h.
Referenced by BOOST_AUTO_TEST_CASE(), ImagePairToPairId(), ReadMatches(), ReadTwoViewGeometry(), WriteMatches(), and WriteTwoViewGeometry().
| void colmap::Database::UpdateCamera | ( | const Camera & | camera | ) | const |
Definition at line 760 of file database.cc.
References colmap::Camera::CameraId(), colmap::Camera::HasPriorFocalLength(), colmap::Camera::Height(), colmap::Camera::ModelId(), colmap::Camera::NumParams(), colmap::Camera::ParamsData(), SQLITE3_CALL, and colmap::Camera::Width().
Referenced by BOOST_AUTO_TEST_CASE().
| void colmap::Database::UpdateImage | ( | const Image & | image | ) | const |
Definition at line 783 of file database.cc.
References image, and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE().
| camera_t colmap::Database::WriteCamera | ( | const Camera & | camera, |
| const bool | use_camera_id = false |
||
| ) | const |
Definition at line 603 of file database.cc.
References colmap::Camera::CameraId(), ExistsCamera(), colmap::Camera::HasPriorFocalLength(), colmap::Camera::Height(), colmap::Camera::ModelId(), colmap::Camera::NumParams(), colmap::Camera::ParamsData(), SQLITE3_CALL, and colmap::Camera::Width().
Referenced by BOOST_AUTO_TEST_CASE(), Merge(), and colmap::ImageReader::Next().
| void colmap::Database::WriteDescriptors | ( | const image_t | image_id, |
| const FeatureDescriptors & | descriptors | ||
| ) | const |
Definition at line 676 of file database.cc.
References descriptors, and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and Merge().
Definition at line 633 of file database.cc.
References ExistsImage(), image, and SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and Merge().
| void colmap::Database::WriteKeypoints | ( | const image_t | image_id, |
| const FeatureKeypoints & | keypoints | ||
| ) | const |
Definition at line 665 of file database.cc.
References SQLITE3_CALL.
Referenced by BOOST_AUTO_TEST_CASE(), and Merge().
| void colmap::Database::WriteMatches | ( | const image_t | image_id1, |
| const image_t | image_id2, | ||
| const FeatureMatches & | matches | ||
| ) | const |
Definition at line 685 of file database.cc.
References ImagePairToPairId(), SQLITE3_CALL, and SwapImagePair().
Referenced by BOOST_AUTO_TEST_CASE(), Merge(), and colmap::FeatureMatcherCache::WriteMatches().
| void colmap::Database::WriteTwoViewGeometry | ( | const image_t | image_id1, |
| const image_t | image_id2, | ||
| const TwoViewGeometry & | two_view_geometry | ||
| ) | const |
Definition at line 703 of file database.cc.
References colmap::TwoViewGeometry::config, colmap::TwoViewGeometry::E, colmap::TwoViewGeometry::F, colmap::TwoViewGeometry::H, ImagePairToPairId(), colmap::TwoViewGeometry::inlier_matches, colmap::TwoViewGeometry::Invert(), colmap::TwoViewGeometry::qvec, SQLITE3_CALL, SwapImagePair(), and colmap::TwoViewGeometry::tvec.
Referenced by BOOST_AUTO_TEST_CASE(), Merge(), and colmap::FeatureMatcherCache::WriteTwoViewGeometry().
|
static |
Definition at line 37 of file database.h.
Referenced by BOOST_AUTO_TEST_CASE(), ImagePairToPairId(), and PairIdToImagePair().
|
static |
Definition at line 31 of file database.h.