Skip to content
Snippets Groups Projects
Commit e055b224 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add set and get match_type to matchers

parent 12d5908f
No related branches found
No related tags found
No related merge requests found
......@@ -22,9 +22,15 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.530116614" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/vision_utils}/build" enabledIncrementalBuild="true" id="cdt.managedbuild.builder.gnu.cross.1321287044" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.2113617585" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option id="gnu.c.compiler.option.preprocessor.def.symbols.597556856" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__cplusplus=201103"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.844027082" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1552607345" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.preprocessor.def.1754201403" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__cplusplus=201103"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2062058076" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1390296837" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
......@@ -45,47 +51,53 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="vision_utils.null.1064155195" name="vision_utils"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/vision_utils"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1819918851;cdt.managedbuild.toolchain.gnu.base.1819918851.1318867162;cdt.managedbuild.tool.gnu.cpp.compiler.base.1649772065;cdt.managedbuild.tool.gnu.cpp.compiler.input.146329834">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1736073220;cdt.managedbuild.toolchain.gnu.base.1736073220.1390770886;cdt.managedbuild.tool.gnu.c.compiler.base.1459107576;cdt.managedbuild.tool.gnu.c.compiler.input.1695301683">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.207681558;cdt.managedbuild.toolchain.gnu.base.207681558.1208625085;cdt.managedbuild.tool.gnu.c.compiler.base.1439246049;cdt.managedbuild.tool.gnu.c.compiler.input.637694474">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.727026548;cdt.managedbuild.toolchain.gnu.base.727026548.1071101131;cdt.managedbuild.tool.gnu.c.compiler.base.61708613;cdt.managedbuild.tool.gnu.c.compiler.input.166078074">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.207681558;cdt.managedbuild.toolchain.gnu.base.207681558.1208625085;cdt.managedbuild.tool.gnu.c.compiler.base.1439246049;cdt.managedbuild.tool.gnu.c.compiler.input.637694474">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.207681558;cdt.managedbuild.toolchain.gnu.base.207681558.1208625085;cdt.managedbuild.tool.gnu.cpp.compiler.base.1755527935;cdt.managedbuild.tool.gnu.cpp.compiler.input.1794914341">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1244102678;cdt.managedbuild.toolchain.gnu.base.1244102678.1450977940;cdt.managedbuild.tool.gnu.cpp.compiler.base.1572359948;cdt.managedbuild.tool.gnu.cpp.compiler.input.466329004">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.727026548;cdt.managedbuild.toolchain.gnu.base.727026548.1071101131;cdt.managedbuild.tool.gnu.cpp.compiler.base.433122623;cdt.managedbuild.tool.gnu.cpp.compiler.input.341288586">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.207681558;cdt.managedbuild.toolchain.gnu.base.207681558.1208625085;cdt.managedbuild.tool.gnu.cpp.compiler.base.1755527935;cdt.managedbuild.tool.gnu.cpp.compiler.input.1794914341">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.772018425;cdt.managedbuild.toolchain.gnu.cross.base.772018425.677700058;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1552607345;cdt.managedbuild.tool.gnu.cpp.compiler.input.2062058076">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.727026548;cdt.managedbuild.toolchain.gnu.base.727026548.1071101131;cdt.managedbuild.tool.gnu.cpp.compiler.base.433122623;cdt.managedbuild.tool.gnu.cpp.compiler.input.341288586">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1819918851;cdt.managedbuild.toolchain.gnu.base.1819918851.1318867162;cdt.managedbuild.tool.gnu.c.compiler.base.593702953;cdt.managedbuild.tool.gnu.c.compiler.input.392834553">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1736073220;cdt.managedbuild.toolchain.gnu.base.1736073220.1390770886;cdt.managedbuild.tool.gnu.cpp.compiler.base.1526891046;cdt.managedbuild.tool.gnu.cpp.compiler.input.1116382079">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1819918851;cdt.managedbuild.toolchain.gnu.base.1819918851.1318867162;cdt.managedbuild.tool.gnu.c.compiler.base.593702953;cdt.managedbuild.tool.gnu.c.compiler.input.392834553">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1736073220;cdt.managedbuild.toolchain.gnu.base.1736073220.1390770886;cdt.managedbuild.tool.gnu.c.compiler.base.1459107576;cdt.managedbuild.tool.gnu.c.compiler.input.1695301683">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1244102678;cdt.managedbuild.toolchain.gnu.base.1244102678.1450977940;cdt.managedbuild.tool.gnu.cpp.compiler.base.1572359948;cdt.managedbuild.tool.gnu.cpp.compiler.input.466329004">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.772018425;cdt.managedbuild.toolchain.gnu.cross.base.772018425.677700058;cdt.managedbuild.tool.gnu.cross.c.compiler.2113617585;cdt.managedbuild.tool.gnu.c.compiler.input.844027082">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1244102678;cdt.managedbuild.toolchain.gnu.base.1244102678.1450977940;cdt.managedbuild.tool.gnu.c.compiler.base.1838202852;cdt.managedbuild.tool.gnu.c.compiler.input.964584931">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="vision_utils.null.1064155195" name="vision_utils"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/vision_utils"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
......@@ -54,6 +54,7 @@ inline void MatcherBRUTEFORCE::defineMatcher(const ParamsBasePtr _params)
MatcherParamsBasePtr params_base_ptr = std::static_pointer_cast<MatcherParamsBase>(_params);
params_ptr_ = std::static_pointer_cast<MatcherParamsBRUTEFORCE>(params_base_ptr);
matcher_ = cv::DescriptorMatcher::create("BruteForce");
match_type_ = params_ptr_->match_type;
}
/*
......
......@@ -54,6 +54,7 @@ inline void MatcherBRUTEFORCE_HAMMING::defineMatcher(const ParamsBasePtr _params
MatcherParamsBasePtr params_base_ptr = std::static_pointer_cast<MatcherParamsBase>(_params);
params_ptr_ = std::static_pointer_cast<MatcherParamsBRUTEFORCE_HAMMING>(params_base_ptr);
matcher_ = cv::DescriptorMatcher::create("BruteForce-Hamming");
match_type_ = params_ptr_->match_type;
}
/*
......
......@@ -54,6 +54,7 @@ inline void MatcherBRUTEFORCE_HAMMING_2::defineMatcher(const ParamsBasePtr _para
MatcherParamsBasePtr params_base_ptr = std::static_pointer_cast<MatcherParamsBase>(_params);
params_ptr_ = std::static_pointer_cast<MatcherParamsBRUTEFORCE_HAMMING_2>(params_base_ptr);
matcher_ = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
match_type_ = params_ptr_->match_type;
}
/*
......
......@@ -54,6 +54,7 @@ inline void MatcherBRUTEFORCE_L1::defineMatcher(const ParamsBasePtr _params)
MatcherParamsBasePtr params_base_ptr = std::static_pointer_cast<MatcherParamsBase>(_params);
params_ptr_ = std::static_pointer_cast<MatcherParamsBRUTEFORCE_L1>(params_base_ptr);
matcher_ = cv::DescriptorMatcher::create("BruteForce-L1");
match_type_ = params_ptr_->match_type;
}
/*
......
......@@ -54,6 +54,7 @@ inline void MatcherFLANNBASED::defineMatcher(const ParamsBasePtr _params)
MatcherParamsBasePtr params_base_ptr = std::static_pointer_cast<MatcherParamsBase>(_params);
params_ptr_ = std::static_pointer_cast<MatcherParamsFLANNBASED>(params_base_ptr);
matcher_ = cv::DescriptorMatcher::create("FlannBased");
match_type_ = params_ptr_->match_type;
}
/*
......
......@@ -66,6 +66,10 @@ class MatcherBase : public VUBase, public std::enable_shared_from_this<MatcherBa
MatcherParamsBasePtr getParams(void);
int getMatchType(void);
void setMatchType(const int& _match_type);
void setParams(const MatcherParamsBasePtr _params);
std::vector<Scalar> match(const cv::Mat& _desc1, const cv::Mat& _desc2, const int& desc_size_bytes, DMatchVector& matches, cv::InputArray _mask=cv::noArray());
......@@ -88,6 +92,8 @@ class MatcherBase : public VUBase, public std::enable_shared_from_this<MatcherBa
std::string name_;
int match_type_;
FeatureMatcherPtr matcher_;
MatcherParamsBasePtr params_base_ptr_;
......@@ -97,25 +103,35 @@ class MatcherBase : public VUBase, public std::enable_shared_from_this<MatcherBa
virtual void defineMatcher(const ParamsBasePtr _params) = 0;
};
/*
* brief Retrieve object name
/**
*\brief Retrieve object name
*/
inline std::string MatcherBase::getName(void) { return name_; }
/*
* brief Set object name
/**
*\brief Set object name
*/
inline void MatcherBase::setName(const std::string& _name){ name_ = _name; }
/*
* brief Retrieve object parameters
/**
*\brief Set matcher type
*/
inline void MatcherBase::setMatchType(const int& _match_type){ match_type_ = _match_type;}
/**
*\brief Get matcher type
*/
inline int MatcherBase::getMatchType(void){ return match_type_;}
/**
*\brief Retrieve object parameters
*/
inline MatcherParamsBasePtr MatcherBase::getParams(void) { return params_base_ptr_; }
inline void MatcherBase::setParams(const MatcherParamsBasePtr _params) { params_base_ptr_ = _params; }
/*
* brief Setup and get the corresponding pointer
/**
*\brief Setup and get the corresponding pointer
*/
MatcherBasePtr setupMatcher(const std::string& _type, const std::string& _unique_name, const ParamsBasePtr& _params);
MatcherBasePtr setupMatcher(const std::string& _type, const std::string& _unique_name, const std::string& _filename_dot_yaml);
......
......@@ -449,6 +449,10 @@ cv::Mat buildImageProcessed(const cv::Mat& _img, const std::vector<KeyPointEnhan
// Point
cv::drawMarker (img, kp_e.kp.pt, kp_e.color, cv::MARKER_CROSS);
// Id
cv::putText(img, std::to_string(kp_e.track_id) + " (" + std::to_string(kp_e.track_length) + ")", cvPoint(kp_e.kp.pt.x+10,kp_e.kp.pt.y+5),
cv::FONT_HERSHEY_PLAIN, 1.0, kp_e.cov_color, 1, CV_AA);
// Covariance
Eigen::JacobiSVD<Eigen::MatrixXs> svd(kp_e.cov, Eigen::ComputeThinU | Eigen::ComputeThinV);
Eigen::Matrix2s R = svd.matrixU();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment