Skip to content

Commit

Permalink
renamed to generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Hog committed Sep 4, 2024
1 parent e9a4be5 commit 2aba86f
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/aliceVision/feature/ImageDescriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ std::unique_ptr<ImageDescriber> 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)
Expand Down
10 changes: 5 additions & 5 deletions src/aliceVision/feature/ImageDescriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -363,7 +363,7 @@ class UnknownImageDescriber : public ImageDescriber
*/
void allocate(std::unique_ptr<Regions>& regions) const override
{
regions.reset(new UNKNOWN_Regions);
regions.reset(new GENERIC_Regions);
}

private:
Expand Down
5 changes: 5 additions & 0 deletions src/aliceVision/feature/imageDescriberCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/aliceVision/feature/imageDescriberCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
,
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/feature/regionsFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using AKAZE_Liop_Regions = ScalarRegions<unsigned char, 144>;
using AKAZE_BinaryRegions = BinaryRegions<64>;

/// Define an unknown feature regions
using UNKNOWN_Regions = ScalarRegions<float, 128>;
using GENERIC_Regions = ScalarRegions<float, 128>;

} // namespace feature
} // namespace aliceVision
4 changes: 4 additions & 0 deletions src/aliceVision/matching/svgVisualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/sfm/pipeline/regionsIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace sfmData;
std::unique_ptr<feature::Regions> loadRegions(const std::vector<std::string>& 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);

Expand Down Expand Up @@ -228,7 +228,7 @@ bool loadRegionsPerView(feature::RegionsPerView& regionsPerView,
std::unique_ptr<feature::Regions> 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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/voctree/VocabularyTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ inline std::unique_ptr<IVocabularyTree> createVoctreeForDescriberType(feature::E
case EImageDescriberType::AKAZE_MLDB:
res.reset(new VocabularyTree<AKAZE_BinaryRegions::DescriptorT>);
break;
case EImageDescriberType::UNKNOWN:
res.reset(new VocabularyTree<UNKNOWN_Regions::DescriptorT>);
case EImageDescriberType::GENERIC:
res.reset(new VocabularyTree<GENERIC_Regions::DescriptorT>);
break;

#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG)
Expand Down

0 comments on commit 2aba86f

Please sign in to comment.