From db5284154456c03943575376a41538300a382715 Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Fri, 10 Mar 2017 22:09:31 +0900 Subject: [PATCH] Accept default argument of FLANN index parameters --- modules/flann/misc/python/pyopencv_flann.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/flann/misc/python/pyopencv_flann.hpp b/modules/flann/misc/python/pyopencv_flann.hpp index a9da8d0..6591b90 100644 --- a/modules/flann/misc/python/pyopencv_flann.hpp +++ b/modules/flann/misc/python/pyopencv_flann.hpp @@ -23,6 +23,9 @@ bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name) PyObject* item = NULL; Py_ssize_t pos = 0; + if (!o || o == Py_None) + return true; + if(PyDict_Check(o)) { while(PyDict_Next(o, &pos, &key, &item)) { if( !PyString_Check(key) ) { -- 2.7.4