forked from openMVG/openMVG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make some process image_describer independent =>uUse only the regions…
… type for dynamic loading. openMVG#274
- Loading branch information
Showing
18 changed files
with
270 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
// Copyright (c) 2015 Pierre MOULON. | ||
|
||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef OPENMVG_FEATURES_REGIONS_FACTORY_HPP | ||
#define OPENMVG_FEATURES_REGIONS_FACTORY_HPP | ||
|
||
#include "openMVG/numeric/numeric.h" | ||
#include "openMVG/features/regions.hpp" | ||
#include "openMVG/features/feature.hpp" | ||
#include "openMVG/features/descriptor.hpp" | ||
#include <string> | ||
#include <typeinfo> | ||
|
||
namespace openMVG { | ||
namespace features { | ||
|
||
/// Define the classic SIFT Keypoint | ||
typedef Scalar_Regions<SIOPointFeature,unsigned char,128> SIFT_Regions; | ||
|
||
/// Define the AKAZE Keypoint (with a float descriptor) | ||
typedef Scalar_Regions<SIOPointFeature,float,64> AKAZE_Float_Regions; | ||
/// Define the AKAZE Keypoint (with a LIOP descriptor) | ||
typedef Scalar_Regions<SIOPointFeature,unsigned char,144> AKAZE_Liop_Regions; | ||
/// Define the AKAZE Keypoint (with a binary descriptor saved in an uchar array) | ||
typedef Binary_Regions<SIOPointFeature,64> AKAZE_Binary_Regions; | ||
|
||
} // namespace features | ||
} // namespace openMVG | ||
|
||
//-- | ||
// Register region type for serialization | ||
//-- | ||
#include <cereal/cereal.hpp> | ||
#include <cereal/types/polymorphic.hpp> | ||
#include <cereal/archives/json.hpp>/* | ||
CEREAL_REGISTER_TYPE_WITH_NAME(openMVG::features::SIFT_Regions, "SIFT_Regions"); | ||
CEREAL_REGISTER_TYPE_WITH_NAME(openMVG::features::AKAZE_Float_Regions, "AKAZE_Float_Regions"); | ||
CEREAL_REGISTER_TYPE_WITH_NAME(openMVG::features::AKAZE_Liop_Regions, "AKAZE_Liop_Regions"); | ||
CEREAL_REGISTER_TYPE_WITH_NAME(openMVG::features::AKAZE_Binary_Regions, "AKAZE_Binary_Regions");*/ | ||
|
||
#endif // OPENMVG_FEATURES_REGIONS_FACTORY_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
// Copyright (c) 2015 Pierre MOULON. | ||
|
||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef IO_REGIONS_TYPE_HPP | ||
#define IO_REGIONS_TYPE_HPP | ||
|
||
#include "openMVG/features/features.hpp" | ||
#include <cereal/archives/json.hpp> | ||
|
||
#include <fstream> | ||
#include <vector> | ||
|
||
namespace openMVG | ||
{ | ||
|
||
// Init the regions_type from the image describer (used for regions loading) | ||
static std::unique_ptr<features::Regions> Init_region_type_from_file | ||
( | ||
const std::string & sImage_describer_file | ||
) | ||
{ | ||
using namespace openMVG::features; | ||
std::unique_ptr<Regions> regions_type; | ||
if (stlplus::is_file(sImage_describer_file)) | ||
{ | ||
// Dynamically load the regions type from the file | ||
std::ifstream stream(sImage_describer_file.c_str()); | ||
if (stream.is_open()) | ||
{ | ||
cereal::JSONInputArchive archive(stream); | ||
archive(cereal::make_nvp("regions_type", regions_type)); | ||
} | ||
} | ||
else // By default init a SIFT regions type (keep compatibility) | ||
{ | ||
regions_type.reset(new features::SIFT_Regions()); | ||
} | ||
return regions_type; | ||
} | ||
|
||
} // namespace openMVG | ||
|
||
#endif // IO_REGIONS_TYPE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.