diff --git a/src/aliceVision/feature/ImageDescriber.cpp b/src/aliceVision/feature/ImageDescriber.cpp index 5cdf5f1626..055f859877 100644 --- a/src/aliceVision/feature/ImageDescriber.cpp +++ b/src/aliceVision/feature/ImageDescriber.cpp @@ -228,9 +228,9 @@ std::unique_ptr createImageDescriber(EImageDescriberType imageDe case EImageDescriberType::AKAZE_LIOP: describerPtr.reset(new ImageDescriber_AKAZE(AKAZEParams(AKAZEOptions(), feature::AKAZE_LIOP))); break; - //Unknown descriptor to be used when the descriptor is computed outside of alicevsion - case EImageDescriberType::UNKNOWN: - describerPtr.reset(new UnknownImageDescriber()); + //Generic descriptor to be used when the descriptor is computed outside of alicevsion + case EImageDescriberType::GENERIC: + describerPtr.reset(new GenericImageDescriber()); break; #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) diff --git a/src/aliceVision/feature/ImageDescriber.hpp b/src/aliceVision/feature/ImageDescriber.hpp index 5d91a9fa1c..59c0652523 100644 --- a/src/aliceVision/feature/ImageDescriber.hpp +++ b/src/aliceVision/feature/ImageDescriber.hpp @@ -264,12 +264,12 @@ class ImageDescriber /** * @brief Used to load descripters computed outside of meshroom. */ -class UnknownImageDescriber : public ImageDescriber +class GenericImageDescriber : public ImageDescriber { public: - UnknownImageDescriber() = default; + GenericImageDescriber() = default; - virtual ~UnknownImageDescriber() = default; + virtual ~GenericImageDescriber() = default; /** * @brief Check if the image describer use CUDA @@ -287,7 +287,7 @@ class UnknownImageDescriber : public ImageDescriber * @brief Get the corresponding EImageDescriberType * @return EImageDescriberType */ - EImageDescriberType getDescriberType() const override { return EImageDescriberType::UNKNOWN; } + EImageDescriberType getDescriberType() const override { return EImageDescriberType::GENERIC; } /** * @brief Get the total amount of RAM needed for a @@ -363,7 +363,7 @@ class UnknownImageDescriber : public ImageDescriber */ void allocate(std::unique_ptr& regions) const override { - regions.reset(new UNKNOWN_Regions); + regions.reset(new GENERIC_Regions); } private: diff --git a/src/aliceVision/feature/imageDescriberCommon.cpp b/src/aliceVision/feature/imageDescriberCommon.cpp index 448db0a231..32c2945808 100644 --- a/src/aliceVision/feature/imageDescriberCommon.cpp +++ b/src/aliceVision/feature/imageDescriberCommon.cpp @@ -61,6 +61,8 @@ std::string EImageDescriberType_enumToString(EImageDescriberType imageDescriberT return "akaze_liop"; case EImageDescriberType::AKAZE_MLDB: return "akaze_mldb"; + case EImageDescriberType::GENERIC: + return "generic"; #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) case EImageDescriberType::CCTAG3: @@ -113,6 +115,9 @@ EImageDescriberType EImageDescriberType_stringToEnum(const std::string& imageDes if (type == "akaze_mldb") return EImageDescriberType::AKAZE_MLDB; + if (type == "generic") + return EImageDescriberType::GENERIC; + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) if (type == "cctag3") return EImageDescriberType::CCTAG3; diff --git a/src/aliceVision/feature/imageDescriberCommon.hpp b/src/aliceVision/feature/imageDescriberCommon.hpp index 678d81cf02..75cc77f9bf 100644 --- a/src/aliceVision/feature/imageDescriberCommon.hpp +++ b/src/aliceVision/feature/imageDescriberCommon.hpp @@ -27,7 +27,9 @@ enum class EImageDescriberType : unsigned char AKAZE = 20, AKAZE_LIOP = 21, - AKAZE_MLDB = 22 + AKAZE_MLDB = 22, + + GENERIC = 100 #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) , @@ -111,7 +113,8 @@ inline float getStrongSupportCoeff(EImageDescriberType imageDescriberType) case EImageDescriberType::AKAZE_LIOP: case EImageDescriberType::AKAZE_MLDB: return 0.14f; - + case EImageDescriberType::GENERIC: + return -1.0f; #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) case EImageDescriberType::CCTAG3: case EImageDescriberType::CCTAG4: diff --git a/src/aliceVision/feature/regionsFactory.hpp b/src/aliceVision/feature/regionsFactory.hpp index 72a928a1f7..bb6b992edc 100644 --- a/src/aliceVision/feature/regionsFactory.hpp +++ b/src/aliceVision/feature/regionsFactory.hpp @@ -30,7 +30,7 @@ using AKAZE_Liop_Regions = ScalarRegions; using AKAZE_BinaryRegions = BinaryRegions<64>; /// Define an unknown feature regions -using UNKNOWN_Regions = ScalarRegions; +using GENERIC_Regions = ScalarRegions; } // namespace feature } // namespace aliceVision diff --git a/src/aliceVision/matching/svgVisualization.cpp b/src/aliceVision/matching/svgVisualization.cpp index 1f448d2d6d..bc482a4bc0 100644 --- a/src/aliceVision/matching/svgVisualization.cpp +++ b/src/aliceVision/matching/svgVisualization.cpp @@ -36,6 +36,10 @@ std::string describerTypeColor(feature::EImageDescriberType descType) return "purple"; case feature::EImageDescriberType::AKAZE_MLDB: return "purple"; + + case feature::EImageDescriberType::GENERIC: + return "black"; + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) case feature::EImageDescriberType::CCTAG3: return "blue"; diff --git a/src/aliceVision/sfm/pipeline/regionsIO.cpp b/src/aliceVision/sfm/pipeline/regionsIO.cpp index 9d3c4f227e..19e5555f5c 100644 --- a/src/aliceVision/sfm/pipeline/regionsIO.cpp +++ b/src/aliceVision/sfm/pipeline/regionsIO.cpp @@ -26,7 +26,7 @@ using namespace sfmData; std::unique_ptr loadRegions(const std::vector& folders, IndexT viewId, const feature::ImageDescriber& imageDescriber) { assert(!folders.empty()); - + const std::string imageDescriberTypeName = feature::EImageDescriberType_enumToString(imageDescriber.getDescriberType()); const std::string basename = std::to_string(viewId); @@ -228,7 +228,7 @@ bool loadRegionsPerView(feature::RegionsPerView& regionsPerView, std::unique_ptr regionsPtr; try { - regionsPtr = loadRegions(featuresFolders, iter->second.get()->getViewId(), *(imageDescribers.at(i))); + regionsPtr = loadRegions(featuresFolders, iter->second.get()->getViewId(), *(imageDescribers.at(i))); } catch (const std::exception& e) { diff --git a/src/aliceVision/voctree/VocabularyTree.hpp b/src/aliceVision/voctree/VocabularyTree.hpp index 7c973e326d..f63d818502 100644 --- a/src/aliceVision/voctree/VocabularyTree.hpp +++ b/src/aliceVision/voctree/VocabularyTree.hpp @@ -360,8 +360,8 @@ inline std::unique_ptr createVoctreeForDescriberType(feature::E case EImageDescriberType::AKAZE_MLDB: res.reset(new VocabularyTree); break; - case EImageDescriberType::UNKNOWN: - res.reset(new VocabularyTree); + case EImageDescriberType::GENERIC: + res.reset(new VocabularyTree); break; #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG)