version:2.1.5
bugfixes: update:拨号使用ocr进行识别
This commit is contained in:
@@ -38,54 +38,62 @@
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace cvflann {
|
||||
namespace cvflann
|
||||
{
|
||||
|
||||
typedef std::map<cv::String, any> IndexParams;
|
||||
typedef std::map<cv::String, any> IndexParams;
|
||||
|
||||
struct SearchParams : public IndexParams {
|
||||
SearchParams(int checks = 32, float eps = 0, bool sorted = true) {
|
||||
// how many leafs to visit when searching for neighbours (-1 for unlimited)
|
||||
(*this)["checks"] = checks;
|
||||
// search for eps-approximate neighbours (default: 0)
|
||||
(*this)["eps"] = eps;
|
||||
// only for radius search, require neighbours sorted by distance (default: true)
|
||||
(*this)["sorted"] = sorted;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
T get_param(const IndexParams ¶ms, cv::String name, const T &default_value) {
|
||||
IndexParams::const_iterator it = params.find(name);
|
||||
if (it != params.end()) {
|
||||
return it->second.cast<T>();
|
||||
} else {
|
||||
return default_value;
|
||||
}
|
||||
struct SearchParams : public IndexParams
|
||||
{
|
||||
SearchParams(int checks = 32, float eps = 0, bool sorted = true )
|
||||
{
|
||||
// how many leafs to visit when searching for neighbours (-1 for unlimited)
|
||||
(*this)["checks"] = checks;
|
||||
// search for eps-approximate neighbours (default: 0)
|
||||
(*this)["eps"] = eps;
|
||||
// only for radius search, require neighbours sorted by distance (default: true)
|
||||
(*this)["sorted"] = sorted;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T get_param(const IndexParams ¶ms, cv::String name) {
|
||||
IndexParams::const_iterator it = params.find(name);
|
||||
if (it != params.end()) {
|
||||
return it->second.cast<T>();
|
||||
} else {
|
||||
throw FLANNException(cv::String("Missing parameter '") + name +
|
||||
cv::String("' in the parameters given"));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T get_param(const IndexParams& params, cv::String name, const T& default_value)
|
||||
{
|
||||
IndexParams::const_iterator it = params.find(name);
|
||||
if (it != params.end()) {
|
||||
return it->second.cast<T>();
|
||||
}
|
||||
|
||||
inline void print_params(const IndexParams ¶ms, std::ostream &stream) {
|
||||
IndexParams::const_iterator it;
|
||||
|
||||
for (it = params.begin(); it != params.end(); ++it) {
|
||||
stream << it->first << " : " << it->second << std::endl;
|
||||
}
|
||||
else {
|
||||
return default_value;
|
||||
}
|
||||
}
|
||||
|
||||
inline void print_params(const IndexParams ¶ms) {
|
||||
print_params(params, std::cout);
|
||||
template<typename T>
|
||||
T get_param(const IndexParams& params, cv::String name)
|
||||
{
|
||||
IndexParams::const_iterator it = params.find(name);
|
||||
if (it != params.end()) {
|
||||
return it->second.cast<T>();
|
||||
}
|
||||
else {
|
||||
throw FLANNException(cv::String("Missing parameter '")+name+cv::String("' in the parameters given"));
|
||||
}
|
||||
}
|
||||
|
||||
inline void print_params(const IndexParams& params, std::ostream& stream)
|
||||
{
|
||||
IndexParams::const_iterator it;
|
||||
|
||||
for(it=params.begin(); it!=params.end(); ++it) {
|
||||
stream << it->first << " : " << it->second << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
inline void print_params(const IndexParams& params)
|
||||
{
|
||||
print_params(params, std::cout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user