wrapped FlannBasedMatcher (and extended DescriptorMatcher wrapper)

updated feature_homography.py sample to use new features
This commit is contained in:
Alexander Mordvintsev
2011-09-15 11:10:06 +00:00
parent d174c3db04
commit 028c44531f
4 changed files with 62 additions and 27 deletions

View File

@@ -74,6 +74,11 @@ typedef Ptr<FeatureDetector> Ptr_FeatureDetector;
typedef Ptr<DescriptorExtractor> Ptr_DescriptorExtractor;
typedef Ptr<DescriptorMatcher> Ptr_DescriptorMatcher;
typedef cvflann::flann_distance_t cvflann_flann_distance_t;
typedef cvflann::flann_algorithm_t cvflann_flann_algorithm_t;
typedef Ptr<flann::IndexParams> Ptr_flann_IndexParams;
typedef Ptr<flann::SearchParams> Ptr_flann_SearchParams;
static PyObject* failmsgp(const char *fmt, ...)
{
char str[1000];
@@ -820,6 +825,14 @@ static bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name
return ok;
}
template <class T>
static bool pyopencv_to(PyObject *o, Ptr<T>& p, const char *name="<unknown>")
{
p = new T();
return pyopencv_to(o, *p, name);
}
static bool pyopencv_to(PyObject *o, cvflann::flann_distance_t& dist, const char *name="<unknown>")
{
int d = (int)dist;