Update to 2.0.0 tree from current Fremantle build
[opencv] / interfaces / swig / python / _ml.cpp
index ff6819c..757e66b 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 1.3.40
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
 #define SWIGPYTHON
 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
 
+
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -73,6 +77,12 @@ template <typename T> T SwigValueInit() {
 # endif
 #endif
 
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
 #ifndef SWIGUNUSEDPARM
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
@@ -141,7 +151,7 @@ template <typename T> T SwigValueInit() {
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -160,11 +170,11 @@ template <typename T> T SwigValueInit() {
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
   
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -191,14 +201,14 @@ template <typename T> T SwigValueInit() {
 /* 
    Flags/methods for returning states.
    
-   The swig conversion methods, as ConvertPtr, return and integer 
+   The SWIG conversion methods, as ConvertPtr, return and integer 
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
    
    Use the following macros/flags to set or process the returning
    states.
    
-   In old swig versions, you usually write code as:
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -206,7 +216,7 @@ template <typename T> T SwigValueInit() {
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -215,7 +225,7 @@ template <typename T> T SwigValueInit() {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -233,7 +243,7 @@ template <typename T> T SwigValueInit() {
     
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
+   also requires SWIG_ConvertPtr to return new result values, such as
 
       int SWIG_ConvertPtr(obj, ptr,...) {         
         if (<obj is ok>) {                            
@@ -251,7 +261,7 @@ template <typename T> T SwigValueInit() {
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -265,9 +275,8 @@ template <typename T> T SwigValueInit() {
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
 #define SWIG_OK                    (0) 
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
@@ -292,7 +301,6 @@ template <typename T> T SwigValueInit() {
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -315,8 +323,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -413,40 +419,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
 }
 
 
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -725,6 +749,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 
 
 
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
+
+#endif
+
+#ifndef Py_TYPE
+#  define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+#  define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  char *cstr;
+  char *newstr;
+  Py_ssize_t len;
+  str = PyUnicode_AsUTF8String(str);
+  PyBytes_AsStringAndSize(str, &cstr, &len);
+  newstr = (char *) malloc(len+1);
+  memcpy(newstr, cstr, len+1);
+  Py_XDECREF(str);
+  return newstr;
+#else
+  return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+#  define SWIG_Python_str_DelForPy3(x) 
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyUnicode_FromString(c); 
+#else
+  return PyString_FromString(c);
+#endif
+}
 
 /* Add PyOS_snprintf for old Pythons */
 #if PY_VERSION_HEX < 0x02020000
@@ -771,6 +856,7 @@ PyString_FromFormat(const char *fmt, ...) {
 #  define PyObject_GenericGetAttr 0
 # endif
 #endif
+
 /* Py_NotImplemented is defined in 2.1 and up. */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef Py_NotImplemented
@@ -778,7 +864,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* A crude PyString_AsStringAndSize implementation for old Pythons */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef PyString_AsStringAndSize
@@ -793,7 +878,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* PyBool_FromLong for old Pythons */
 #if PY_VERSION_HEX < 0x02030000
 static
@@ -871,10 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg)
 
   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
   if (value) {
+    char *tmp;
     PyObject *old_str = PyObject_Str(value);
     PyErr_Clear();
     Py_XINCREF(type);
-    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+
+    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(old_str);
     Py_DECREF(value);
   } else {
@@ -882,8 +969,6 @@ SWIG_Python_AddErrorMsg(const char* mesg)
   }
 }
 
-
-
 #if defined(SWIG_PYTHON_NO_THREADS)
 #  if defined(SWIG_PYTHON_THREADS)
 #    undef SWIG_PYTHON_THREADS
@@ -980,6 +1065,20 @@ typedef struct swig_const_info {
   swig_type_info **ptype;
 } swig_const_info;
 
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyInstanceMethod_New(func);
+#else
+  return NULL;
+#endif
+}
+
 #ifdef __cplusplus
 #if 0
 { /* cc-mode */
@@ -1032,7 +1131,7 @@ typedef struct swig_const_info {
 
 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
+#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
 
 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
 #define SWIG_SetErrorMsg                               SWIG_Python_SetErrorMsg                            
@@ -1228,7 +1327,7 @@ SWIG_Py_Void(void)
   return none;
 }
 
-/* PySwigClientData */
+/* SwigPyClientData */
 
 typedef struct {
   PyObject *klass;
@@ -1237,30 +1336,30 @@ typedef struct {
   PyObject *destroy;
   int delargs;
   int implicitconv;
-} PySwigClientData;
+} SwigPyClientData;
 
 SWIGRUNTIMEINLINE int 
 SWIG_Python_CheckImplicit(swig_type_info *ty)
 {
-  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
   return data ? data->implicitconv : 0;
 }
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_ExceptionType(swig_type_info *desc) {
-  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
   PyObject *klass = data ? data->klass : 0;
   return (klass ? klass : PyExc_RuntimeError);
 }
 
 
-SWIGRUNTIME PySwigClientData * 
-PySwigClientData_New(PyObject* obj)
+SWIGRUNTIME SwigPyClientData * 
+SwigPyClientData_New(PyObject* obj)
 {
   if (!obj) {
     return 0;
   } else {
-    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
     /* the klass element */
     data->klass = obj;
     Py_INCREF(data->klass);
@@ -1308,14 +1407,14 @@ PySwigClientData_New(PyObject* obj)
 }
 
 SWIGRUNTIME void 
-PySwigClientData_Del(PySwigClientData* data)
+SwigPyClientData_Del(SwigPyClientData* data)
 {
   Py_XDECREF(data->newraw);
   Py_XDECREF(data->newargs);
   Py_XDECREF(data->destroy);
 }
 
-/* =============== PySwigObject =====================*/
+/* =============== SwigPyObject =====================*/
 
 typedef struct {
   PyObject_HEAD
@@ -1323,24 +1422,28 @@ typedef struct {
   swig_type_info *ty;
   int own;
   PyObject *next;
-} PySwigObject;
+} SwigPyObject;
 
 SWIGRUNTIME PyObject *
-PySwigObject_long(PySwigObject *v)
+SwigPyObject_long(SwigPyObject *v)
 {
   return PyLong_FromVoidPtr(v->ptr);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_format(const char* fmt, PySwigObject *v)
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
 {
   PyObject *res = NULL;
   PyObject *args = PyTuple_New(1);
   if (args) {
-    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
-      PyObject *ofmt = PyString_FromString(fmt);
+    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
       if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+       res = PyUnicode_Format(ofmt,args);
+#else
        res = PyString_Format(ofmt,args);
+#endif
        Py_DECREF(ofmt);
       }
       Py_DECREF(args);
@@ -1350,49 +1453,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v)
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_oct(PySwigObject *v)
+SwigPyObject_oct(SwigPyObject *v)
 {
-  return PySwigObject_format("%o",v);
+  return SwigPyObject_format("%o",v);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_hex(PySwigObject *v)
+SwigPyObject_hex(SwigPyObject *v)
 {
-  return PySwigObject_format("%x",v);
+  return SwigPyObject_format("%x",v);
 }
 
 SWIGRUNTIME PyObject *
 #ifdef METH_NOARGS
-PySwigObject_repr(PySwigObject *v)
+SwigPyObject_repr(SwigPyObject *v)
 #else
-PySwigObject_repr(PySwigObject *v, PyObject *args)
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
 #endif
 {
   const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *hex = PySwigObject_hex(v);    
-  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
-  Py_DECREF(hex);
+  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
   if (v->next) {
 #ifdef METH_NOARGS
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
 #else
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
 #endif
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *joined = PyUnicode_Concat(repr, nrep);
+    Py_DecRef(repr);
+    Py_DecRef(nrep);
+    repr = joined;
+#else
     PyString_ConcatAndDel(&repr,nrep);
+#endif
   }
   return repr;  
 }
 
 SWIGRUNTIME int
-PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 {
+  char *str;
 #ifdef METH_NOARGS
-  PyObject *repr = PySwigObject_repr(v);
+  PyObject *repr = SwigPyObject_repr(v);
 #else
-  PyObject *repr = PySwigObject_repr(v, NULL);
+  PyObject *repr = SwigPyObject_repr(v, NULL);
 #endif
   if (repr) {
-    fputs(PyString_AsString(repr), fp);
+    str = SWIG_Python_str_AsChar(repr); 
+    fputs(str, fp);
+    SWIG_Python_str_DelForPy3(str);
     Py_DECREF(repr);
     return 0; 
   } else {
@@ -1401,53 +1512,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_str(PySwigObject *v)
+SwigPyObject_str(SwigPyObject *v)
 {
   char result[SWIG_BUFFER_SIZE];
   return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
-    PyString_FromString(result) : 0;
+    SWIG_Python_str_FromChar(result) : 0;
 }
 
 SWIGRUNTIME int
-PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
 {
   void *i = v->ptr;
   void *j = w->ptr;
   return (i < j) ? -1 : ((i > j) ? 1 : 0);
 }
 
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
+{
+  PyObject* res;
+  if( op != Py_EQ && op != Py_NE ) {
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+  }
+  if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
+    res = Py_True;
+  else
+    res = Py_False;
+  Py_INCREF(res);
+  return res;  
+}
+
+
 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
 
 SWIGRUNTIME PyTypeObject*
-PySwigObject_type(void) {
+SwigPyObject_type(void) {
   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
   return type;
 }
 
 SWIGRUNTIMEINLINE int
-PySwigObject_Check(PyObject *op) {
-  return ((op)->ob_type == PySwigObject_type())
-    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+SwigPyObject_Check(PyObject *op) {
+  return (Py_TYPE(op) == SwigPyObject_type())
+    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
 
 SWIGRUNTIME void
-PySwigObject_dealloc(PyObject *v)
+SwigPyObject_dealloc(PyObject *v)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   PyObject *next = sobj->next;
   if (sobj->own == SWIG_POINTER_OWN) {
     swig_type_info *ty = sobj->ty;
-    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
     PyObject *destroy = data ? data->destroy : 0;
     if (destroy) {
       /* destroy is always a VARARGS method */
       PyObject *res;
       if (data->delargs) {
-       /* we need to create a temporal object to carry the destroy operation */
-       PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+       /* we need to create a temporary object to carry the destroy operation */
+       PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
        res = SWIG_Python_CallFunctor(destroy, tmp);
        Py_DECREF(tmp);
       } else {
@@ -1469,15 +1598,15 @@ PySwigObject_dealloc(PyObject *v)
 }
 
 SWIGRUNTIME PyObject* 
-PySwigObject_append(PyObject* v, PyObject* next)
+SwigPyObject_append(PyObject* v, PyObject* next)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
 #ifndef METH_O
   PyObject *tmp = 0;
   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
   next = tmp;
 #endif
-  if (!PySwigObject_Check(next)) {
+  if (!SwigPyObject_Check(next)) {
     return NULL;
   }
   sobj->next = next;
@@ -1487,12 +1616,12 @@ PySwigObject_append(PyObject* v, PyObject* next)
 
 SWIGRUNTIME PyObject* 
 #ifdef METH_NOARGS
-PySwigObject_next(PyObject* v)
+SwigPyObject_next(PyObject* v)
 #else
-PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   if (sobj->next) {    
     Py_INCREF(sobj->next);
     return sobj->next;
@@ -1503,30 +1632,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_disown(PyObject *v)
+SwigPyObject_disown(PyObject *v)
 #else
-PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = 0;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_acquire(PyObject *v)
+SwigPyObject_acquire(PyObject *v)
 #else
-PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = SWIG_POINTER_OWN;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
-PySwigObject_own(PyObject *v, PyObject *args)
+SwigPyObject_own(PyObject *v, PyObject *args)
 {
   PyObject *val = 0;
 #if (PY_VERSION_HEX < 0x02020000)
@@ -1539,20 +1668,20 @@ PySwigObject_own(PyObject *v, PyObject *args)
     } 
   else
     {
-      PySwigObject *sobj = (PySwigObject *)v;
+      SwigPyObject *sobj = (SwigPyObject *)v;
       PyObject *obj = PyBool_FromLong(sobj->own);
       if (val) {
 #ifdef METH_NOARGS
        if (PyObject_IsTrue(val)) {
-         PySwigObject_acquire(v);
+         SwigPyObject_acquire(v);
        } else {
-         PySwigObject_disown(v);
+         SwigPyObject_disown(v);
        }
 #else
        if (PyObject_IsTrue(val)) {
-         PySwigObject_acquire(v,args);
+         SwigPyObject_acquire(v,args);
        } else {
-         PySwigObject_disown(v,args);
+         SwigPyObject_disown(v,args);
        }
 #endif
       } 
@@ -1563,30 +1692,30 @@ PySwigObject_own(PyObject *v, PyObject *args)
 #ifdef METH_O
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #else
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #endif
 
 #if PY_VERSION_HEX < 0x02020000
 SWIGINTERN PyObject *
-PySwigObject_getattr(PySwigObject *sobj,char *name)
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
 {
   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
 }
@@ -1596,11 +1725,14 @@ SWIGRUNTIME PyTypeObject*
 _PySwigObject_type(void) {
   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
   
-  static PyNumberMethods PySwigObject_as_number = {
+  static PyNumberMethods SwigPyObject_as_number = {
     (binaryfunc)0, /*nb_add*/
     (binaryfunc)0, /*nb_subtract*/
     (binaryfunc)0, /*nb_multiply*/
+    /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
     (binaryfunc)0, /*nb_divide*/
+#endif
     (binaryfunc)0, /*nb_remainder*/
     (binaryfunc)0, /*nb_divmod*/
     (ternaryfunc)0,/*nb_power*/
@@ -1614,13 +1746,23 @@ _PySwigObject_type(void) {
     0,            /*nb_and*/
     0,            /*nb_xor*/
     0,            /*nb_or*/
-    (coercion)0,   /*nb_coerce*/
-    (unaryfunc)PySwigObject_long, /*nb_int*/
-    (unaryfunc)PySwigObject_long, /*nb_long*/
+#if PY_VERSION_HEX < 0x03000000
+    0,   /*nb_coerce*/
+#endif
+    (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+    0, /*nb_reserved*/
+#endif
     (unaryfunc)0,                 /*nb_float*/
-    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
-    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
+    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
@@ -1629,32 +1771,41 @@ _PySwigObject_type(void) {
 #endif
   };
 
-  static PyTypeObject pyswigobject_type;  
+  static PyTypeObject swigpyobject_type;  
   static int type_init = 0;
   if (!type_init) {
     const PyTypeObject tmp
       = {
+       /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+       PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else    
        PyObject_HEAD_INIT(NULL)
        0,                                  /* ob_size */
-       (char *)"PySwigObject",             /* tp_name */
-       sizeof(PySwigObject),               /* tp_basicsize */
+#endif
+       (char *)"SwigPyObject",             /* tp_name */
+       sizeof(SwigPyObject),               /* tp_basicsize */
        0,                                  /* tp_itemsize */
-       (destructor)PySwigObject_dealloc,   /* tp_dealloc */
-       (printfunc)PySwigObject_print,      /* tp_print */
+       (destructor)SwigPyObject_dealloc,   /* tp_dealloc */
+       (printfunc)SwigPyObject_print,      /* tp_print */
 #if PY_VERSION_HEX < 0x02020000
-       (getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
+       (getattrfunc)SwigPyObject_getattr,  /* tp_getattr */ 
 #else
        (getattrfunc)0,                     /* tp_getattr */ 
 #endif
        (setattrfunc)0,                     /* tp_setattr */ 
-       (cmpfunc)PySwigObject_compare,      /* tp_compare */ 
-       (reprfunc)PySwigObject_repr,        /* tp_repr */    
-       &PySwigObject_as_number,            /* tp_as_number */
+#if PY_VERSION_HEX >= 0x03000000
+    0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
+#else
+       (cmpfunc)SwigPyObject_compare,      /* tp_compare */
+#endif
+       (reprfunc)SwigPyObject_repr,        /* tp_repr */    
+       &SwigPyObject_as_number,            /* tp_as_number */
        0,                                  /* tp_as_sequence */
        0,                                  /* tp_as_mapping */
        (hashfunc)0,                        /* tp_hash */
        (ternaryfunc)0,                     /* tp_call */
-       (reprfunc)PySwigObject_str,         /* tp_str */
+       (reprfunc)SwigPyObject_str,         /* tp_str */
        PyObject_GenericGetAttr,            /* tp_getattro */
        0,                                  /* tp_setattro */
        0,                                  /* tp_as_buffer */
@@ -1662,7 +1813,7 @@ _PySwigObject_type(void) {
        swigobject_doc,                     /* tp_doc */        
        0,                                  /* tp_traverse */
        0,                                  /* tp_clear */
-       0,                                  /* tp_richcompare */
+       (richcmpfunc)SwigPyObject_richcompare,           /* tp_richcompare */
        0,                                  /* tp_weaklistoffset */
 #if PY_VERSION_HEX >= 0x02020000
        0,                                  /* tp_iter */
@@ -1679,11 +1830,11 @@ _PySwigObject_type(void) {
        0,                                  /* tp_alloc */              
        0,                                  /* tp_new */                
        0,                                  /* tp_free */          
-        0,                                  /* tp_is_gc */  
+       0,                                  /* tp_is_gc */  
        0,                                  /* tp_bases */   
        0,                                  /* tp_mro */
        0,                                  /* tp_cache */   
-       0,                                  /* tp_subclasses */
+       0,                                  /* tp_subclasses */
        0,                                  /* tp_weaklist */
 #endif
 #if PY_VERSION_HEX >= 0x02030000
@@ -1693,17 +1844,20 @@ _PySwigObject_type(void) {
        0,0,0,0                             /* tp_alloc -> tp_next */
 #endif
       };
-    pyswigobject_type = tmp;
-    pyswigobject_type.ob_type = &PyType_Type;
+    swigpyobject_type = tmp;
+    /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+    swigpyobject_type.ob_type = &PyType_Type;
+#endif
     type_init = 1;
   }
-  return &pyswigobject_type;
+  return &swigpyobject_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own)
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
 {
-  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
   if (sobj) {
     sobj->ptr  = ptr;
     sobj->ty   = ty;
@@ -1722,10 +1876,10 @@ typedef struct {
   void *pack;
   swig_type_info *ty;
   size_t size;
-} PySwigPacked;
+} SwigPyPacked;
 
 SWIGRUNTIME int
-PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 {
   char result[SWIG_BUFFER_SIZE];
   fputs("<Swig Packed ", fp); 
@@ -1739,29 +1893,29 @@ PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 }
   
 SWIGRUNTIME PyObject *
-PySwigPacked_repr(PySwigPacked *v)
+SwigPyPacked_repr(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
   } else {
-    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
   }  
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_str(PySwigPacked *v)
+SwigPyPacked_str(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return PyString_FromFormat("%s%s", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
   } else {
-    return PyString_FromString(v->ty->name);
+    return SWIG_Python_str_FromChar(v->ty->name);
   }  
 }
 
 SWIGRUNTIME int
-PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
 {
   size_t i = v->size;
   size_t j = w->size;
@@ -1772,22 +1926,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
 SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
 
 SWIGRUNTIME PyTypeObject*
-PySwigPacked_type(void) {
+SwigPyPacked_type(void) {
   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
   return type;
 }
 
 SWIGRUNTIMEINLINE int
-PySwigPacked_Check(PyObject *op) {
+SwigPyPacked_Check(PyObject *op) {
   return ((op)->ob_type == _PySwigPacked_type()) 
-    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
 }
 
 SWIGRUNTIME void
-PySwigPacked_dealloc(PyObject *v)
+SwigPyPacked_dealloc(PyObject *v)
 {
-  if (PySwigPacked_Check(v)) {
-    PySwigPacked *sobj = (PySwigPacked *) v;
+  if (SwigPyPacked_Check(v)) {
+    SwigPyPacked *sobj = (SwigPyPacked *) v;
     free(sobj->pack);
   }
   PyObject_DEL(v);
@@ -1796,28 +1950,37 @@ PySwigPacked_dealloc(PyObject *v)
 SWIGRUNTIME PyTypeObject*
 _PySwigPacked_type(void) {
   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject pyswigpacked_type;
+  static PyTypeObject swigpypacked_type;
   static int type_init = 0;  
   if (!type_init) {
     const PyTypeObject tmp
       = {
+    /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
        PyObject_HEAD_INIT(NULL)
-       0,                                  /* ob_size */       
-       (char *)"PySwigPacked",             /* tp_name */       
-       sizeof(PySwigPacked),               /* tp_basicsize */  
+    0,                             /* ob_size */       
+#endif
+       (char *)"SwigPyPacked",             /* tp_name */       
+       sizeof(SwigPyPacked),               /* tp_basicsize */  
        0,                                  /* tp_itemsize */   
-       (destructor)PySwigPacked_dealloc,   /* tp_dealloc */    
-       (printfunc)PySwigPacked_print,      /* tp_print */      
+       (destructor)SwigPyPacked_dealloc,   /* tp_dealloc */    
+       (printfunc)SwigPyPacked_print,      /* tp_print */      
        (getattrfunc)0,                     /* tp_getattr */    
        (setattrfunc)0,                     /* tp_setattr */    
-       (cmpfunc)PySwigPacked_compare,      /* tp_compare */    
-       (reprfunc)PySwigPacked_repr,        /* tp_repr */       
-       0,                                  /* tp_as_number */  
+#if PY_VERSION_HEX>=0x03000000
+    0, /* tp_reserved in 3.0.1 */
+#else
+    (cmpfunc)SwigPyPacked_compare,         /* tp_compare */
+#endif
+       (reprfunc)SwigPyPacked_repr,        /* tp_repr */
+       0,                                  /* tp_as_number */
        0,                                  /* tp_as_sequence */
-       0,                                  /* tp_as_mapping */ 
-       (hashfunc)0,                        /* tp_hash */       
-       (ternaryfunc)0,                     /* tp_call */       
-       (reprfunc)PySwigPacked_str,         /* tp_str */        
+       0,                                  /* tp_as_mapping */
+       (hashfunc)0,                        /* tp_hash */
+       (ternaryfunc)0,                     /* tp_call */
+       (reprfunc)SwigPyPacked_str,         /* tp_str */
        PyObject_GenericGetAttr,            /* tp_getattro */
        0,                                  /* tp_setattro */
        0,                                  /* tp_as_buffer */
@@ -1856,17 +2019,20 @@ _PySwigPacked_type(void) {
        0,0,0,0                             /* tp_alloc -> tp_next */
 #endif
       };
-    pyswigpacked_type = tmp;
-    pyswigpacked_type.ob_type = &PyType_Type;
+    swigpypacked_type = tmp;
+    /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+    swigpypacked_type.ob_type = &PyType_Type;
+#endif
     type_init = 1;
   }
-  return &pyswigpacked_type;
+  return &swigpypacked_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
 {
-  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
   if (sobj) {
     void *pack = malloc(size);
     if (pack) {
@@ -1883,10 +2049,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
 }
 
 SWIGRUNTIME swig_type_info *
-PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 {
-  if (PySwigPacked_Check(obj)) {
-    PySwigPacked *sobj = (PySwigPacked *)obj;
+  if (SwigPyPacked_Check(obj)) {
+    SwigPyPacked *sobj = (SwigPyPacked *)obj;
     if (sobj->size != size) return 0;
     memcpy(ptr, sobj->pack, size);
     return sobj->ty;
@@ -1902,7 +2068,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 SWIGRUNTIMEINLINE PyObject *
 _SWIG_This(void)
 {
-  return PyString_FromString("this");
+    return SWIG_Python_str_FromChar("this");
 }
 
 SWIGRUNTIME PyObject *
@@ -1914,11 +2080,16 @@ SWIG_This(void)
 
 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
 
-SWIGRUNTIME PySwigObject *
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS 
+#endif
+
+SWIGRUNTIME SwigPyObject *
 SWIG_Python_GetSwigThis(PyObject *pyobj) 
 {
-  if (PySwigObject_Check(pyobj)) {
-    return (PySwigObject *) pyobj;
+  if (SwigPyObject_Check(pyobj)) {
+    return (SwigPyObject *) pyobj;
   } else {
     PyObject *obj = 0;
 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
@@ -1954,12 +2125,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
       return 0;
     }
 #endif
-    if (obj && !PySwigObject_Check(obj)) {
+    if (obj && !SwigPyObject_Check(obj)) {
       /* a PyObject is called 'this', try to get the 'real this'
-        PySwigObject from it */ 
+        SwigPyObject from it */ 
       return SWIG_Python_GetSwigThis(obj);
     }
-    return (PySwigObject *)obj;
+    return (SwigPyObject *)obj;
   }
 }
 
@@ -1968,7 +2139,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
 SWIGRUNTIME int
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
   if (own == SWIG_POINTER_OWN) {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (sobj) {
       int oldown = sobj->own;
       sobj->own = own;
@@ -1987,7 +2158,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     if (ptr) *ptr = 0;
     return SWIG_OK;
   } else {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (own)
       *own = 0;
     while (sobj) {
@@ -2001,7 +2172,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
        } else {
          swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
          if (!tc) {
-           sobj = (PySwigObject *)sobj->next;
+           sobj = (SwigPyObject *)sobj->next;
          } else {
            if (ptr) {
               int newmemory = 0;
@@ -2030,7 +2201,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     } else {
       int res = SWIG_ERROR;
       if (flags & SWIG_POINTER_IMPLICIT_CONV) {
-       PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
        if (data && !data->implicitconv) {
          PyObject *klass = data->klass;
          if (klass) {
@@ -2043,7 +2214,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
              impconv = 0;
            }
            if (impconv) {
-             PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
+             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
              if (iobj) {
                void *vptr;
                res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
@@ -2081,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     /* here we get the method pointer for callbacks */
     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc) {
+    if (desc)
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-      if (!desc) return SWIG_ERROR;
-    }
+    if (!desc) 
+      return SWIG_ERROR;
     if (ty) {
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
       if (tc) {
@@ -2105,7 +2276,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
 
 SWIGRUNTIME int
 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
   if (!to) return SWIG_ERROR;
   if (ty) {
     if (to != ty) {
@@ -2122,12 +2293,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t
  * ----------------------------------------------------------------------------- */
 
 /*
-  Create a new instance object, whitout calling __init__, and set the
+  Create a new instance object, without calling __init__, and set the
   'this' attribute.
 */
 
 SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
 {
 #if (PY_VERSION_HEX >= 0x02020000)
   PyObject *inst = 0;
@@ -2151,10 +2322,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
 #endif
     }
   } else {
+#if PY_VERSION_HEX >= 0x03000000
+    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+    PyObject_SetAttr(inst, SWIG_This(), swig_this);
+    Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+#else
     PyObject *dict = PyDict_New();
     PyDict_SetItem(dict, SWIG_This(), swig_this);
     inst = PyInstance_NewRaw(data->newargs, dict);
     Py_DECREF(dict);
+#endif
   }
   return inst;
 #else
@@ -2217,9 +2394,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
   if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
     return NULL;
   } else {
-    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
     if (sthis) {
-      PySwigObject_append((PyObject*) sthis, obj[1]);
+      SwigPyObject_append((PyObject*) sthis, obj[1]);
     } else {
       SWIG_Python_SetSwigThis(obj[0], obj[1]);
     }
@@ -2235,8 +2412,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
     return SWIG_Py_Void();
   } else {
     int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-    PyObject *robj = PySwigObject_New(ptr, type, own);
-    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
+    PyObject *robj = SwigPyObject_New(ptr, type, own);
+    SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
     if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
       PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
       if (inst) {
@@ -2252,7 +2429,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
 }
 
 /* -----------------------------------------------------------------------------*
@@ -2323,8 +2500,8 @@ SWIG_Python_DestroyModule(void *vptr)
   for (i =0; i < swig_module->size; ++i) {
     swig_type_info *ty = types[i];
     if (ty->owndata) {
-      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
-      if (data) PySwigClientData_Del(data);
+      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+      if (data) SwigPyClientData_Del(data);
     }
   }
   Py_DECREF(SWIG_This());
@@ -2334,8 +2511,13 @@ SWIGRUNTIME void
 SWIG_Python_SetModule(swig_module_info *swig_module) {
   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
 
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
                                   swig_empty_runtime_method_table);
+#endif
   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
   if (pointer && module) {
     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
@@ -2355,7 +2537,7 @@ SWIGRUNTIME swig_type_info *
 SWIG_Python_TypeQuery(const char *type)
 {
   PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = PyString_FromString(type); 
+  PyObject *key = SWIG_Python_str_FromChar(type); 
   PyObject *obj = PyDict_GetItem(cache, key);
   swig_type_info *descriptor;
   if (obj) {
@@ -2382,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type)
 
 SWIGRUNTIME int
 SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{
+{  
   if (PyErr_Occurred()) {
     PyObject *type = 0;
     PyObject *value = 0;
     PyObject *traceback = 0;
     PyErr_Fetch(&type, &value, &traceback);
     if (value) {
+      char *tmp;
       PyObject *old_str = PyObject_Str(value);
       Py_XINCREF(type);
       PyErr_Clear();
       if (infront) {
-       PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+       PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
       } else {
-       PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+       PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
       }
+      SWIG_Python_str_DelForPy3(tmp);
       Py_DECREF(old_str);
     }
     return 1;
@@ -2419,9 +2603,9 @@ SWIG_Python_ArgFail(int argnum)
 }
 
 SWIGRUNTIMEINLINE const char *
-PySwigObject_GetDesc(PyObject *self)
+SwigPyObject_GetDesc(PyObject *self)
 {
-  PySwigObject *v = (PySwigObject *)self;
+  SwigPyObject *v = (SwigPyObject *)self;
   swig_type_info *ty = v ? v->ty : 0;
   return ty ? ty->str : (char*)"";
 }
@@ -2431,10 +2615,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
 {
   if (type) {
 #if defined(SWIG_COBJECT_TYPES)
-    if (obj && PySwigObject_Check(obj)) {
-      const char *otype = (const char *) PySwigObject_GetDesc(obj);
+    if (obj && SwigPyObject_Check(obj)) {
+      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
       if (otype) {
-       PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+       PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
                     type, otype);
        return;
       }
@@ -2444,10 +2628,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
       if (otype) {
        PyObject *str = PyObject_Str(obj);
-       const char *cstr = str ? PyString_AsString(str) : 0;
+       const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
        if (cstr) {
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
                       type, otype, cstr);
+          SWIG_Python_str_DelForPy3(cstr);
        } else {
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
                       type, otype);
@@ -2469,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
   void *result;
   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
     PyErr_Clear();
-    if (flags & SWIG_POINTER_EXCEPTION) {
+#if SWIG_POINTER_EXCEPTION
+    if (flags) {
       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
       SWIG_Python_ArgFail(argnum);
     }
+#endif
   }
   return result;
 }
@@ -2506,7 +2693,7 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
 
 /* wrapper to the better function PyInt_AsLong, removing problems
    with RedHat (I hope) */
-static PyAPI_FUNC(long) PyInt_AS_LONG (PyObject *obj) {
+long PyInt_AS_LONG (PyObject *obj) {
     return PyInt_AsLong (obj);
 }
 
@@ -2516,7 +2703,7 @@ static PyAPI_FUNC(long) PyInt_AS_LONG (PyObject *obj) {
 #endif
 
 /* wrapper to the better function PyFloat_AS_DOUBLE, to prevent errors */
-static PyAPI_FUNC(double) PyFloat_AS_DOUBLE (PyObject *obj) {
+double PyFloat_AS_DOUBLE (PyObject *obj) {
     return PyFloat_AsDouble (obj);
 }
 
@@ -2556,109 +2743,127 @@ static PyAPI_FUNC(double) PyFloat_AS_DOUBLE (PyObject *obj) {
 #define SWIGTYPE_p_CvDTreeTrainData swig_types[27]
 #define SWIGTYPE_p_CvEM swig_types[28]
 #define SWIGTYPE_p_CvEMParams swig_types[29]
-#define SWIGTYPE_p_CvFileNode swig_types[30]
-#define SWIGTYPE_p_CvFileStorage swig_types[31]
-#define SWIGTYPE_p_CvFilter swig_types[32]
-#define SWIGTYPE_p_CvFont swig_types[33]
-#define SWIGTYPE_p_CvForestTree swig_types[34]
-#define SWIGTYPE_p_CvGenericHash swig_types[35]
-#define SWIGTYPE_p_CvGraph swig_types[36]
-#define SWIGTYPE_p_CvGraphEdge swig_types[37]
-#define SWIGTYPE_p_CvGraphScanner swig_types[38]
-#define SWIGTYPE_p_CvGraphVtx swig_types[39]
-#define SWIGTYPE_p_CvGraphVtx2D swig_types[40]
-#define SWIGTYPE_p_CvHaarClassifier swig_types[41]
-#define SWIGTYPE_p_CvHaarClassifierCascade swig_types[42]
-#define SWIGTYPE_p_CvHaarFeature swig_types[43]
-#define SWIGTYPE_p_CvHaarStageClassifier swig_types[44]
-#define SWIGTYPE_p_CvHidHaarClassifierCascade swig_types[45]
-#define SWIGTYPE_p_CvHistogram swig_types[46]
-#define SWIGTYPE_p_CvHuMoments swig_types[47]
-#define SWIGTYPE_p_CvKNearest swig_types[48]
-#define SWIGTYPE_p_CvKalman swig_types[49]
-#define SWIGTYPE_p_CvLineIterator swig_types[50]
-#define SWIGTYPE_p_CvMat swig_types[51]
-#define SWIGTYPE_p_CvMatND swig_types[52]
-#define SWIGTYPE_p_CvMatrix3 swig_types[53]
-#define SWIGTYPE_p_CvMemBlock swig_types[54]
-#define SWIGTYPE_p_CvMemStorage swig_types[55]
-#define SWIGTYPE_p_CvMemStoragePos swig_types[56]
-#define SWIGTYPE_p_CvModuleInfo swig_types[57]
-#define SWIGTYPE_p_CvMoments swig_types[58]
-#define SWIGTYPE_p_CvNArrayIterator swig_types[59]
-#define SWIGTYPE_p_CvNextEdgeType swig_types[60]
-#define SWIGTYPE_p_CvNormalBayesClassifier swig_types[61]
-#define SWIGTYPE_p_CvPOSITObject swig_types[62]
-#define SWIGTYPE_p_CvPair32s32f swig_types[63]
-#define SWIGTYPE_p_CvParamGrid swig_types[64]
-#define SWIGTYPE_p_CvPluginFuncInfo swig_types[65]
-#define SWIGTYPE_p_CvPoint swig_types[66]
-#define SWIGTYPE_p_CvPoint2D32f swig_types[67]
-#define SWIGTYPE_p_CvPoint2D64f swig_types[68]
-#define SWIGTYPE_p_CvPoint3D32f swig_types[69]
-#define SWIGTYPE_p_CvPoint3D64f swig_types[70]
-#define SWIGTYPE_p_CvQuadEdge2D swig_types[71]
-#define SWIGTYPE_p_CvRNG_Wrapper swig_types[72]
-#define SWIGTYPE_p_CvRTParams swig_types[73]
-#define SWIGTYPE_p_CvRTrees swig_types[74]
-#define SWIGTYPE_p_CvRect swig_types[75]
-#define SWIGTYPE_p_CvSVM swig_types[76]
-#define SWIGTYPE_p_CvSVMDecisionFunc swig_types[77]
-#define SWIGTYPE_p_CvSVMKernel swig_types[78]
-#define SWIGTYPE_p_CvSVMKernelRow swig_types[79]
-#define SWIGTYPE_p_CvSVMParams swig_types[80]
-#define SWIGTYPE_p_CvSVMSolutionInfo swig_types[81]
-#define SWIGTYPE_p_CvSVMSolver swig_types[82]
-#define SWIGTYPE_p_CvScalar swig_types[83]
-#define SWIGTYPE_p_CvSeq swig_types[84]
-#define SWIGTYPE_p_CvSeqBlock swig_types[85]
-#define SWIGTYPE_p_CvSeqReader swig_types[86]
-#define SWIGTYPE_p_CvSeqWriter swig_types[87]
-#define SWIGTYPE_p_CvSet swig_types[88]
-#define SWIGTYPE_p_CvSetElem swig_types[89]
-#define SWIGTYPE_p_CvSize swig_types[90]
-#define SWIGTYPE_p_CvSize2D32f swig_types[91]
-#define SWIGTYPE_p_CvSlice swig_types[92]
-#define SWIGTYPE_p_CvSparseMat swig_types[93]
-#define SWIGTYPE_p_CvSparseMatIterator swig_types[94]
-#define SWIGTYPE_p_CvSparseNode swig_types[95]
-#define SWIGTYPE_p_CvStatModel swig_types[96]
-#define SWIGTYPE_p_CvString swig_types[97]
-#define SWIGTYPE_p_CvStringHashNode swig_types[98]
-#define SWIGTYPE_p_CvSubdiv2D swig_types[99]
-#define SWIGTYPE_p_CvSubdiv2DEdge_Wrapper swig_types[100]
-#define SWIGTYPE_p_CvSubdiv2DPoint swig_types[101]
-#define SWIGTYPE_p_CvSubdiv2DPointLocation swig_types[102]
-#define SWIGTYPE_p_CvTermCriteria swig_types[103]
-#define SWIGTYPE_p_CvTreeNodeIterator swig_types[104]
-#define SWIGTYPE_p_CvTypeInfo swig_types[105]
-#define SWIGTYPE_p_CvVectors swig_types[106]
-#define SWIGTYPE_p_CvVectors_data swig_types[107]
-#define SWIGTYPE_p_GetRow swig_types[108]
-#define SWIGTYPE_p_SelectWorkingSet swig_types[109]
-#define SWIGTYPE_p__IplConvKernel swig_types[110]
-#define SWIGTYPE_p__IplConvKernelFP swig_types[111]
-#define SWIGTYPE_p__IplImage swig_types[112]
-#define SWIGTYPE_p__IplROI swig_types[113]
-#define SWIGTYPE_p__IplTileInfo swig_types[114]
-#define SWIGTYPE_p_bool swig_types[115]
-#define SWIGTYPE_p_char swig_types[116]
-#define SWIGTYPE_p_double swig_types[117]
-#define SWIGTYPE_p_float swig_types[118]
-#define SWIGTYPE_p_int swig_types[119]
-#define SWIGTYPE_p_long_long swig_types[120]
-#define SWIGTYPE_p_p_CvMat swig_types[121]
-#define SWIGTYPE_p_p_double swig_types[122]
-#define SWIGTYPE_p_p_float swig_types[123]
-#define SWIGTYPE_p_p_unsigned_char swig_types[124]
-#define SWIGTYPE_p_signed_char swig_types[125]
-#define SWIGTYPE_p_size_t swig_types[126]
-#define SWIGTYPE_p_unsigned_char swig_types[127]
-#define SWIGTYPE_p_unsigned_long_long swig_types[128]
-#define SWIGTYPE_p_unsigned_short swig_types[129]
-#define SWIGTYPE_p_void swig_types[130]
-static swig_type_info *swig_types[132];
-static swig_module_info swig_module = {swig_types, 131, 0, 0, 0, 0};
+#define SWIGTYPE_p_CvERTreeTrainData swig_types[30]
+#define SWIGTYPE_p_CvERTrees swig_types[31]
+#define SWIGTYPE_p_CvFileNode swig_types[32]
+#define SWIGTYPE_p_CvFileStorage swig_types[33]
+#define SWIGTYPE_p_CvFilter swig_types[34]
+#define SWIGTYPE_p_CvFont swig_types[35]
+#define SWIGTYPE_p_CvForestERTree swig_types[36]
+#define SWIGTYPE_p_CvForestTree swig_types[37]
+#define SWIGTYPE_p_CvGenericHash swig_types[38]
+#define SWIGTYPE_p_CvGraph swig_types[39]
+#define SWIGTYPE_p_CvGraphEdge swig_types[40]
+#define SWIGTYPE_p_CvGraphScanner swig_types[41]
+#define SWIGTYPE_p_CvGraphVtx swig_types[42]
+#define SWIGTYPE_p_CvGraphVtx2D swig_types[43]
+#define SWIGTYPE_p_CvHaarClassifier swig_types[44]
+#define SWIGTYPE_p_CvHaarClassifierCascade swig_types[45]
+#define SWIGTYPE_p_CvHaarFeature swig_types[46]
+#define SWIGTYPE_p_CvHaarStageClassifier swig_types[47]
+#define SWIGTYPE_p_CvHidHaarClassifierCascade swig_types[48]
+#define SWIGTYPE_p_CvHistogram swig_types[49]
+#define SWIGTYPE_p_CvHuMoments swig_types[50]
+#define SWIGTYPE_p_CvKNearest swig_types[51]
+#define SWIGTYPE_p_CvKalman swig_types[52]
+#define SWIGTYPE_p_CvLineIterator swig_types[53]
+#define SWIGTYPE_p_CvMLData swig_types[54]
+#define SWIGTYPE_p_CvMSERParams swig_types[55]
+#define SWIGTYPE_p_CvMat swig_types[56]
+#define SWIGTYPE_p_CvMatND swig_types[57]
+#define SWIGTYPE_p_CvMatrix3 swig_types[58]
+#define SWIGTYPE_p_CvMemBlock swig_types[59]
+#define SWIGTYPE_p_CvMemStorage swig_types[60]
+#define SWIGTYPE_p_CvMemStoragePos swig_types[61]
+#define SWIGTYPE_p_CvModuleInfo swig_types[62]
+#define SWIGTYPE_p_CvMoments swig_types[63]
+#define SWIGTYPE_p_CvNArrayIterator swig_types[64]
+#define SWIGTYPE_p_CvNextEdgeType swig_types[65]
+#define SWIGTYPE_p_CvNormalBayesClassifier swig_types[66]
+#define SWIGTYPE_p_CvPOSITObject swig_types[67]
+#define SWIGTYPE_p_CvPair16u32s swig_types[68]
+#define SWIGTYPE_p_CvParamGrid swig_types[69]
+#define SWIGTYPE_p_CvPluginFuncInfo swig_types[70]
+#define SWIGTYPE_p_CvPoint swig_types[71]
+#define SWIGTYPE_p_CvPoint2D32f swig_types[72]
+#define SWIGTYPE_p_CvPoint2D64f swig_types[73]
+#define SWIGTYPE_p_CvPoint3D32f swig_types[74]
+#define SWIGTYPE_p_CvPoint3D64f swig_types[75]
+#define SWIGTYPE_p_CvQuadEdge2D swig_types[76]
+#define SWIGTYPE_p_CvRNG_Wrapper swig_types[77]
+#define SWIGTYPE_p_CvRTParams swig_types[78]
+#define SWIGTYPE_p_CvRTrees swig_types[79]
+#define SWIGTYPE_p_CvRect swig_types[80]
+#define SWIGTYPE_p_CvSURFParams swig_types[81]
+#define SWIGTYPE_p_CvSURFPoint swig_types[82]
+#define SWIGTYPE_p_CvSVM swig_types[83]
+#define SWIGTYPE_p_CvSVMDecisionFunc swig_types[84]
+#define SWIGTYPE_p_CvSVMKernel swig_types[85]
+#define SWIGTYPE_p_CvSVMKernelRow swig_types[86]
+#define SWIGTYPE_p_CvSVMParams swig_types[87]
+#define SWIGTYPE_p_CvSVMSolutionInfo swig_types[88]
+#define SWIGTYPE_p_CvSVMSolver swig_types[89]
+#define SWIGTYPE_p_CvScalar swig_types[90]
+#define SWIGTYPE_p_CvSeq swig_types[91]
+#define SWIGTYPE_p_CvSeqBlock swig_types[92]
+#define SWIGTYPE_p_CvSeqReader swig_types[93]
+#define SWIGTYPE_p_CvSeqWriter swig_types[94]
+#define SWIGTYPE_p_CvSet swig_types[95]
+#define SWIGTYPE_p_CvSetElem swig_types[96]
+#define SWIGTYPE_p_CvSize swig_types[97]
+#define SWIGTYPE_p_CvSize2D32f swig_types[98]
+#define SWIGTYPE_p_CvSlice swig_types[99]
+#define SWIGTYPE_p_CvSparseMat swig_types[100]
+#define SWIGTYPE_p_CvSparseMatIterator swig_types[101]
+#define SWIGTYPE_p_CvSparseNode swig_types[102]
+#define SWIGTYPE_p_CvStarDetectorParams swig_types[103]
+#define SWIGTYPE_p_CvStarKeypoint swig_types[104]
+#define SWIGTYPE_p_CvStatModel swig_types[105]
+#define SWIGTYPE_p_CvStereoBMState swig_types[106]
+#define SWIGTYPE_p_CvStereoGCState swig_types[107]
+#define SWIGTYPE_p_CvString swig_types[108]
+#define SWIGTYPE_p_CvStringHashNode swig_types[109]
+#define SWIGTYPE_p_CvSubdiv2D swig_types[110]
+#define SWIGTYPE_p_CvSubdiv2DEdge_Wrapper swig_types[111]
+#define SWIGTYPE_p_CvSubdiv2DPoint swig_types[112]
+#define SWIGTYPE_p_CvSubdiv2DPointLocation swig_types[113]
+#define SWIGTYPE_p_CvTermCriteria swig_types[114]
+#define SWIGTYPE_p_CvTrainTestSplit swig_types[115]
+#define SWIGTYPE_p_CvTrainTestSplit_class_part swig_types[116]
+#define SWIGTYPE_p_CvTrainTestSplit_train_sample_part swig_types[117]
+#define SWIGTYPE_p_CvTreeNodeIterator swig_types[118]
+#define SWIGTYPE_p_CvTypeInfo swig_types[119]
+#define SWIGTYPE_p_CvVectors swig_types[120]
+#define SWIGTYPE_p_CvVectors_data swig_types[121]
+#define SWIGTYPE_p_GetRow swig_types[122]
+#define SWIGTYPE_p_SelectWorkingSet swig_types[123]
+#define SWIGTYPE_p__IplConvKernel swig_types[124]
+#define SWIGTYPE_p__IplConvKernelFP swig_types[125]
+#define SWIGTYPE_p__IplImage swig_types[126]
+#define SWIGTYPE_p__IplROI swig_types[127]
+#define SWIGTYPE_p__IplTileInfo swig_types[128]
+#define SWIGTYPE_p_bool swig_types[129]
+#define SWIGTYPE_p_char swig_types[130]
+#define SWIGTYPE_p_double swig_types[131]
+#define SWIGTYPE_p_float swig_types[132]
+#define SWIGTYPE_p_int swig_types[133]
+#define SWIGTYPE_p_int64_t swig_types[134]
+#define SWIGTYPE_p_p_CvMat swig_types[135]
+#define SWIGTYPE_p_p_double swig_types[136]
+#define SWIGTYPE_p_p_float swig_types[137]
+#define SWIGTYPE_p_p_int swig_types[138]
+#define SWIGTYPE_p_p_unsigned_char swig_types[139]
+#define SWIGTYPE_p_signed_char swig_types[140]
+#define SWIGTYPE_p_size_t swig_types[141]
+#define SWIGTYPE_p_uint64_t swig_types[142]
+#define SWIGTYPE_p_unsigned_char swig_types[143]
+#define SWIGTYPE_p_unsigned_short swig_types[144]
+#define SWIGTYPE_p_vectorT_float_t swig_types[145]
+#define SWIGTYPE_p_vectorT_vectorT_float_t_t swig_types[146]
+#define SWIGTYPE_p_vectorT_vectorT_int_t_t swig_types[147]
+#define SWIGTYPE_p_void swig_types[148]
+static swig_type_info *swig_types[150];
+static swig_module_info swig_module = {swig_types, 149, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -2673,11 +2878,16 @@ static swig_module_info swig_module = {swig_types, 131, 0, 0, 0, 0};
 /*-----------------------------------------------
               @(target):= _ml.so
   ------------------------------------------------*/
-#define SWIG_init    init_ml
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_init    PyInit__ml
+
+#else
+#  define SWIG_init    init_ml
 
+#endif
 #define SWIG_name    "_ml"
 
-#define SWIGVERSION 0x010335 
+#define SWIGVERSION 0x010340 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2689,28 +2899,28 @@ static swig_module_info swig_module = {swig_types, 131, 0, 0, 0, 0};
 
 
 namespace swig {
-  class PyObject_ptr {
+  class SwigPtr_PyObject {
   protected:
     PyObject *_obj;
 
   public:
-    PyObject_ptr() :_obj(0)
+    SwigPtr_PyObject() :_obj(0)
     {
     }
 
-    PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj)
+    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
     {
       Py_XINCREF(_obj);      
     }
     
-    PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
+    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
     {
       if (initial_ref) {
         Py_XINCREF(_obj);
       }
     }
     
-    PyObject_ptr & operator=(const PyObject_ptr& item) 
+    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
     {
       Py_XINCREF(item._obj);
       Py_XDECREF(_obj);
@@ -2718,7 +2928,7 @@ namespace swig {
       return *this;      
     }
     
-    ~PyObject_ptr() 
+    ~SwigPtr_PyObject() 
     {
       Py_XDECREF(_obj);
     }
@@ -2737,10 +2947,10 @@ namespace swig {
 
 
 namespace swig {
-  struct PyObject_var : PyObject_ptr {
-    PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { }
+  struct SwigVar_PyObject : SwigPtr_PyObject {
+    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
     
-    PyObject_var & operator = (PyObject* obj)
+    SwigVar_PyObject & operator = (PyObject* obj)
     {
       Py_XDECREF(_obj);
       _obj = obj;
@@ -2759,71 +2969,72 @@ namespace swig {
 
 
 
+#include "pyhelpers.h"
+
 static CvArr * PyObject_to_CvArr(PyObject * obj, bool * freearg);
-static CvArr * PySequence_to_CvArr( PyObject * obj );
 
 // convert a python sequence/array/list object into a c-array
 #define PyObject_AsArrayImpl(func, ctype, ptype)                              \
-       int func(PyObject * obj, ctype * array, int len){                         \
-       void * mat_vptr=NULL;                                                     \
-       void * im_vptr=NULL;                                                      \
-       if(PyNumber_Check(obj)){                                                  \
-               memset( array, 0, sizeof(ctype)*len );                                \
-               array[0] = PyObject_As##ptype( obj );                                 \
-       }                                                                         \
-       else if(PyList_Check(obj) || PyTuple_Check(obj)){                         \
-               int seqsize = PySequence_Size(obj);                                   \
-               for(int i=0; i<len && i<seqsize; i++){                                \
-                       if(i<seqsize){                                                    \
-                   array[i] =  PyObject_As##ptype( PySequence_GetItem(obj, i) ); \
-                       }                                                                 \
-                       else{                                                             \
-                               array[i] = 0;                                                 \
-                       }                                                                 \
-               }                                                                     \
-       }                                                                         \
-       else if( SWIG_ConvertPtr(obj, &mat_vptr, SWIGTYPE_p_CvMat, 0)!=-1 ||      \
-                SWIG_ConvertPtr(obj, &im_vptr, SWIGTYPE_p__IplImage, 0)!=-1)     \
-       {                                                                         \
-               CvMat * mat = (CvMat *) mat_vptr;                                     \
-               CvMat stub;                                                           \
-               if(im_vptr) mat = cvGetMat(im_vptr, &stub);                           \
-               if( mat->rows!=1 && mat->cols!=1 ){                                   \
-                       PyErr_SetString( PyExc_TypeError,                                 \
-                            "PyObject_As*Array: CvArr must be row or column vector" );   \
-                       return -1;                                                        \
-               }                                                                     \
-               if( mat->rows==1 && mat->cols==1 ){                                   \
-                       CvScalar val;                                                     \
-                       if( len!=CV_MAT_CN(mat->type) ){                                  \
-                               PyErr_SetString( PyExc_TypeError,                             \
-                               "PyObject_As*Array: CvArr channels != length" );              \
-                               return -1;                                                    \
-                       }                                                                 \
-                       val = cvGet1D(mat, 0);                                            \
-                       for(int i=0; i<len; i++){                                         \
-                               array[i] = (ctype) val.val[i];                                \
-                       }                                                                 \
-               }                                                                     \
-               else{                                                                 \
-                       mat = cvReshape(mat, &stub, -1, mat->rows*mat->cols);             \
-                       if( mat->rows != len ){                                           \
-                               PyErr_SetString( PyExc_TypeError,                             \
-                                "PyObject_As*Array: CvArr rows or cols must equal length" ); \
-                                return -1;                                                   \
-                       }                                                                 \
-                       for(int i=0; i<len; i++){                                         \
-                               CvScalar val = cvGet1D(mat, i);                               \
-                               array[i] = (ctype) val.val[0];                                \
-                       }                                                                 \
-               }                                                                     \
-       }                                                                         \
-       else{                                                                     \
-               PyErr_SetString( PyExc_TypeError,                                     \
-                               "PyObject_As*Array: Expected a number, sequence or CvArr" );  \
-               return -1;                                                            \
-       }                                                                         \
-       return 0;                                                                 \
+  int func(PyObject * obj, ctype * array, int len){                         \
+  void * mat_vptr=NULL;                                                     \
+  void * im_vptr=NULL;                                                      \
+  if(PyNumber_Check(obj)){                                                  \
+    memset( array, 0, sizeof(ctype)*len );                                \
+    array[0] = PyObject_As##ptype( obj );                                 \
+  }                                                                         \
+  else if(PyList_Check(obj) || PyTuple_Check(obj)){                         \
+    int seqsize = PySequence_Size(obj);                                   \
+    for(int i=0; i<len && i<seqsize; i++){                                \
+      if(i<seqsize){                                                    \
+              array[i] =  PyObject_As##ptype( PySequence_GetItem(obj, i) ); \
+      }                                                                 \
+      else{                                                             \
+        array[i] = 0;                                                 \
+      }                                                                 \
+    }                                                                     \
+  }                                                                         \
+  else if( SWIG_ConvertPtr(obj, &mat_vptr, SWIGTYPE_p_CvMat, 0)!=-1 ||      \
+           SWIG_ConvertPtr(obj, &im_vptr, SWIGTYPE_p__IplImage, 0)!=-1)     \
+  {                                                                         \
+    CvMat * mat = (CvMat *) mat_vptr;                                     \
+    CvMat stub;                                                           \
+    if(im_vptr) mat = cvGetMat(im_vptr, &stub);                           \
+    if( mat->rows!=1 && mat->cols!=1 ){                                   \
+      PyErr_SetString( PyExc_TypeError,                                 \
+           "PyObject_As*Array: CvArr must be row or column vector" );   \
+      return -1;                                                        \
+    }                                                                     \
+    if( mat->rows==1 && mat->cols==1 ){                                   \
+      CvScalar val;                                                     \
+      if( len!=CV_MAT_CN(mat->type) ){                                  \
+        PyErr_SetString( PyExc_TypeError,                             \
+        "PyObject_As*Array: CvArr channels != length" );              \
+        return -1;                                                    \
+      }                                                                 \
+      val = cvGet1D(mat, 0);                                            \
+      for(int i=0; i<len; i++){                                         \
+        array[i] = (ctype) val.val[i];                                \
+      }                                                                 \
+    }                                                                     \
+    else{                                                                 \
+      mat = cvReshape(mat, &stub, -1, mat->rows*mat->cols);             \
+      if( mat->rows != len ){                                           \
+        PyErr_SetString( PyExc_TypeError,                             \
+         "PyObject_As*Array: CvArr rows or cols must equal length" ); \
+         return -1;                                                   \
+      }                                                                 \
+      for(int i=0; i<len; i++){                                         \
+        CvScalar val = cvGet1D(mat, i);                               \
+        array[i] = (ctype) val.val[0];                                \
+      }                                                                 \
+    }                                                                     \
+  }                                                                         \
+  else{                                                                     \
+    PyErr_SetString( PyExc_TypeError,                                     \
+        "PyObject_As*Array: Expected a number, sequence or CvArr" );  \
+    return -1;                                                            \
+  }                                                                         \
+  return 0;                                                                 \
 }
 
 PyObject_AsArrayImpl( PyObject_AsFloatArray, float, Double );
@@ -2831,185 +3042,170 @@ PyObject_AsArrayImpl( PyObject_AsDoubleArray, double, Double );
 PyObject_AsArrayImpl( PyObject_AsLongArray, int, Long );
 
 static CvPoint PyObject_to_CvPoint(PyObject * obj){
-       CvPoint val;
-       CvPoint *ptr;
-       CvPoint2D32f * ptr2D32f;
-       CvScalar * scalar;
+  CvPoint val;
+  CvPoint *ptr;
+  CvPoint2D32f * ptr2D32f;
+  CvScalar * scalar;
 
-       if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
-               return *ptr;
-       }
-       if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
-               return cvPointFrom32f( *ptr2D32f );
-       }
-       if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
-               return cvPointFrom32f(cvPoint2D32f( scalar->val[0], scalar->val[1] ));
-       }
-       if(PyObject_AsLongArray(obj, (int *) &val, 2) != -1){
-               return val;
-       }
+  if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
+    return *ptr;
+  }
+  if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
+    return cvPointFrom32f( *ptr2D32f );
+  }
+  if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
+    return cvPointFrom32f(cvPoint2D32f( scalar->val[0], scalar->val[1] ));
+  }
+  if(PyObject_AsLongArray(obj, (int *) &val, 2) != -1){
+    return val;
+  }
 
-       PyErr_SetString( PyExc_TypeError, "could not convert to CvPoint");
-       return cvPoint(0,0);
+  PyErr_SetString( PyExc_TypeError, "could not convert to CvPoint");
+  return cvPoint(0,0);
 }
 
 static CvPoint2D32f PyObject_to_CvPoint2D32f(PyObject * obj){
     CvPoint2D32f val;
     CvPoint2D32f *ptr2D32f;
-       CvPoint *ptr;
-       CvScalar * scalar;
+  CvPoint *ptr;
+  CvScalar * scalar;
     if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
-               return *ptr2D32f;
-       }
-       if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
-               return cvPointTo32f(*ptr);
-       }
-       if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
-               return cvPoint2D32f( scalar->val[0], scalar->val[1] );
-       }
-       if(PyObject_AsFloatArray(obj, (float *) &val, 2) != -1){
-               return val;
-       }
-       PyErr_SetString(PyExc_TypeError, "could not convert to CvPoint2D32f");
-       return cvPoint2D32f(0,0);
+    return *ptr2D32f;
+  }
+  if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
+    return cvPointTo32f(*ptr);
+  }
+  if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
+    return cvPoint2D32f( scalar->val[0], scalar->val[1] );
+  }
+  if(PyObject_AsFloatArray(obj, (float *) &val, 2) != -1){
+    return val;
+  }
+  PyErr_SetString(PyExc_TypeError, "could not convert to CvPoint2D32f");
+  return cvPoint2D32f(0,0);
 }
 
 /* Check if this object can be interpreted as a CvScalar */
 static bool CvScalar_Check(PyObject * obj){
-       void * vptr;
+  void * vptr;
     CvScalar val;
-       return SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar,     0 ) != -1 ||
-              SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0 ) != -1 ||
+  return SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar,     0 ) != -1 ||
+         SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0 ) != -1 ||
            SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint,      0 ) != -1 ||
-              PyObject_AsDoubleArray(obj, val.val, 4) !=-1;
+         PyObject_AsDoubleArray(obj, val.val, 4) !=-1;
 }
 
 static CvScalar PyObject_to_CvScalar(PyObject * obj){
-       CvScalar val;
-       CvScalar * ptr;
+  CvScalar val;
+  CvScalar * ptr;
     CvPoint2D32f *ptr2D32f;
-       CvPoint *pt_ptr;
-       void * vptr;
-       if( SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0 ) != -1)
-       {
-               ptr = (CvScalar *) vptr;
-               return *ptr;
-       }
-       if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
+  CvPoint *pt_ptr;
+  void * vptr;
+  if( SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0 ) != -1)
+  {
+    ptr = (CvScalar *) vptr;
+    return *ptr;
+  }
+  if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
         return cvScalar(ptr2D32f->x, ptr2D32f->y);
     }
     if( SWIG_ConvertPtr(obj, (void**)&pt_ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
         return cvScalar(pt_ptr->x, pt_ptr->y);
     }
-       if(PyObject_AsDoubleArray(obj, val.val, 4)!=-1){
-               return val;
+  if(PyObject_AsDoubleArray(obj, val.val, 4)!=-1){
+    return val;
+  }
+  return cvScalar(-1,-1,-1,-1); 
+}
+
+static int CvArr_Check( PyObject * obj )
+{
+       void *ptr;
+       if( obj == Py_None ||
+           SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_void,       0) ) ||
+           SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvMat,       0) ) ||
+        SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvSeq,       0) ) ||
+        SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvContour,   0) ) ||
+        SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvSparseMat, 0) ) ||
+        SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvMatND,     0) ) ||
+        PyObject_HasAttrString(obj, "__array_interface__") ||
+        PySequence_Check(obj) ) 
+    { 
+        return 1;
        }
-       return cvScalar(-1,-1,-1,-1); 
+    PyErr_Clear();
+    return 0;
 }
 
 /* if python sequence type, convert to CvMat or CvMatND */
-static CvArr * PyObject_to_CvArr(PyObject * obj, bool * freearg){
-       CvArr * cvarr;
-       *freearg = false;
+static CvArr * PyObject_to_CvArr (PyObject * obj, bool * freearg)
+{
+  CvArr * cvarr = NULL;
+  *freearg = false;
 
-       // check if OpenCV type
-       if( PySwigObject_Check(obj) ){
-               SWIG_ConvertPtr(obj, &cvarr, 0, SWIG_POINTER_EXCEPTION);
-       }
-       else if(PyList_Check(obj) || PyTuple_Check(obj)){
-               cvarr = PySequence_to_CvArr( obj );
-               *freearg = (cvarr != NULL);
-       }
-       else if(PyLong_Check(obj) && PyLong_AsLong(obj)==0){
-               return NULL;
-       }
-       else {
-               SWIG_ConvertPtr(obj, (void**)&cvarr, 0, SWIG_POINTER_EXCEPTION);
-       }
-       return cvarr;
+  if ( obj == Py_None )
+  {
+    // Interpret None as NULL pointer 
+    return NULL;
+  }
+  else if( SWIG_IsOK( SWIG_ConvertPtr(obj, (void **)& cvarr, SWIGTYPE_p_void,       0) ) ||
+      SWIG_IsOK( SWIG_ConvertPtr (obj, (void** )& cvarr, SWIGTYPE_p_CvMat, 0) ) ||
+      SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvSeq, 0) ) ||
+      SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvContour, 0) ) ||
+      SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvSparseMat, 0) ) ||
+      SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvMatND, 0) ))
+  {
+    // we got a directly wrapped void * pointer, OpenCV array or sequence type
+    return cvarr;
+  }
+  else if (PyObject_HasAttrString (obj, "__array_interface__"))
+  {
+    // if we didn't get our own datatype, let's see if it supports the array protocol
+    // array protocol is great because we just have to create another header but can
+    // use the original data without copying
+    cvarr = PyArray_to_CvArr (obj);
+    *freearg = (cvarr != NULL);
+  }
+  else if (PySequence_Check (obj))
+  {
+    // our next bet is a tuple or list of tuples or lists this has to be copied over, however
+    cvarr = PySequence_to_CvArr (obj);
+    *freearg = (cvarr != NULL);
+  }
+  else if (PyLong_Check (obj) && PyLong_AsLong (obj) == 0)
+  {
+    // Interpret a '0' integer as a NULL pointer
+    * freearg = false;
+    return NULL;
+  }
+  else 
+  {
+    // TODO, throw an error here
+    return NULL;
+  }
+  
+  return cvarr;
 }
 
-static int PyObject_GetElemType(PyObject * obj){
-       void *vptr;
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint, 0) != -1) return CV_32SC2;   
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize, 0) != -1) return CV_32SC2;    
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvRect, 0) != -1) return CV_32SC4;    
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize2D32f, 0) != -1) return CV_32FC2;       
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0) != -1) return CV_32FC2;      
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D32f, 0) != -1) return CV_32FC3;      
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D64f, 0) != -1) return CV_64FC2;      
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D64f, 0) != -1) return CV_64FC3;      
-       if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0) != -1) return CV_64FC4;  
-       if(PyTuple_Check(obj) || PyList_Check(obj)) return CV_MAKE_TYPE(CV_32F, PySequence_Size( obj ));
-       if(PyLong_Check(obj)) return CV_32S;
-       return CV_32F;
-}
-
-// Would like this to convert Python lists to CvMat
-// Also lists of CvPoints, CvScalars, CvMats? etc
-static CvArr * PySequence_to_CvArr( PyObject * obj ){
-       int dims[CV_MAX_DIM] = {1,1,1};
-       int ndim=0;
-       int cvtype;
-       PyObject * item;
-       
-       // figure out dimensions
-       for(item = obj; 
-               (PyTuple_Check(item) || PyList_Check(item));
-               item = PySequence_GetItem(item, 0))
-       {
-               dims[ndim] = PySequence_Size( item ); 
-               ndim++;
-       }
 
-       
-       if(ndim==0){
-               PyErr_SetString(PyExc_TypeError, "Cannot convert an empty python object to a CvArr");
-               return NULL;
-       }
-       
-       cvtype = PyObject_GetElemType(item);
-       // collapse last dim into NCH if we found a single channel, but the last dim is <=3
-       if(CV_MAT_CN(cvtype)==1 && dims[ndim-1]>1 && dims[ndim-1]<4){
-               cvtype=CV_MAKE_TYPE(cvtype, dims[ndim-1]);
-               dims[ndim-1]=1; 
-               ndim--;
-       }
-       
-       if(cvtype==-1){
-               PyErr_SetString(PyExc_TypeError, "Could not determine OpenCV element type of Python sequence");
-               return NULL;
-       }
-       
-       // CvMat
-       if(ndim<=2){
-               CvMat *m = cvCreateMat(dims[0], dims[1], cvtype);
-               for(int i=0; i<dims[0]; i++){
-                       PyObject * rowobj = PySequence_GetItem(obj, i);
-                       if( dims[1] > 1 ){
-                               // double check size
-                               assert((PyTuple_Check(rowobj) || PyList_Check(rowobj)) && 
-                                               PySequence_Size(rowobj) == dims[1]);
-
-                               for(int j=0; j<dims[1]; j++){
-                                       PyObject * colobj = PySequence_GetItem(rowobj, j);
-                                       cvSet2D( m, i, j, PyObject_to_CvScalar( colobj ) );
-                               }
-                       }
-                       else{
-                               cvSet1D(m, i, PyObject_to_CvScalar( rowobj ) );
-                       }
-               }
-               return (CvArr *) m;
-       }
-
-       // CvMatND
-       PyErr_SetString(PyExc_TypeError, "Cannot convert Python Object to CvArr -- ndim > 3");
-       return NULL;
-       
+static int PyObject_GetElemType(PyObject * obj){
+  void *vptr;
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint, 0) != -1) return CV_32SC2; 
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize, 0) != -1) return CV_32SC2;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvRect, 0) != -1) return CV_32SC4;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize2D32f, 0) != -1) return CV_32FC2; 
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0) != -1) return CV_32FC2;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D32f, 0) != -1) return CV_32FC3;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D64f, 0) != -1) return CV_64FC2;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D64f, 0) != -1) return CV_64FC3;  
+  if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0) != -1) return CV_64FC4;  
+  if(PyTuple_Check(obj) || PyList_Check(obj)) return CV_MAKE_TYPE(CV_32F, PySequence_Size( obj ));
+  if(PyLong_Check(obj)) return CV_32S;
+  return CV_32F;
 }
 
 
+
 // Wrapper class
 class CvRNG_Wrapper {
 private:
@@ -3030,6 +3226,33 @@ public:
 };
 
 
+SWIGINTERNINLINE PyObject*
+  SWIG_From_bool  (bool value)
+{
+  return PyBool_FromLong(value ? 1 : 0);
+}
+
+
+// Wrapper class
+class CvSubdiv2DEdge_Wrapper {
+private:
+       CvSubdiv2DEdge m_val;
+public:
+       CvSubdiv2DEdge_Wrapper( const CvSubdiv2DEdge & val ) :
+               m_val(val)
+       {
+       }
+       CvSubdiv2DEdge * ptr() { return &m_val; }
+       CvSubdiv2DEdge & ref() { return m_val; }
+       bool operator==(const CvSubdiv2DEdge_Wrapper & x){
+               return m_val==x.m_val;
+       }
+       bool operator!=(const CvSubdiv2DEdge_Wrapper & x){
+               return m_val!=x.m_val;
+       }
+};
+
+
 SWIGINTERN int
 SWIG_AsVal_double (PyObject *obj, double *val)
 {
@@ -3154,79 +3377,6 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
 }
 
 
-#include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
-#endif
-
-
-SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val)
-{
-  int res = SWIG_TypeError;
-  if (PyLong_Check(obj)) {
-    unsigned long long v = PyLong_AsUnsignedLongLong(obj);
-    if (!PyErr_Occurred()) {
-      if (val) *val = v;
-      return SWIG_OK;
-    } else {
-      PyErr_Clear();
-    }
-  } else {
-    unsigned long v;
-    res = SWIG_AsVal_unsigned_SS_long (obj,&v);
-    if (SWIG_IsOK(res)) {
-      if (val) *val = v;
-      return res;
-    }
-  }
-#ifdef SWIG_PYTHON_CAST_MODE
-  {
-    const double mant_max = 1LL << DBL_MANT_DIG;
-    double d;
-    res = SWIG_AsVal_double (obj,&d);
-    if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
-      if (val) *val = (unsigned long long)(d);
-      return SWIG_AddCast(res);
-    }
-    res = SWIG_TypeError;
-  }
-#endif
-  return res;
-}
-
-
-SWIGINTERNINLINE PyObject*
-  SWIG_From_bool  (bool value)
-{
-  return PyBool_FromLong(value ? 1 : 0);
-}
-
-
-// Wrapper class
-class CvSubdiv2DEdge_Wrapper {
-private:
-       CvSubdiv2DEdge m_val;
-public:
-       CvSubdiv2DEdge_Wrapper( const CvSubdiv2DEdge & val ) :
-               m_val(val)
-       {
-       }
-       CvSubdiv2DEdge * ptr() { return &m_val; }
-       CvSubdiv2DEdge & ref() { return m_val; }
-       bool operator==(const CvSubdiv2DEdge_Wrapper & x){
-               return m_val==x.m_val;
-       }
-       bool operator!=(const CvSubdiv2DEdge_Wrapper & x){
-               return m_val!=x.m_val;
-       }
-};
-
-
 SWIGINTERNINLINE int
 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
 {
@@ -3250,6 +3400,16 @@ SWIG_From_int  (int value)
 }
 
 
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
 SWIGINTERN int
 SWIG_AsVal_long (PyObject *obj, long* val)
 {
@@ -3335,7 +3495,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
       return pchar_descriptor ? 
        SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
     } else {
+#if PY_VERSION_HEX >= 0x03000000
+      return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#else
       return PyString_FromStringAndSize(carray, static_cast< int >(size));
+#endif
     }
   } else {
     return SWIG_Py_Void();
@@ -3353,10 +3517,28 @@ SWIG_FromCharPtr(const char *cptr)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
-  if (PyString_Check(obj)) {
+#if PY_VERSION_HEX>=0x03000000
+  if (PyUnicode_Check(obj))
+#else  
+  if (PyString_Check(obj))
+#endif
+  {
     char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+    if (!alloc && cptr) {
+        /* We can't allow converting without allocation, since the internal
+           representation of string in Python 3 is UCS-2/UCS-4 but we require
+           a UTF-8 representation.
+           TODO(bhy) More detailed explanation */
+        return SWIG_RuntimeError;
+    }
+    obj = PyUnicode_AsUTF8String(obj);
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
+    if(alloc) *alloc = SWIG_NEWOBJ;
+#else
     PyString_AsStringAndSize(obj, &cstr, &len);
-    if (cptr)  {
+#endif
+    if (cptr) {
       if (alloc) {
        /* 
           In python the user should not be able to modify the inner
@@ -3381,10 +3563,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
          *alloc = SWIG_OLDOBJ;
        }
       } else {
-       *cptr = PyString_AsString(obj);
+        #if PY_VERSION_HEX>=0x03000000
+        assert(0); /* Should never reach here in Python 3 */
+        #endif
+       *cptr = SWIG_Python_str_AsChar(obj);
       }
     }
     if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+    Py_XDECREF(obj);
+#endif
     return SWIG_OK;
   } else {
     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
@@ -3452,25 +3640,90 @@ SWIG_AsVal_float (PyObject * obj, float *val)
   return res;
 }
 
+
+typedef union {
+        int *count;
+        float *portion;
+    } CvTrainTestSplit_class_part;
+
+
+
+typedef union {
+        int count;
+        float portion;
+    } CvTrainTestSplit_train_sample_part;
+
+
+
+SWIGINTERN int
+SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
+{ 
+  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
+  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
+  if (SWIG_IsOK(res)) {
+    if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
+    if (csize <= size) {
+      if (val) {
+       if (csize) memcpy(val, cptr, csize*sizeof(char));
+       if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
+      }
+      if (alloc == SWIG_NEWOBJ) {
+       delete[] cptr;
+       res = SWIG_DelNewMask(res);
+      }      
+      return res;
+    }
+    if (alloc == SWIG_NEWOBJ) delete[] cptr;
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_char (PyObject * obj, char *val)
+{    
+  int res = SWIG_AsCharArray(obj, val, 1);
+  if (!SWIG_IsOK(res)) {
+    long v;
+    res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
+    if (SWIG_IsOK(res)) {
+      if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
+       if (val) *val = static_cast< char >(v);
+      } else {
+       res = SWIG_OverflowError;
+      }
+    }
+  }
+  return res;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_char  (char c) 
+{ 
+  return SWIG_FromCharPtrAndSize(&c,1);
+}
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 SWIGINTERN PyObject *_wrap_new_CvRNG_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRNG *arg1 = 0 ;
-  CvRNG_Wrapper *result = 0 ;
-  CvRNG temp1 ;
-  unsigned long long val1 ;
-  int ecode1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvRNG_Wrapper *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_CvRNG_Wrapper",&obj0)) SWIG_fail;
-  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG""'");
-  } 
-  temp1 = static_cast< CvRNG >(val1);
-  arg1 = &temp1;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_uint64_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG const &""'"); 
+  }
+  arg1 = reinterpret_cast< CvRNG * >(argp1);
   result = (CvRNG_Wrapper *)new CvRNG_Wrapper((CvRNG const &)*arg1);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRNG_Wrapper, SWIG_POINTER_NEW |  0 );
   return resultobj;
@@ -3482,10 +3735,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
-  CvRNG *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvRNG *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvRNG_Wrapper_ptr",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
@@ -3494,7 +3747,7 @@ SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ptr(PyObject *SWIGUNUSEDPARM(self), PyO
   }
   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
   result = (CvRNG *)(arg1)->ptr();
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long_long, 0 |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint64_t, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
@@ -3504,10 +3757,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
-  CvRNG *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvRNG *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvRNG_Wrapper_ref",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
@@ -3515,11 +3768,8 @@ SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ref(PyObject *SWIGUNUSEDPARM(self), PyO
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRNG_Wrapper_ref" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
   }
   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
-  {
-    CvRNG &_result_ref = (arg1)->ref();
-    result = (CvRNG *) &_result_ref;
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long_long, 0 |  0 );
+  result = (CvRNG *) &(arg1)->ref();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint64_t, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
@@ -3530,13 +3780,13 @@ SWIGINTERN PyObject *_wrap_CvRNG_Wrapper___eq__(PyObject *SWIGUNUSEDPARM(self),
   PyObject *resultobj = 0;
   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
   CvRNG_Wrapper *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvRNG_Wrapper___eq__",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
@@ -3564,13 +3814,13 @@ SWIGINTERN PyObject *_wrap_CvRNG_Wrapper___ne__(PyObject *SWIGUNUSEDPARM(self),
   PyObject *resultobj = 0;
   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
   CvRNG_Wrapper *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvRNG_Wrapper___ne__",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
@@ -3609,7 +3859,7 @@ SWIGINTERN PyObject *_wrap_delete_CvRNG_Wrapper(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -3633,11 +3883,11 @@ SWIGINTERN PyObject *CvRNG_Wrapper_swigregister(PyObject *SWIGUNUSEDPARM(self),
 SWIGINTERN PyObject *_wrap_new_CvSubdiv2DEdge_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSubdiv2DEdge *arg1 = 0 ;
-  CvSubdiv2DEdge_Wrapper *result = 0 ;
   CvSubdiv2DEdge temp1 ;
   size_t val1 ;
   int ecode1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSubdiv2DEdge_Wrapper *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_CvSubdiv2DEdge_Wrapper",&obj0)) SWIG_fail;
   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
@@ -3657,10 +3907,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
-  CvSubdiv2DEdge *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSubdiv2DEdge *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSubdiv2DEdge_Wrapper_ptr",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
@@ -3679,10 +3929,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
-  CvSubdiv2DEdge *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSubdiv2DEdge *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSubdiv2DEdge_Wrapper_ref",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
@@ -3690,10 +3940,7 @@ SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper_ref(PyObject *SWIGUNUSEDPARM(s
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSubdiv2DEdge_Wrapper_ref" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
   }
   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
-  {
-    CvSubdiv2DEdge &_result_ref = (arg1)->ref();
-    result = (CvSubdiv2DEdge *) &_result_ref;
-  }
+  result = (CvSubdiv2DEdge *) &(arg1)->ref();
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_size_t, 0 |  0 );
   return resultobj;
 fail:
@@ -3705,13 +3952,13 @@ SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper___eq__(PyObject *SWIGUNUSEDPAR
   PyObject *resultobj = 0;
   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
   CvSubdiv2DEdge_Wrapper *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvSubdiv2DEdge_Wrapper___eq__",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
@@ -3739,13 +3986,13 @@ SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper___ne__(PyObject *SWIGUNUSEDPAR
   PyObject *resultobj = 0;
   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
   CvSubdiv2DEdge_Wrapper *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvSubdiv2DEdge_Wrapper___ne__",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
@@ -3784,7 +4031,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSubdiv2DEdge_Wrapper(PyObject *SWIGUNUSEDPAR
   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -3828,7 +4075,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_type_set(PyObject *SWIGUNUSEDPARM(self), Py
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->type = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3839,10 +4085,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors *arg1 = (CvVectors *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_type_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors, 0 |  0 );
@@ -3881,7 +4127,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_dims_set(PyObject *SWIGUNUSEDPARM(self), Py
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->dims = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3892,10 +4137,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_dims_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors *arg1 = (CvVectors *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_dims_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors, 0 |  0 );
@@ -3934,7 +4179,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_count_set(PyObject *SWIGUNUSEDPARM(self), P
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3945,10 +4189,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors *arg1 = (CvVectors *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors, 0 |  0 );
@@ -3987,7 +4231,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_next_set(PyObject *SWIGUNUSEDPARM(self), Py
   }
   arg2 = reinterpret_cast< CvVectors * >(argp2);
   if (arg1) (arg1)->next = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3998,10 +4241,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_next_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors *arg1 = (CvVectors *) 0 ;
-  CvVectors *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvVectors *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_next_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors, 0 |  0 );
@@ -4020,10 +4263,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors *arg1 = (CvVectors *) 0 ;
-  CvVectors_data *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvVectors_data *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_data_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors, 0 |  0 );
@@ -4075,7 +4318,7 @@ SWIGINTERN PyObject *_wrap_delete_CvVectors(PyObject *SWIGUNUSEDPARM(self), PyOb
   arg1 = reinterpret_cast< CvVectors * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -4119,7 +4362,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_data_ptr_set(PyObject *SWIGUNUSEDPARM(self)
   }
   arg2 = reinterpret_cast< uchar ** >(argp2);
   if (arg1) (arg1)->ptr = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4130,10 +4372,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_data_ptr_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors_data *arg1 = (CvVectors_data *) 0 ;
-  uchar **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  uchar **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_data_ptr_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors_data, 0 |  0 );
@@ -4174,7 +4416,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_data_fl_set(PyObject *SWIGUNUSEDPARM(self),
     arg2=&buffer2;
   }
   if (arg1) (arg1)->fl = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4185,10 +4426,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_data_fl_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors_data *arg1 = (CvVectors_data *) 0 ;
-  float **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_data_fl_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors_data, 0 |  0 );
@@ -4227,7 +4468,6 @@ SWIGINTERN PyObject *_wrap_CvVectors_data_db_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< double ** >(argp2);
   if (arg1) (arg1)->db = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4238,10 +4478,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvVectors_data_db_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvVectors_data *arg1 = (CvVectors_data *) 0 ;
-  double **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvVectors_data_db_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVectors_data, 0 |  0 );
@@ -4293,7 +4533,7 @@ SWIGINTERN PyObject *_wrap_delete_CvVectors_data(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< CvVectors_data * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -4350,7 +4590,7 @@ SWIGINTERN PyObject *_wrap_delete_CvStatModel(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvStatModel * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -4413,7 +4653,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_save__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvStatModel_save",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvStatModel, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_save" "', argument " "1"" of type '" "CvStatModel *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_save" "', argument " "1"" of type '" "CvStatModel const *""'"); 
   }
   arg1 = reinterpret_cast< CvStatModel * >(argp1);
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
@@ -4428,7 +4668,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_save__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   arg3 = reinterpret_cast< char * >(buf3);
   {
     try {
-      (arg1)->save((char const *)arg2,(char const *)arg3); 
+      ((CvStatModel const *)arg1)->save((char const *)arg2,(char const *)arg3); 
     } 
     catch (...) 
     {
@@ -4461,7 +4701,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_save__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   if (!PyArg_ParseTuple(args,(char *)"OO:CvStatModel_save",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvStatModel, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_save" "', argument " "1"" of type '" "CvStatModel *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_save" "', argument " "1"" of type '" "CvStatModel const *""'"); 
   }
   arg1 = reinterpret_cast< CvStatModel * >(argp1);
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
@@ -4471,7 +4711,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_save__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   arg2 = reinterpret_cast< char * >(buf2);
   {
     try {
-      (arg1)->save((char const *)arg2); 
+      ((CvStatModel const *)arg1)->save((char const *)arg2); 
     } 
     catch (...) 
     {
@@ -4531,8 +4771,8 @@ SWIGINTERN PyObject *_wrap_CvStatModel_save(PyObject *self, PyObject *args) {
 fail:
   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvStatModel_save'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    save(CvStatModel *,char const *,char const *)\n"
-    "    save(CvStatModel *,char const *)\n");
+    "    save(CvStatModel const *,char const *,char const *)\n"
+    "    save(CvStatModel const *,char const *)\n");
   return NULL;
 }
 
@@ -4700,7 +4940,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_write(PyObject *SWIGUNUSEDPARM(self), PyO
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvStatModel_write",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvStatModel, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_write" "', argument " "1"" of type '" "CvStatModel *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvStatModel_write" "', argument " "1"" of type '" "CvStatModel const *""'"); 
   }
   arg1 = reinterpret_cast< CvStatModel * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
@@ -4715,7 +4955,7 @@ SWIGINTERN PyObject *_wrap_CvStatModel_write(PyObject *SWIGUNUSEDPARM(self), PyO
   arg3 = reinterpret_cast< char * >(buf3);
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      ((CvStatModel const *)arg1)->write(arg2,(char const *)arg3); 
     } 
     catch (...) 
     {
@@ -4811,7 +5051,6 @@ SWIGINTERN PyObject *_wrap_new_CvParamGrid__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   double arg1 ;
   double arg2 ;
   double arg3 ;
-  CvParamGrid *result = 0 ;
   double val1 ;
   int ecode1 = 0 ;
   double val2 ;
@@ -4821,6 +5060,7 @@ SWIGINTERN PyObject *_wrap_new_CvParamGrid__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvParamGrid *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvParamGrid",&obj0,&obj1,&obj2)) SWIG_fail;
   ecode1 = SWIG_AsVal_double(obj0, &val1);
@@ -4902,10 +5142,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvParamGrid_check(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvParamGrid *arg1 = (CvParamGrid *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvParamGrid_check",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvParamGrid, 0 |  0 );
@@ -4952,7 +5192,6 @@ SWIGINTERN PyObject *_wrap_CvParamGrid_min_val_set(PyObject *SWIGUNUSEDPARM(self
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->min_val = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4963,10 +5202,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvParamGrid_min_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvParamGrid *arg1 = (CvParamGrid *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvParamGrid_min_val_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvParamGrid, 0 |  0 );
@@ -5005,7 +5244,6 @@ SWIGINTERN PyObject *_wrap_CvParamGrid_max_val_set(PyObject *SWIGUNUSEDPARM(self
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->max_val = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5016,10 +5254,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvParamGrid_max_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvParamGrid *arg1 = (CvParamGrid *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvParamGrid_max_val_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvParamGrid, 0 |  0 );
@@ -5058,7 +5296,6 @@ SWIGINTERN PyObject *_wrap_CvParamGrid_step_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->step = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5069,10 +5306,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvParamGrid_step_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvParamGrid *arg1 = (CvParamGrid *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvParamGrid_step_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvParamGrid, 0 |  0 );
@@ -5103,7 +5340,7 @@ SWIGINTERN PyObject *_wrap_delete_CvParamGrid(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvParamGrid * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -5160,7 +5397,7 @@ SWIGINTERN PyObject *_wrap_delete_CvNormalBayesClassifier(PyObject *SWIGUNUSEDPA
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -5180,41 +5417,29 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_1(PyObject *SWIGUNU
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  CvNormalBayesClassifier *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  CvNormalBayesClassifier *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvNormalBayesClassifier",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvNormalBayesClassifier" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvNormalBayesClassifier" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvNormalBayesClassifier" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvNormalBayesClassifier" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (CvNormalBayesClassifier *)new CvNormalBayesClassifier((CvMat const *)arg1,(CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -5225,8 +5450,56 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_1(PyObject *SWIGUNU
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvNormalBayesClassifier, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -5236,33 +5509,24 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_2(PyObject *SWIGUNU
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  CvNormalBayesClassifier *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvNormalBayesClassifier *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvNormalBayesClassifier",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvNormalBayesClassifier" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvNormalBayesClassifier" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvNormalBayesClassifier" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (CvNormalBayesClassifier *)new CvNormalBayesClassifier((CvMat const *)arg1,(CvMat const *)arg2,(CvMat const *)arg3); 
@@ -5273,8 +5537,44 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_2(PyObject *SWIGUNU
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvNormalBayesClassifier, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -5283,25 +5583,19 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_3(PyObject *SWIGUNU
   PyObject *resultobj = 0;
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  CvNormalBayesClassifier *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvNormalBayesClassifier *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_CvNormalBayesClassifier",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvNormalBayesClassifier" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvNormalBayesClassifier" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (CvNormalBayesClassifier *)new CvNormalBayesClassifier((CvMat const *)arg1,(CvMat const *)arg2); 
@@ -5312,8 +5606,32 @@ SWIGINTERN PyObject *_wrap_new_CvNormalBayesClassifier__SWIG_3(PyObject *SWIGUNU
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvNormalBayesClassifier, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -5408,17 +5726,12 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_0(PyObject *SWIGU
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   bool arg6 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   bool val6 ;
   int ecode6 = 0 ;
   PyObject * obj0 = 0 ;
@@ -5427,6 +5740,7 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_0(PyObject *SWIGU
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvNormalBayesClassifier_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5434,26 +5748,18 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_0(PyObject *SWIGU
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_train" "', argument " "1"" of type '" "CvNormalBayesClassifier *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvNormalBayesClassifier_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvNormalBayesClassifier_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvNormalBayesClassifier_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   ecode6 = SWIG_AsVal_bool(obj5, &val6);
   if (!SWIG_IsOK(ecode6)) {
     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CvNormalBayesClassifier_train" "', argument " "6"" of type '" "bool""'");
@@ -5469,8 +5775,56 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_0(PyObject *SWIGU
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -5482,22 +5836,18 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_1(PyObject *SWIGU
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvNormalBayesClassifier_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5505,26 +5855,18 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_1(PyObject *SWIGU
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_train" "', argument " "1"" of type '" "CvNormalBayesClassifier *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvNormalBayesClassifier_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvNormalBayesClassifier_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvNormalBayesClassifier_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -5535,8 +5877,56 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_1(PyObject *SWIGU
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -5547,19 +5937,16 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_2(PyObject *SWIGU
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvNormalBayesClassifier_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5567,21 +5954,15 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_2(PyObject *SWIGU
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_train" "', argument " "1"" of type '" "CvNormalBayesClassifier *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvNormalBayesClassifier_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvNormalBayesClassifier_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -5592,8 +5973,44 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_2(PyObject *SWIGU
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -5603,16 +6020,14 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_3(PyObject *SWIGU
   CvNormalBayesClassifier *arg1 = (CvNormalBayesClassifier *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvNormalBayesClassifier_train",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5620,16 +6035,12 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_3(PyObject *SWIGU
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_train" "', argument " "1"" of type '" "CvNormalBayesClassifier *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvNormalBayesClassifier_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3); 
@@ -5640,8 +6051,32 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_train__SWIG_3(PyObject *SWIGU
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -5780,16 +6215,14 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_0(PyObject *SWI
   CvNormalBayesClassifier *arg1 = (CvNormalBayesClassifier *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvNormalBayesClassifier_predict",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5797,16 +6230,12 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_0(PyObject *SWI
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_predict" "', argument " "1"" of type '" "CvNormalBayesClassifier const *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvNormalBayesClassifier_predict" "', argument " "3"" of type '" "CvMat *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (float)((CvNormalBayesClassifier const *)arg1)->predict((CvMat const *)arg2,arg3); 
@@ -5817,8 +6246,32 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_0(PyObject *SWI
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -5827,13 +6280,12 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_1(PyObject *SWI
   PyObject *resultobj = 0;
   CvNormalBayesClassifier *arg1 = (CvNormalBayesClassifier *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvNormalBayesClassifier_predict",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
@@ -5841,11 +6293,9 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_1(PyObject *SWI
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_predict" "', argument " "1"" of type '" "CvNormalBayesClassifier const *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvNormalBayesClassifier_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (float)((CvNormalBayesClassifier const *)arg1)->predict((CvMat const *)arg2); 
@@ -5856,8 +6306,20 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_predict__SWIG_1(PyObject *SWI
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -5963,7 +6425,7 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_write(PyObject *SWIGUNUSEDPAR
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvNormalBayesClassifier_write",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvNormalBayesClassifier, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_write" "', argument " "1"" of type '" "CvNormalBayesClassifier *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvNormalBayesClassifier_write" "', argument " "1"" of type '" "CvNormalBayesClassifier const *""'"); 
   }
   arg1 = reinterpret_cast< CvNormalBayesClassifier * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
@@ -5978,7 +6440,7 @@ SWIGINTERN PyObject *_wrap_CvNormalBayesClassifier_write(PyObject *SWIGUNUSEDPAR
   arg3 = reinterpret_cast< char * >(buf3);
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      ((CvNormalBayesClassifier const *)arg1)->write(arg2,(char const *)arg3); 
     } 
     catch (...) 
     {
@@ -6084,7 +6546,7 @@ SWIGINTERN PyObject *_wrap_delete_CvKNearest(PyObject *SWIGUNUSEDPARM(self), PyO
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -6105,13 +6567,9 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg3 = (CvMat *) 0 ;
   bool arg4 ;
   int arg5 ;
-  CvKNearest *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   bool val4 ;
   int ecode4 = 0 ;
   int val5 ;
@@ -6121,23 +6579,18 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  CvKNearest *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvKNearest",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvKNearest" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvKNearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvKNearest" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   ecode4 = SWIG_AsVal_bool(obj3, &val4);
   if (!SWIG_IsOK(ecode4)) {
     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvKNearest" "', argument " "4"" of type '" "bool""'");
@@ -6158,8 +6611,44 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvKNearest, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -6170,36 +6659,27 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   bool arg4 ;
-  CvKNearest *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   bool val4 ;
   int ecode4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  CvKNearest *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvKNearest",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvKNearest" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvKNearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvKNearest" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   ecode4 = SWIG_AsVal_bool(obj3, &val4);
   if (!SWIG_IsOK(ecode4)) {
     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvKNearest" "', argument " "4"" of type '" "bool""'");
@@ -6215,8 +6695,44 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvKNearest, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -6226,33 +6742,24 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  CvKNearest *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvKNearest *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvKNearest",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvKNearest" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvKNearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvKNearest" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (CvKNearest *)new CvKNearest((CvMat const *)arg1,(CvMat const *)arg2,(CvMat const *)arg3); 
@@ -6263,8 +6770,44 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvKNearest, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -6273,25 +6816,19 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
   PyObject *resultobj = 0;
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  CvKNearest *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvKNearest *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_CvKNearest",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvKNearest" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvKNearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (CvKNearest *)new CvKNearest((CvMat const *)arg1,(CvMat const *)arg2); 
@@ -6302,8 +6839,32 @@ SWIGINTERN PyObject *_wrap_new_CvKNearest__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvKNearest, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -6432,15 +6993,11 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   bool arg5 ;
   int arg6 ;
   bool arg7 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   bool val5 ;
   int ecode5 = 0 ;
   int val6 ;
@@ -6454,6 +7011,7 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvKNearest_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6461,21 +7019,15 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_train" "', argument " "1"" of type '" "CvKNearest *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvKNearest_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   ecode5 = SWIG_AsVal_bool(obj4, &val5);
   if (!SWIG_IsOK(ecode5)) {
     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvKNearest_train" "', argument " "5"" of type '" "bool""'");
@@ -6501,8 +7053,44 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -6515,15 +7103,11 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   CvMat *arg4 = (CvMat *) 0 ;
   bool arg5 ;
   int arg6 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   bool val5 ;
   int ecode5 = 0 ;
   int val6 ;
@@ -6534,6 +7118,7 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvKNearest_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6541,21 +7126,15 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_train" "', argument " "1"" of type '" "CvKNearest *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvKNearest_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   ecode5 = SWIG_AsVal_bool(obj4, &val5);
   if (!SWIG_IsOK(ecode5)) {
     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvKNearest_train" "', argument " "5"" of type '" "bool""'");
@@ -6576,8 +7155,44 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -6589,15 +7204,11 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   bool arg5 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   bool val5 ;
   int ecode5 = 0 ;
   PyObject * obj0 = 0 ;
@@ -6605,6 +7216,7 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvKNearest_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6612,21 +7224,15 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_train" "', argument " "1"" of type '" "CvKNearest *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvKNearest_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   ecode5 = SWIG_AsVal_bool(obj4, &val5);
   if (!SWIG_IsOK(ecode5)) {
     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvKNearest_train" "', argument " "5"" of type '" "bool""'");
@@ -6642,8 +7248,44 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -6654,19 +7296,16 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvKNearest_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6674,21 +7313,15 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_train" "', argument " "1"" of type '" "CvKNearest *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvKNearest_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -6699,8 +7332,44 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -6710,16 +7379,14 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
   CvKNearest *arg1 = (CvKNearest *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvKNearest_train",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6727,16 +7394,12 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_train" "', argument " "1"" of type '" "CvKNearest *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvKNearest_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3); 
@@ -6747,8 +7410,32 @@ SWIGINTERN PyObject *_wrap_CvKNearest_train__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -6936,21 +7623,16 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_0(PyObject *SWIGUNUSEDP
   float **arg5 = (float **) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   void *vptr5 ;
   float *buffer5 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -6958,6 +7640,7 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_0(PyObject *SWIGUNUSEDP
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvKNearest_find_nearest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -6965,21 +7648,17 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_0(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_find_nearest" "', argument " "1"" of type '" "CvKNearest const *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_find_nearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvKNearest_find_nearest" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_find_nearest" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     if ((SWIG_ConvertPtr(obj4, &vptr5, SWIGTYPE_p_float, 1)) == -1){
       SWIG_fail;
@@ -6987,16 +7666,12 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_0(PyObject *SWIGUNUSEDP
     buffer5 = (float *) vptr5;
     arg5=&buffer5;
   }
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvKNearest_find_nearest" "', argument " "6"" of type '" "CvMat *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvKNearest_find_nearest" "', argument " "7"" of type '" "CvMat *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
       result = (float)((CvKNearest const *)arg1)->find_nearest((CvMat const *)arg2,arg3,arg4,(float const **)arg5,arg6,arg7); 
@@ -7007,8 +7682,56 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_0(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -7021,25 +7744,22 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_1(PyObject *SWIGUNUSEDP
   CvMat *arg4 = (CvMat *) 0 ;
   float **arg5 = (float **) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   void *vptr5 ;
   float *buffer5 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvKNearest_find_nearest",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7047,21 +7767,17 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_1(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_find_nearest" "', argument " "1"" of type '" "CvKNearest const *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_find_nearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvKNearest_find_nearest" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_find_nearest" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     if ((SWIG_ConvertPtr(obj4, &vptr5, SWIGTYPE_p_float, 1)) == -1){
       SWIG_fail;
@@ -7069,11 +7785,9 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_1(PyObject *SWIGUNUSEDP
     buffer5 = (float *) vptr5;
     arg5=&buffer5;
   }
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvKNearest_find_nearest" "', argument " "6"" of type '" "CvMat *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
       result = (float)((CvKNearest const *)arg1)->find_nearest((CvMat const *)arg2,arg3,arg4,(float const **)arg5,arg6); 
@@ -7084,8 +7798,44 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_1(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
@@ -7097,15 +7847,12 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_2(PyObject *SWIGUNUSEDP
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   float **arg5 = (float **) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   void *vptr5 ;
   float *buffer5 ;
   PyObject * obj0 = 0 ;
@@ -7113,6 +7860,7 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_2(PyObject *SWIGUNUSEDP
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvKNearest_find_nearest",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7120,21 +7868,17 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_2(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_find_nearest" "', argument " "1"" of type '" "CvKNearest const *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_find_nearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvKNearest_find_nearest" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_find_nearest" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     if ((SWIG_ConvertPtr(obj4, &vptr5, SWIGTYPE_p_float, 1)) == -1){
       SWIG_fail;
@@ -7152,8 +7896,32 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_2(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -7164,19 +7932,17 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_3(PyObject *SWIGUNUSEDP
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvKNearest_find_nearest",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7184,21 +7950,17 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_3(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_find_nearest" "', argument " "1"" of type '" "CvKNearest const *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_find_nearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvKNearest_find_nearest" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvKNearest_find_nearest" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (float)((CvKNearest const *)arg1)->find_nearest((CvMat const *)arg2,arg3,arg4); 
@@ -7209,8 +7971,32 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_3(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -7220,16 +8006,15 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_4(PyObject *SWIGUNUSEDP
   CvKNearest *arg1 = (CvKNearest *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvKNearest_find_nearest",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7237,11 +8022,9 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_4(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvKNearest_find_nearest" "', argument " "1"" of type '" "CvKNearest const *""'"); 
   }
   arg1 = reinterpret_cast< CvKNearest * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvKNearest_find_nearest" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvKNearest_find_nearest" "', argument " "3"" of type '" "int""'");
@@ -7257,8 +8040,20 @@ SWIGINTERN PyObject *_wrap_CvKNearest_find_nearest__SWIG_4(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -7468,10 +8263,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvKNearest_get_max_k(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvKNearest *arg1 = (CvKNearest *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvKNearest_get_max_k",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7498,10 +8293,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvKNearest_get_var_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvKNearest *arg1 = (CvKNearest *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvKNearest_get_var_count",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7528,10 +8323,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvKNearest_get_sample_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvKNearest *arg1 = (CvKNearest *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvKNearest_get_sample_count",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7558,10 +8353,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvKNearest_is_regression(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvKNearest *arg1 = (CvKNearest *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvKNearest_is_regression",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvKNearest, 0 |  0 );
@@ -7625,7 +8420,6 @@ SWIGINTERN PyObject *_wrap_new_CvSVMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   double arg8 ;
   CvMat *arg9 = (CvMat *) 0 ;
   CvTermCriteria arg10 ;
-  CvSVMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -7642,10 +8436,8 @@ SWIGINTERN PyObject *_wrap_new_CvSVMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   int ecode7 = 0 ;
   double val8 ;
   int ecode8 = 0 ;
-  void *argp9 = 0 ;
-  int res9 = 0 ;
-  void *argp10 ;
-  int res10 = 0 ;
+  bool freearg9 = false ;
+  CvTermCriteria temp10 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -7656,6 +8448,7 @@ SWIGINTERN PyObject *_wrap_new_CvSVMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
   PyObject * obj9 = 0 ;
+  CvSVMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:new_CvSVMParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -7698,22 +8491,28 @@ SWIGINTERN PyObject *_wrap_new_CvSVMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self
     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_CvSVMParams" "', argument " "8"" of type '" "double""'");
   } 
   arg8 = static_cast< double >(val8);
-  res9 = SWIG_ConvertPtr(obj8, &argp9,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res9)) {
-    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "new_CvSVMParams" "', argument " "9"" of type '" "CvMat *""'"); 
+  {
+    arg9 = (CvMat*)PyObject_to_CvArr(obj8, &freearg9);
   }
-  arg9 = reinterpret_cast< CvMat * >(argp9);
   {
-    res10 = SWIG_ConvertPtr(obj9, &argp10, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res10)) {
-      SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "new_CvSVMParams" "', argument " "10"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp10) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvSVMParams" "', argument " "10"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp10);
-      arg10 = *temp;
-      if (SWIG_IsNewObj(res10)) delete temp;
+    if (PyTuple_Check(obj9)) 
+    {
+      if (!PyArg_ParseTuple(obj9,"iid", & temp10.type, & temp10.max_iter, & temp10.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg10 = temp10;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj9, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg10 = *ptr;
     }
   }
   {
@@ -7726,8 +8525,20 @@ SWIGINTERN PyObject *_wrap_new_CvSVMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSVMParams, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg9!=NULL && freearg9){
+      cvReleaseData( arg9 );
+      cvFree(&(arg9));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg9!=NULL && freearg9){
+      cvReleaseData( arg9 );
+      cvFree(&(arg9));
+    }
+  }
   return NULL;
 }
 
@@ -7839,7 +8650,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_svm_type_set(PyObject *SWIGUNUSEDPARM(sel
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->svm_type = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -7850,10 +8660,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_svm_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_svm_type_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -7892,7 +8702,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_kernel_type_set(PyObject *SWIGUNUSEDPARM(
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->kernel_type = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -7903,10 +8712,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_kernel_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_kernel_type_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -7945,7 +8754,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_degree_set(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->degree = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -7956,10 +8764,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_degree_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_degree_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -7998,7 +8806,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_gamma_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->gamma = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8009,10 +8816,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_gamma_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_gamma_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8051,7 +8858,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_coef0_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->coef0 = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8062,10 +8868,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_coef0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_coef0_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8104,7 +8910,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_C_set(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->C = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8115,10 +8920,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_C_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_C_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8157,7 +8962,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_nu_set(PyObject *SWIGUNUSEDPARM(self), Py
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->nu = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8168,10 +8972,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_nu_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_nu_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8210,7 +9014,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_p_set(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->p = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8221,10 +9024,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_p_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_p_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8246,8 +9049,7 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_class_weights_set(PyObject *SWIGUNUSEDPAR
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
@@ -8257,16 +9059,25 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_class_weights_set(PyObject *SWIGUNUSEDPAR
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVMParams_class_weights_set" "', argument " "1"" of type '" "CvSVMParams *""'"); 
   }
   arg1 = reinterpret_cast< CvSVMParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVMParams_class_weights_set" "', argument " "2"" of type '" "CvMat *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   if (arg1) (arg1)->class_weights = arg2;
-  
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -8274,10 +9085,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_class_weights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_class_weights_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8316,7 +9127,6 @@ SWIGINTERN PyObject *_wrap_CvSVMParams_term_crit_set(PyObject *SWIGUNUSEDPARM(se
   }
   arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
   if (arg1) (arg1)->term_crit = *arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8327,10 +9137,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
-  CvTermCriteria *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvTermCriteria *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMParams_term_crit_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8361,7 +9171,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMParams(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvSVMParams * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -8407,11 +9217,11 @@ SWIGINTERN PyObject *_wrap_new_CvSVMKernel__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   PyObject *resultobj = 0;
   CvSVMParams *arg1 = (CvSVMParams *) 0 ;
   CvSVMKernel::Calc arg2 ;
-  CvSVMKernel *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvSVMKernel *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_CvSVMKernel",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMParams, 0 |  0 );
@@ -8483,7 +9293,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernel_create(PyObject *SWIGUNUSEDPARM(self), Py
   CvSVMKernel *arg1 = (CvSVMKernel *) 0 ;
   CvSVMParams *arg2 = (CvSVMParams *) 0 ;
   CvSVMKernel::Calc arg3 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -8491,6 +9300,7 @@ SWIGINTERN PyObject *_wrap_CvSVMKernel_create(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVMKernel_create",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernel, 0 |  0 );
@@ -8540,7 +9350,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMKernel(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvSVMKernel * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -8682,7 +9492,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernel_params_set(PyObject *SWIGUNUSEDPARM(self)
   }
   arg2 = reinterpret_cast< CvSVMParams * >(argp2);
   if (arg1) (arg1)->params = (CvSVMParams const *)arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8693,10 +9502,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMKernel_params_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMKernel *arg1 = (CvSVMKernel *) 0 ;
-  CvSVMParams *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMKernel_params_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernel, 0 |  0 );
@@ -8734,7 +9543,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernel_calc_func_set(PyObject *SWIGUNUSEDPARM(se
     }
   }
   if (arg1) (arg1)->calc_func = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8745,10 +9553,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMKernel_calc_func_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMKernel *arg1 = (CvSVMKernel *) 0 ;
-  CvSVMKernel::Calc result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernel::Calc result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMKernel_calc_func_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernel, 0 |  0 );
@@ -9192,7 +10000,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernelRow_prev_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< CvSVMKernelRow * >(argp2);
   if (arg1) (arg1)->prev = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9203,10 +10010,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMKernelRow_prev_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMKernelRow *arg1 = (CvSVMKernelRow *) 0 ;
-  CvSVMKernelRow *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernelRow *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMKernelRow_prev_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernelRow, 0 |  0 );
@@ -9245,7 +10052,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernelRow_next_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< CvSVMKernelRow * >(argp2);
   if (arg1) (arg1)->next = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9256,10 +10062,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMKernelRow_next_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMKernelRow *arg1 = (CvSVMKernelRow *) 0 ;
-  CvSVMKernelRow *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernelRow *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMKernelRow_next_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernelRow, 0 |  0 );
@@ -9298,7 +10104,6 @@ SWIGINTERN PyObject *_wrap_CvSVMKernelRow_data_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< float * >(argp2);
   if (arg1) (arg1)->data = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9309,10 +10114,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMKernelRow_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMKernelRow *arg1 = (CvSVMKernelRow *) 0 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMKernelRow_data_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMKernelRow, 0 |  0 );
@@ -9364,7 +10169,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMKernelRow(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< CvSVMKernelRow * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -9408,7 +10213,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_obj_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->obj = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9419,10 +10223,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolutionInfo *arg1 = (CvSVMSolutionInfo *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolutionInfo_obj_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolutionInfo, 0 |  0 );
@@ -9461,7 +10265,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_rho_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->rho = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9472,10 +10275,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_rho_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolutionInfo *arg1 = (CvSVMSolutionInfo *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolutionInfo_rho_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolutionInfo, 0 |  0 );
@@ -9514,7 +10317,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_upper_bound_p_set(PyObject *SWIGUNU
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->upper_bound_p = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9525,10 +10327,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_upper_bound_p_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolutionInfo *arg1 = (CvSVMSolutionInfo *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolutionInfo_upper_bound_p_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolutionInfo, 0 |  0 );
@@ -9567,7 +10369,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_upper_bound_n_set(PyObject *SWIGUNU
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->upper_bound_n = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9578,10 +10379,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_upper_bound_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolutionInfo *arg1 = (CvSVMSolutionInfo *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolutionInfo_upper_bound_n_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolutionInfo, 0 |  0 );
@@ -9620,7 +10421,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_r_set(PyObject *SWIGUNUSEDPARM(self
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->r = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9631,10 +10431,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolutionInfo_r_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolutionInfo *arg1 = (CvSVMSolutionInfo *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolutionInfo_r_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolutionInfo, 0 |  0 );
@@ -9686,7 +10486,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMSolutionInfo(PyObject *SWIGUNUSEDPARM(sel
   arg1 = reinterpret_cast< CvSVMSolutionInfo * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -9743,7 +10543,6 @@ SWIGINTERN PyObject *_wrap_new_CvSVMSolver__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   CvSVMSolver::GetRow arg11 ;
   CvSVMSolver::SelectWorkingSet arg12 ;
   CvSVMSolver::CalcRho arg13 ;
-  CvSVMSolver *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -9777,6 +10576,7 @@ SWIGINTERN PyObject *_wrap_new_CvSVMSolver__SWIG_1(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj10 = 0 ;
   PyObject * obj11 = 0 ;
   PyObject * obj12 = 0 ;
+  CvSVMSolver *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:new_CvSVMSolver",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -9978,7 +10778,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_create(PyObject *SWIGUNUSEDPARM(self), Py
   CvSVMSolver::GetRow arg12 ;
   CvSVMSolver::SelectWorkingSet arg13 ;
   CvSVMSolver::CalcRho arg14 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10015,6 +10814,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_create(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject * obj11 = 0 ;
   PyObject * obj12 = 0 ;
   PyObject * obj13 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOO:CvSVMSolver_create",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10123,7 +10923,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMSolver(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvSVMSolver * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -10170,13 +10970,13 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_generic(PyObject *SWIGUNUSEDPARM(se
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
   CvSVMSolutionInfo *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvSVMSolver_solve_generic",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10221,7 +11021,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_c_svc(PyObject *SWIGUNUSEDPARM(self
   CvSVMKernel *arg9 = (CvSVMKernel *) 0 ;
   double *arg10 = (double *) 0 ;
   CvSVMSolutionInfo *arg11 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10255,6 +11054,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_c_svc(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj8 = 0 ;
   PyObject * obj9 = 0 ;
   PyObject * obj10 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:CvSVMSolver_solve_c_svc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10344,7 +11144,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_nu_svc(PyObject *SWIGUNUSEDPARM(sel
   CvSVMKernel *arg7 = (CvSVMKernel *) 0 ;
   double *arg8 = (double *) 0 ;
   CvSVMSolutionInfo *arg9 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10372,6 +11171,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_nu_svc(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvSVMSolver_solve_nu_svc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10450,7 +11250,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_one_class(PyObject *SWIGUNUSEDPARM(
   CvSVMKernel *arg6 = (CvSVMKernel *) 0 ;
   double *arg7 = (double *) 0 ;
   CvSVMSolutionInfo *arg8 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10475,6 +11274,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_one_class(PyObject *SWIGUNUSEDPARM(
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvSVMSolver_solve_one_class",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10549,7 +11349,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_eps_svr(PyObject *SWIGUNUSEDPARM(se
   CvSVMKernel *arg7 = (CvSVMKernel *) 0 ;
   double *arg8 = (double *) 0 ;
   CvSVMSolutionInfo *arg9 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10577,6 +11376,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_eps_svr(PyObject *SWIGUNUSEDPARM(se
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvSVMSolver_solve_eps_svr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10656,7 +11456,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_nu_svr(PyObject *SWIGUNUSEDPARM(sel
   CvSVMKernel *arg7 = (CvSVMKernel *) 0 ;
   double *arg8 = (double *) 0 ;
   CvSVMSolutionInfo *arg9 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10684,6 +11483,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_solve_nu_svr(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvSVMSolver_solve_nu_svr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10757,7 +11557,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_base(PyObject *SWIGUNUSEDPARM(sel
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
   int arg2 ;
   bool *arg3 = (bool *) 0 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10767,6 +11566,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_base(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVMSolver_get_row_base",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10805,7 +11605,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row(PyObject *SWIGUNUSEDPARM(self), P
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
   int arg2 ;
   float *arg3 = (float *) 0 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -10815,6 +11614,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row(PyObject *SWIGUNUSEDPARM(self), P
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVMSolver_get_row",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10871,7 +11671,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_sample_count_set(PyObject *SWIGUNUSEDPARM
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->sample_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -10882,10 +11681,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_sample_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_sample_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10924,7 +11723,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_var_count_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->var_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -10935,10 +11733,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_var_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -10977,7 +11775,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_cache_size_set(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->cache_size = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -10988,10 +11785,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_cache_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_cache_size_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11030,7 +11827,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_cache_line_size_set(PyObject *SWIGUNUSEDP
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->cache_line_size = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11041,10 +11837,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_cache_line_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_cache_line_size_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11085,7 +11881,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_samples_set(PyObject *SWIGUNUSEDPARM(self
     arg2=&buffer2;
   }
   if (arg1) (arg1)->samples = (float const **)arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11096,10 +11891,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_samples_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  float **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_samples_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11138,7 +11933,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_params_set(PyObject *SWIGUNUSEDPARM(self)
   }
   arg2 = reinterpret_cast< CvSVMParams * >(argp2);
   if (arg1) (arg1)->params = (CvSVMParams const *)arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11149,10 +11943,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_params_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMParams *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_params_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11191,7 +11985,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_storage_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< CvMemStorage * >(argp2);
   if (arg1) (arg1)->storage = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11202,10 +11995,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvMemStorage *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMemStorage *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_storage_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11244,7 +12037,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_lru_list_set(PyObject *SWIGUNUSEDPARM(sel
   }
   arg2 = reinterpret_cast< CvSVMKernelRow * >(argp2);
   if (arg1) (arg1)->lru_list = *arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11255,10 +12047,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_lru_list_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMKernelRow *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernelRow *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_lru_list_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11297,7 +12089,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_rows_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< CvSVMKernelRow * >(argp2);
   if (arg1) (arg1)->rows = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11308,10 +12099,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_rows_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMKernelRow *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernelRow *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_rows_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11350,7 +12141,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_count_set(PyObject *SWIGUNUSEDPARM(
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->alpha_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11361,10 +12151,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_alpha_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11403,7 +12193,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_G_set(PyObject *SWIGUNUSEDPARM(self), PyO
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->G = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11414,10 +12203,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_G_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_G_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11456,7 +12245,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->alpha = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11467,10 +12255,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_alpha_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11509,7 +12297,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_status_set(PyObject *SWIGUNUSEDPARM
   }
   arg2 = reinterpret_cast< schar * >(argp2);
   if (arg1) (arg1)->alpha_status = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11520,10 +12307,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_alpha_status_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  schar *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  schar *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_alpha_status_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11562,7 +12349,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_y_set(PyObject *SWIGUNUSEDPARM(self), PyO
   }
   arg2 = reinterpret_cast< schar * >(argp2);
   if (arg1) (arg1)->y = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11573,10 +12359,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_y_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  schar *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  schar *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_y_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11615,7 +12401,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_b_set(PyObject *SWIGUNUSEDPARM(self), PyO
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->b = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11626,10 +12411,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_b_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_b_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11685,10 +12470,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  float **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11727,7 +12512,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_eps_set(PyObject *SWIGUNUSEDPARM(self), P
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->eps = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11738,10 +12522,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_eps_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_eps_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11780,7 +12564,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_max_iter_set(PyObject *SWIGUNUSEDPARM(sel
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->max_iter = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11791,10 +12574,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_max_iter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_max_iter_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11850,10 +12633,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_C_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_C_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11892,7 +12675,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_kernel_set(PyObject *SWIGUNUSEDPARM(self)
   }
   arg2 = reinterpret_cast< CvSVMKernel * >(argp2);
   if (arg1) (arg1)->kernel = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11903,10 +12685,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_kernel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMKernel *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMKernel *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_kernel_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11944,7 +12726,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set_func_set(PyObject *SWI
     }
   }
   if (arg1) (arg1)->select_working_set_func = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -11955,10 +12736,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set_func_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMSolver::SelectWorkingSet result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMSolver::SelectWorkingSet result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_select_working_set_func_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -11996,7 +12777,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_calc_rho_func_set(PyObject *SWIGUNUSEDPAR
     }
   }
   if (arg1) (arg1)->calc_rho_func = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12007,10 +12787,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_calc_rho_func_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMSolver::CalcRho result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMSolver::CalcRho result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_calc_rho_func_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12048,7 +12828,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_func_set(PyObject *SWIGUNUSEDPARM
     }
   }
   if (arg1) (arg1)->get_row_func = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12059,10 +12838,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_func_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
-  CvSVMSolver::GetRow result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMSolver::GetRow result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMSolver_get_row_func_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12083,7 +12862,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set(PyObject *SWIGUNUSEDPA
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
   int *arg2 = 0 ;
   int *arg3 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -12093,6 +12871,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set(PyObject *SWIGUNUSEDPA
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVMSolver_select_working_set",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12137,7 +12916,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set_nu_svm(PyObject *SWIGU
   CvSVMSolver *arg1 = (CvSVMSolver *) 0 ;
   int *arg2 = 0 ;
   int *arg3 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -12147,6 +12925,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_select_working_set_nu_svm(PyObject *SWIGU
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVMSolver_select_working_set_nu_svm",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12299,7 +13078,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_svc(PyObject *SWIGUNUSEDPARM(self
   float *arg3 = (float *) 0 ;
   float *arg4 = (float *) 0 ;
   bool arg5 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -12315,6 +13093,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_svc(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvSVMSolver_get_row_svc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12365,7 +13144,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_one_class(PyObject *SWIGUNUSEDPAR
   float *arg3 = (float *) 0 ;
   float *arg4 = (float *) 0 ;
   bool arg5 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -12381,6 +13159,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_one_class(PyObject *SWIGUNUSEDPAR
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvSVMSolver_get_row_one_class",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12431,7 +13210,6 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_svr(PyObject *SWIGUNUSEDPARM(self
   float *arg3 = (float *) 0 ;
   float *arg4 = (float *) 0 ;
   bool arg5 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -12447,6 +13225,7 @@ SWIGINTERN PyObject *_wrap_CvSVMSolver_get_row_svr(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvSVMSolver_get_row_svr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMSolver, 0 |  0 );
@@ -12520,7 +13299,6 @@ SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_rho_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->rho = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12531,10 +13309,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_rho_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMDecisionFunc *arg1 = (CvSVMDecisionFunc *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMDecisionFunc_rho_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMDecisionFunc, 0 |  0 );
@@ -12573,7 +13351,6 @@ SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_sv_count_set(PyObject *SWIGUNUSEDPA
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->sv_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12584,10 +13361,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_sv_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMDecisionFunc *arg1 = (CvSVMDecisionFunc *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMDecisionFunc_sv_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMDecisionFunc, 0 |  0 );
@@ -12626,7 +13403,6 @@ SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_alpha_set(PyObject *SWIGUNUSEDPARM(
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->alpha = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12637,10 +13413,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_alpha_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMDecisionFunc *arg1 = (CvSVMDecisionFunc *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMDecisionFunc_alpha_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMDecisionFunc, 0 |  0 );
@@ -12679,7 +13455,6 @@ SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_sv_index_set(PyObject *SWIGUNUSEDPA
   }
   arg2 = reinterpret_cast< int * >(argp2);
   if (arg1) (arg1)->sv_index = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -12690,10 +13465,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVMDecisionFunc_sv_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVMDecisionFunc *arg1 = (CvSVMDecisionFunc *) 0 ;
-  int *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVMDecisionFunc_sv_index_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVMDecisionFunc, 0 |  0 );
@@ -12745,7 +13520,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVMDecisionFunc(PyObject *SWIGUNUSEDPARM(sel
   arg1 = reinterpret_cast< CvSVMDecisionFunc * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -12802,7 +13577,7 @@ SWIGINTERN PyObject *_wrap_delete_CvSVM(PyObject *SWIGUNUSEDPARM(self), PyObject
   arg1 = reinterpret_cast< CvSVM * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -12823,15 +13598,10 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyO
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvSVMParams arg5 ;
-  CvSVM *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   void *argp5 ;
   int res5 = 0 ;
   PyObject * obj0 = 0 ;
@@ -12839,28 +13609,21 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  CvSVM *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvSVM",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvSVM" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvSVM" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvSVM" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvSVM" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res5)) {
@@ -12884,8 +13647,56 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyO
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSVM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -12896,41 +13707,29 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyO
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  CvSVM *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  CvSVM *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvSVM",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvSVM" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvSVM" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvSVM" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvSVM" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (CvSVM *)new CvSVM((CvMat const *)arg1,(CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -12941,8 +13740,56 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyO
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSVM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -12952,33 +13799,24 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyO
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  CvSVM *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvSVM *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvSVM",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvSVM" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvSVM" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvSVM" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (CvSVM *)new CvSVM((CvMat const *)arg1,(CvMat const *)arg2,(CvMat const *)arg3); 
@@ -12989,8 +13827,44 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyO
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSVM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -12999,25 +13873,19 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   CvMat *arg1 = (CvMat *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  CvSVM *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvSVM *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_CvSVM",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvSVM" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_CvSVM" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (CvSVM *)new CvSVM((CvMat const *)arg1,(CvMat const *)arg2); 
@@ -13028,8 +13896,32 @@ SWIGINTERN PyObject *_wrap_new_CvSVM__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyO
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSVM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -13153,17 +14045,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), P
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvSVMParams arg6 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   PyObject * obj0 = 0 ;
@@ -13172,6 +14059,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), P
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvSVM_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13179,26 +14067,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), P
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -13222,8 +14102,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), P
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -13235,22 +14163,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), P
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvSVM_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13258,26 +14182,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), P
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -13288,8 +14204,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), P
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -13300,19 +14264,16 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), P
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvSVM_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13320,21 +14281,15 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), P
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -13345,8 +14300,44 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), P
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -13356,16 +14347,14 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), P
   CvSVM *arg1 = (CvSVM *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVM_train",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13373,16 +14362,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), P
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3); 
@@ -13393,8 +14378,32 @@ SWIGINTERN PyObject *_wrap_CvSVM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), P
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -13541,17 +14550,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   CvParamGrid arg11 ;
   CvParamGrid arg12 ;
   CvParamGrid arg13 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -13581,6 +14585,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj10 = 0 ;
   PyObject * obj11 = 0 ;
   PyObject * obj12 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13588,26 +14593,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -13714,8 +14711,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -13734,17 +14779,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   CvParamGrid arg10 ;
   CvParamGrid arg11 ;
   CvParamGrid arg12 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -13771,6 +14811,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj9 = 0 ;
   PyObject * obj10 = 0 ;
   PyObject * obj11 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13778,26 +14819,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -13891,8 +14924,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_1(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -13910,17 +14991,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
   CvParamGrid arg9 ;
   CvParamGrid arg10 ;
   CvParamGrid arg11 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -13944,6 +15020,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj8 = 0 ;
   PyObject * obj9 = 0 ;
   PyObject * obj10 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -13951,26 +15028,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14051,8 +15120,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_2(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -14069,17 +15186,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
   CvParamGrid arg8 ;
   CvParamGrid arg9 ;
   CvParamGrid arg10 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -14100,6 +15212,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
   PyObject * obj9 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -14107,26 +15220,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14194,8 +15299,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_3(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -14211,17 +15364,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
   int arg7 ;
   CvParamGrid arg8 ;
   CvParamGrid arg9 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -14239,6 +15387,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -14246,26 +15395,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14320,8 +15461,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_4(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -14336,17 +15525,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_5(PyObject *SWIGUNUSEDPARM(sel
   CvSVMParams arg6 ;
   int arg7 ;
   CvParamGrid arg8 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -14361,6 +15545,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_5(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -14368,26 +15553,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_5(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14429,8 +15606,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_5(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -14444,17 +15669,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_6(PyObject *SWIGUNUSEDPARM(sel
   CvMat *arg5 = (CvMat *) 0 ;
   CvSVMParams arg6 ;
   int arg7 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   int val7 ;
@@ -14466,6 +15686,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_6(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -14473,26 +15694,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_6(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14521,8 +15734,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_6(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -14535,17 +15796,12 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_7(PyObject *SWIGUNUSEDPARM(sel
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvSVMParams arg6 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   void *argp6 ;
   int res6 = 0 ;
   PyObject * obj0 = 0 ;
@@ -14554,6 +15810,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_7(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvSVM_train_auto",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -14561,26 +15818,18 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_7(PyObject *SWIGUNUSEDPARM(sel
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_train_auto" "', argument " "1"" of type '" "CvSVM *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_train_auto" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvSVM_train_auto" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvSVM_train_auto" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvSVM_train_auto" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvSVMParams,  0  | 0);
     if (!SWIG_IsOK(res6)) {
@@ -14604,8 +15853,56 @@ SWIGINTERN PyObject *_wrap_CvSVM_train_auto__SWIG_7(PyObject *SWIGUNUSEDPARM(sel
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -15026,17 +16323,73 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvSVM_predict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvSVM_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVM *arg1 = (CvSVM *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
+  bool arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
   float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVM_predict",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_predict" "', argument " "1"" of type '" "CvSVM const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvSVM * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_bool(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvSVM_predict" "', argument " "3"" of type '" "bool""'");
+  } 
+  arg3 = static_cast< bool >(val3);
+  {
+    try {
+      result = (float)((CvSVM const *)arg1)->predict((CvMat const *)arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvSVM_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvSVM *arg1 = (CvSVM *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvSVM_predict",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -15044,11 +16397,9 @@ SWIGINTERN PyObject *_wrap_CvSVM_predict(PyObject *SWIGUNUSEDPARM(self), PyObjec
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_predict" "', argument " "1"" of type '" "CvSVM const *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSVM_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (float)((CvSVM const *)arg1)->predict((CvMat const *)arg2); 
@@ -15059,8 +16410,74 @@ SWIGINTERN PyObject *_wrap_CvSVM_predict(PyObject *SWIGUNUSEDPARM(self), PyObjec
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvSVM_predict(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvSVM, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvSVM_predict__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvSVM, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_bool(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_CvSVM_predict__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvSVM_predict'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    predict(CvSVM const *,CvMat const *,bool)\n"
+    "    predict(CvSVM const *,CvMat const *)\n");
   return NULL;
 }
 
@@ -15068,10 +16485,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVM_get_support_vector_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVM *arg1 = (CvSVM *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVM_get_support_vector_count",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -15099,13 +16516,13 @@ SWIGINTERN PyObject *_wrap_CvSVM_get_support_vector(PyObject *SWIGUNUSEDPARM(sel
   PyObject *resultobj = 0;
   CvSVM *arg1 = (CvSVM *) 0 ;
   int arg2 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvSVM_get_support_vector",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -15137,10 +16554,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVM_get_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVM *arg1 = (CvSVM *) 0 ;
-  CvSVMParams result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSVMParams result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVM_get_params",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -15196,10 +16613,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVM_get_default_grid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   int arg1 ;
-  CvParamGrid result;
   int val1 ;
   int ecode1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvParamGrid result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVM_get_default_grid",&obj0)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15242,7 +16659,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_write(PyObject *SWIGUNUSEDPARM(self), PyObject
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvSVM_write",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_write" "', argument " "1"" of type '" "CvSVM *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSVM_write" "', argument " "1"" of type '" "CvSVM const *""'"); 
   }
   arg1 = reinterpret_cast< CvSVM * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
@@ -15257,7 +16674,7 @@ SWIGINTERN PyObject *_wrap_CvSVM_write(PyObject *SWIGUNUSEDPARM(self), PyObject
   arg3 = reinterpret_cast< char * >(buf3);
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      ((CvSVM const *)arg1)->write(arg2,(char const *)arg3); 
     } 
     catch (...) 
     {
@@ -15323,10 +16740,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvSVM_get_var_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvSVM *arg1 = (CvSVM *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvSVM_get_var_count",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSVM, 0 |  0 );
@@ -15388,21 +16805,16 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
   CvMat **arg8 = (CvMat **) 0 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  CvTermCriteria temp4 ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   void *argp8 = 0 ;
   int res8 = 0 ;
   PyObject * obj0 = 0 ;
@@ -15413,6 +16825,7 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:new_CvEMParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15431,33 +16844,35 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg3 = static_cast< int >(val3);
   {
-    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp4) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp4);
-      arg4 = *temp;
-      if (SWIG_IsNewObj(res4)) delete temp;
+    if (PyTuple_Check(obj3)) 
+    {
+      if (!PyArg_ParseTuple(obj3,"iid", & temp4.type, & temp4.max_iter, & temp4.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg4 = temp4;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg4 = *ptr;
     }
   }
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvEMParams" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvEMParams" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvEMParams" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_p_CvMat, 0 |  0 );
   if (!SWIG_IsOK(res8)) {
     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvEMParams" "', argument " "8"" of type '" "CvMat const **""'"); 
@@ -15473,8 +16888,44 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEMParams, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -15488,21 +16939,16 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  CvTermCriteria temp4 ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -15510,6 +16956,7 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_CvEMParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15528,33 +16975,35 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg3 = static_cast< int >(val3);
   {
-    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp4) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp4);
-      arg4 = *temp;
-      if (SWIG_IsNewObj(res4)) delete temp;
+    if (PyTuple_Check(obj3)) 
+    {
+      if (!PyArg_ParseTuple(obj3,"iid", & temp4.type, & temp4.max_iter, & temp4.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg4 = temp4;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg4 = *ptr;
     }
   }
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvEMParams" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvEMParams" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvEMParams" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
       result = (CvEMParams *)new CvEMParams(arg1,arg2,arg3,arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
@@ -15565,8 +17014,44 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEMParams, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -15579,25 +17064,22 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
   CvTermCriteria arg4 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  CvTermCriteria temp4 ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvEMParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15616,28 +17098,32 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg3 = static_cast< int >(val3);
   {
-    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp4) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp4);
-      arg4 = *temp;
-      if (SWIG_IsNewObj(res4)) delete temp;
+    if (PyTuple_Check(obj3)) 
+    {
+      if (!PyArg_ParseTuple(obj3,"iid", & temp4.type, & temp4.max_iter, & temp4.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg4 = temp4;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg4 = *ptr;
     }
   }
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvEMParams" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvEMParams" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
       result = (CvEMParams *)new CvEMParams(arg1,arg2,arg3,arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
@@ -15648,8 +17134,32 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEMParams, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
@@ -15661,22 +17171,20 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
   int arg3 ;
   CvTermCriteria arg4 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  CvTermCriteria temp4 ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvEMParams",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15695,23 +17203,29 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg3 = static_cast< int >(val3);
   {
-    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp4) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp4);
-      arg4 = *temp;
-      if (SWIG_IsNewObj(res4)) delete temp;
+    if (PyTuple_Check(obj3)) 
+    {
+      if (!PyArg_ParseTuple(obj3,"iid", & temp4.type, & temp4.max_iter, & temp4.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg4 = temp4;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg4 = *ptr;
     }
   }
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvEMParams" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (CvEMParams *)new CvEMParams(arg1,arg2,arg3,arg4,(CvMat const *)arg5); 
@@ -15722,8 +17236,20 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEMParams, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -15734,19 +17260,18 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_5(PyObject *SWIGUNUSEDPARM(self)
   int arg2 ;
   int arg3 ;
   CvTermCriteria arg4 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 ;
-  int res4 = 0 ;
+  CvTermCriteria temp4 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvEMParams",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15765,16 +17290,24 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_5(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg3 = static_cast< int >(val3);
   {
-    res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp4) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEMParams" "', argument " "4"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp4);
-      arg4 = *temp;
-      if (SWIG_IsNewObj(res4)) delete temp;
+    if (PyTuple_Check(obj3)) 
+    {
+      if (!PyArg_ParseTuple(obj3,"iid", & temp4.type, & temp4.max_iter, & temp4.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg4 = temp4;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg4 = *ptr;
     }
   }
   {
@@ -15798,7 +17331,6 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_6(PyObject *SWIGUNUSEDPARM(self)
   int arg1 ;
   int arg2 ;
   int arg3 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -15808,6 +17340,7 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_6(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvEMParams",&obj0,&obj1,&obj2)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15845,13 +17378,13 @@ SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_7(PyObject *SWIGUNUSEDPARM(self)
   PyObject *resultobj = 0;
   int arg1 ;
   int arg2 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_CvEMParams",&obj0,&obj1)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -15883,10 +17416,10 @@ fail:
 SWIGINTERN PyObject *_wrap_new_CvEMParams__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   int arg1 ;
-  CvEMParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvEMParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_CvEMParams",&obj0)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -16191,7 +17724,6 @@ SWIGINTERN PyObject *_wrap_CvEMParams_nclusters_set(PyObject *SWIGUNUSEDPARM(sel
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->nclusters = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -16202,10 +17734,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_nclusters_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_nclusters_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16244,7 +17776,6 @@ SWIGINTERN PyObject *_wrap_CvEMParams_cov_mat_type_set(PyObject *SWIGUNUSEDPARM(
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->cov_mat_type = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -16255,10 +17786,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_cov_mat_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_cov_mat_type_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16297,7 +17828,6 @@ SWIGINTERN PyObject *_wrap_CvEMParams_start_step_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->start_step = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -16308,10 +17838,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_start_step_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_start_step_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16333,8 +17863,7 @@ SWIGINTERN PyObject *_wrap_CvEMParams_probs_set(PyObject *SWIGUNUSEDPARM(self),
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
@@ -16344,16 +17873,25 @@ SWIGINTERN PyObject *_wrap_CvEMParams_probs_set(PyObject *SWIGUNUSEDPARM(self),
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEMParams_probs_set" "', argument " "1"" of type '" "CvEMParams *""'"); 
   }
   arg1 = reinterpret_cast< CvEMParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEMParams_probs_set" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   if (arg1) (arg1)->probs = (CvMat const *)arg2;
-  
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -16361,10 +17899,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_probs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_probs_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16386,8 +17924,7 @@ SWIGINTERN PyObject *_wrap_CvEMParams_weights_set(PyObject *SWIGUNUSEDPARM(self)
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
@@ -16397,16 +17934,25 @@ SWIGINTERN PyObject *_wrap_CvEMParams_weights_set(PyObject *SWIGUNUSEDPARM(self)
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEMParams_weights_set" "', argument " "1"" of type '" "CvEMParams *""'"); 
   }
   arg1 = reinterpret_cast< CvEMParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEMParams_weights_set" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   if (arg1) (arg1)->weights = (CvMat const *)arg2;
-  
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -16414,10 +17960,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_weights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_weights_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16439,8 +17985,7 @@ SWIGINTERN PyObject *_wrap_CvEMParams_means_set(PyObject *SWIGUNUSEDPARM(self),
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
@@ -16450,16 +17995,25 @@ SWIGINTERN PyObject *_wrap_CvEMParams_means_set(PyObject *SWIGUNUSEDPARM(self),
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEMParams_means_set" "', argument " "1"" of type '" "CvEMParams *""'"); 
   }
   arg1 = reinterpret_cast< CvEMParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEMParams_means_set" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   if (arg1) (arg1)->means = (CvMat const *)arg2;
-  
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -16467,10 +18021,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_means_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_means_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16509,7 +18063,6 @@ SWIGINTERN PyObject *_wrap_CvEMParams_covs_set(PyObject *SWIGUNUSEDPARM(self), P
   }
   arg2 = reinterpret_cast< CvMat ** >(argp2);
   if (arg1) (arg1)->covs = (CvMat const **)arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -16520,10 +18073,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_covs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  CvMat **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_covs_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16562,7 +18115,6 @@ SWIGINTERN PyObject *_wrap_CvEMParams_term_crit_set(PyObject *SWIGUNUSEDPARM(sel
   }
   arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
   if (arg1) (arg1)->term_crit = *arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -16573,10 +18125,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEMParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEMParams *arg1 = (CvEMParams *) 0 ;
-  CvTermCriteria *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvTermCriteria *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEMParams_term_crit_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEMParams, 0 |  0 );
@@ -16607,7 +18159,7 @@ SWIGINTERN PyObject *_wrap_delete_CvEMParams(PyObject *SWIGUNUSEDPARM(self), PyO
   arg1 = reinterpret_cast< CvEMParams * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -16628,7 +18180,7 @@ SWIGINTERN PyObject *CvEMParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyO
   return SWIG_Py_Void();
 }
 
-SWIGINTERN PyObject *_wrap_new_CvEM(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvEM__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *result = 0 ;
   
@@ -16649,6 +18201,358 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_new_CvEM__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvEMParams arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  void *argp3 ;
+  int res3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  CvEM *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvEM",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvEMParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvEM" "', argument " "3"" of type '" "CvEMParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEM" "', argument " "3"" of type '" "CvEMParams""'");
+    } else {
+      CvEMParams * temp = reinterpret_cast< CvEMParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (CvEM *)new CvEM((CvMat const *)arg1,(CvMat const *)arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvEM__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvEMParams arg3 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  CvEM *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvEM",&obj0,&obj1,&obj2)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvEMParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvEM" "', argument " "3"" of type '" "CvEMParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvEM" "', argument " "3"" of type '" "CvEMParams""'");
+    } else {
+      CvEMParams * temp = reinterpret_cast< CvEMParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (CvEM *)new CvEM((CvMat const *)arg1,(CvMat const *)arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvEM__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  CvEM *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_CvEM",&obj0,&obj1)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    try {
+      result = (CvEM *)new CvEM((CvMat const *)arg1,(CvMat const *)arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvEM__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  PyObject * obj0 = 0 ;
+  CvEM *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CvEM",&obj0)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  {
+    try {
+      result = (CvEM *)new CvEM((CvMat const *)arg1); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvEM, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvEM(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CvEM__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_CvEM__SWIG_4(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_CvEM__SWIG_3(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvEMParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_new_CvEM__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvEMParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_new_CvEM__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvEM'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CvEM()\n"
+    "    CvEM(CvMat const *,CvMat const *,CvEMParams,CvMat *)\n"
+    "    CvEM(CvMat const *,CvMat const *,CvEMParams)\n"
+    "    CvEM(CvMat const *,CvMat const *)\n"
+    "    CvEM(CvMat const *)\n");
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_delete_CvEM(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
@@ -16664,7 +18568,7 @@ SWIGINTERN PyObject *_wrap_delete_CvEM(PyObject *SWIGUNUSEDPARM(self), PyObject
   arg1 = reinterpret_cast< CvEM * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -16685,22 +18589,19 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py
   CvMat *arg3 = (CvMat *) 0 ;
   CvEMParams arg4 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   void *argp4 ;
   int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvEM_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -16708,16 +18609,12 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_train" "', argument " "1"" of type '" "CvEM *""'"); 
   }
   arg1 = reinterpret_cast< CvEM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvEM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvEMParams,  0  | 0);
     if (!SWIG_IsOK(res4)) {
@@ -16731,11 +18628,9 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py
       if (SWIG_IsNewObj(res4)) delete temp;
     }
   }
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvEM_train" "', argument " "5"" of type '" "CvMat *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5); 
@@ -16746,8 +18641,44 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -16758,19 +18689,17 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvEMParams arg4 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   void *argp4 ;
   int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvEM_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -16778,16 +18707,12 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_train" "', argument " "1"" of type '" "CvEM *""'"); 
   }
   arg1 = reinterpret_cast< CvEM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvEM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CvEMParams,  0  | 0);
     if (!SWIG_IsOK(res4)) {
@@ -16811,8 +18736,32 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -16822,16 +18771,14 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py
   CvEM *arg1 = (CvEM *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvEM_train",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -16839,16 +18786,12 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_train" "', argument " "1"" of type '" "CvEM *""'"); 
   }
   arg1 = reinterpret_cast< CvEM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvEM_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3); 
@@ -16859,8 +18802,32 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), Py
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -16869,13 +18836,12 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvEM_train",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -16883,11 +18849,9 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_train" "', argument " "1"" of type '" "CvEM *""'"); 
   }
   arg1 = reinterpret_cast< CvEM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEM_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2); 
@@ -16898,8 +18862,20 @@ SWIGINTERN PyObject *_wrap_CvEM_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), Py
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -17015,16 +18991,14 @@ SWIGINTERN PyObject *_wrap_CvEM_predict(PyObject *SWIGUNUSEDPARM(self), PyObject
   CvEM *arg1 = (CvEM *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvEM_predict",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17032,16 +19006,12 @@ SWIGINTERN PyObject *_wrap_CvEM_predict(PyObject *SWIGUNUSEDPARM(self), PyObject
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_predict" "', argument " "1"" of type '" "CvEM const *""'"); 
   }
   arg1 = reinterpret_cast< CvEM * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvEM_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvEM_predict" "', argument " "3"" of type '" "CvMat *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (float)((CvEM const *)arg1)->predict((CvMat const *)arg2,arg3); 
@@ -17052,8 +19022,32 @@ SWIGINTERN PyObject *_wrap_CvEM_predict(PyObject *SWIGUNUSEDPARM(self), PyObject
     } 
   }
   resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -17090,10 +19084,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEM_get_nclusters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_nclusters",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17120,10 +19114,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEM_get_means(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_means",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17150,10 +19144,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEM_get_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_weights",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17180,10 +19174,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvEM_get_probs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_probs",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17207,13 +19201,43 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CvEM_get_log_likelihood(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvEM *arg1 = (CvEM *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_log_likelihood",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvEM_get_log_likelihood" "', argument " "1"" of type '" "CvEM const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvEM * >(argp1);
+  {
+    try {
+      result = (double)((CvEM const *)arg1)->get_log_likelihood(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_CvEM_get_covs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvEM *arg1 = (CvEM *) 0 ;
-  PyObject *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvEM_get_covs",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvEM, 0 |  0 );
@@ -17244,30 +19268,29 @@ SWIGINTERN PyObject *CvEM_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject
   return SWIG_Py_Void();
 }
 
-SWIGINTERN PyObject *_wrap_CvPair32s32f_i_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvPair16u32s_u_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *arg1 = (CvPair32s32f *) 0 ;
-  int arg2 ;
+  CvPair16u32s *arg1 = (CvPair16u32s *) 0 ;
+  unsigned short *arg2 = (unsigned short *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvPair32s32f_i_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair32s32f, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvPair16u32s_u_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair16u32s, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair32s32f_i_set" "', argument " "1"" of type '" "CvPair32s32f *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair16u32s_u_set" "', argument " "1"" of type '" "CvPair16u32s *""'"); 
   }
-  arg1 = reinterpret_cast< CvPair32s32f * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvPair32s32f_i_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->i = arg2;
-  
+  arg1 = reinterpret_cast< CvPair16u32s * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_short, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvPair16u32s_u_set" "', argument " "2"" of type '" "unsigned short *""'"); 
+  }
+  arg2 = reinterpret_cast< unsigned short * >(argp2);
+  if (arg1) (arg1)->u = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17275,52 +19298,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvPair32s32f_i_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvPair16u32s_u_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *arg1 = (CvPair32s32f *) 0 ;
-  int result;
+  CvPair16u32s *arg1 = (CvPair16u32s *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  unsigned short *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvPair32s32f_i_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair32s32f, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvPair16u32s_u_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair16u32s, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair32s32f_i_get" "', argument " "1"" of type '" "CvPair32s32f *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair16u32s_u_get" "', argument " "1"" of type '" "CvPair16u32s *""'"); 
   }
-  arg1 = reinterpret_cast< CvPair32s32f * >(argp1);
-  result = (int) ((arg1)->i);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  arg1 = reinterpret_cast< CvPair16u32s * >(argp1);
+  result = (unsigned short *) ((arg1)->u);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_short, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvPair32s32f_val_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvPair16u32s_i_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *arg1 = (CvPair32s32f *) 0 ;
-  float arg2 ;
+  CvPair16u32s *arg1 = (CvPair16u32s *) 0 ;
+  int *arg2 = (int *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  float val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvPair32s32f_val_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair32s32f, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvPair16u32s_i_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair16u32s, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair32s32f_val_set" "', argument " "1"" of type '" "CvPair32s32f *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair16u32s_i_set" "', argument " "1"" of type '" "CvPair16u32s *""'"); 
   }
-  arg1 = reinterpret_cast< CvPair32s32f * >(argp1);
-  ecode2 = SWIG_AsVal_float(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvPair32s32f_val_set" "', argument " "2"" of type '" "float""'");
-  } 
-  arg2 = static_cast< float >(val2);
-  if (arg1) (arg1)->val = arg2;
-  
+  arg1 = reinterpret_cast< CvPair16u32s * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvPair16u32s_i_set" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = reinterpret_cast< int * >(argp2);
+  if (arg1) (arg1)->i = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17328,65 +19350,65 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvPair32s32f_val_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvPair16u32s_i_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *arg1 = (CvPair32s32f *) 0 ;
-  float result;
+  CvPair16u32s *arg1 = (CvPair16u32s *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvPair32s32f_val_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair32s32f, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvPair16u32s_i_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair16u32s, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair32s32f_val_get" "', argument " "1"" of type '" "CvPair32s32f *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvPair16u32s_i_get" "', argument " "1"" of type '" "CvPair16u32s *""'"); 
   }
-  arg1 = reinterpret_cast< CvPair32s32f * >(argp1);
-  result = (float) ((arg1)->val);
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  arg1 = reinterpret_cast< CvPair16u32s * >(argp1);
+  result = (int *) ((arg1)->i);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvPair32s32f(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvPair16u32s(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *result = 0 ;
+  CvPair16u32s *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvPair32s32f")) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)":new_CvPair16u32s")) SWIG_fail;
   {
     try {
-      result = (CvPair32s32f *)new CvPair32s32f(); 
+      result = (CvPair16u32s *)new CvPair16u32s(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvPair32s32f, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvPair16u32s, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvPair32s32f(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvPair16u32s(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvPair32s32f *arg1 = (CvPair32s32f *) 0 ;
+  CvPair16u32s *arg1 = (CvPair16u32s *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvPair32s32f",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair32s32f, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvPair16u32s",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvPair16u32s, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvPair32s32f" "', argument " "1"" of type '" "CvPair32s32f *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvPair16u32s" "', argument " "1"" of type '" "CvPair16u32s *""'"); 
   }
-  arg1 = reinterpret_cast< CvPair32s32f * >(argp1);
+  arg1 = reinterpret_cast< CvPair16u32s * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -17400,10 +19422,10 @@ fail:
 }
 
 
-SWIGINTERN PyObject *CvPair32s32f_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *CvPair16u32s_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvPair32s32f, SWIG_NewClientData(obj));
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvPair16u32s, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
@@ -17430,7 +19452,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeSplit_var_idx_set(PyObject *SWIGUNUSEDPARM(sel
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->var_idx = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17441,10 +19462,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeSplit_var_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeSplit_var_idx_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
@@ -17460,6 +19481,58 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CvDTreeSplit_condensed_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeSplit_condensed_idx_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeSplit_condensed_idx_set" "', argument " "1"" of type '" "CvDTreeSplit *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTreeSplit * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeSplit_condensed_idx_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->condensed_idx = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTreeSplit_condensed_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeSplit_condensed_idx_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeSplit_condensed_idx_get" "', argument " "1"" of type '" "CvDTreeSplit *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTreeSplit * >(argp1);
+  result = (int) ((arg1)->condensed_idx);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_CvDTreeSplit_inversed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
@@ -17483,7 +19556,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeSplit_inversed_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->inversed = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17494,10 +19566,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeSplit_inversed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeSplit_inversed_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
@@ -17536,7 +19608,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeSplit_quality_set(PyObject *SWIGUNUSEDPARM(sel
   } 
   arg2 = static_cast< float >(val2);
   if (arg1) (arg1)->quality = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17547,10 +19618,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeSplit_quality_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeSplit_quality_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
@@ -17589,7 +19660,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeSplit_next_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< CvDTreeSplit * >(argp2);
   if (arg1) (arg1)->next = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17600,10 +19670,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeSplit_next_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeSplit *arg1 = (CvDTreeSplit *) 0 ;
-  CvDTreeSplit *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeSplit *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeSplit_next_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeSplit, 0 |  0 );
@@ -17655,7 +19725,7 @@ SWIGINTERN PyObject *_wrap_delete_CvDTreeSplit(PyObject *SWIGUNUSEDPARM(self), P
   arg1 = reinterpret_cast< CvDTreeSplit * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -17699,7 +19769,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_class_idx_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->class_idx = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17710,10 +19779,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_class_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_class_idx_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -17752,7 +19821,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_Tn_set(PyObject *SWIGUNUSEDPARM(self), Py
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->Tn = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17763,10 +19831,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_Tn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_Tn_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -17805,7 +19873,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_value_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->value = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17816,10 +19883,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_value_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -17858,7 +19925,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_parent_set(PyObject *SWIGUNUSEDPARM(self)
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
   if (arg1) (arg1)->parent = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17869,10 +19935,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_parent_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeNode *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_parent_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -17911,7 +19977,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_left_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
   if (arg1) (arg1)->left = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17922,10 +19987,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_left_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeNode *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_left_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -17964,7 +20029,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_right_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
   if (arg1) (arg1)->right = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -17975,10 +20039,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_right_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeNode *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_right_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18017,7 +20081,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_split_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< CvDTreeSplit * >(argp2);
   if (arg1) (arg1)->split = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18028,10 +20091,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_split_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  CvDTreeSplit *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeSplit *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_split_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18070,7 +20133,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_sample_count_set(PyObject *SWIGUNUSEDPARM
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->sample_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18081,10 +20143,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_sample_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_sample_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18123,7 +20185,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_depth_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->depth = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18134,10 +20195,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_depth_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_depth_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18176,7 +20237,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_num_valid_set(PyObject *SWIGUNUSEDPARM(se
   }
   arg2 = reinterpret_cast< int * >(argp2);
   if (arg1) (arg1)->num_valid = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18187,10 +20247,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_num_valid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_num_valid_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18229,7 +20289,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_offset_set(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->offset = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18240,10 +20299,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_offset_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_offset_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18282,7 +20341,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_buf_idx_set(PyObject *SWIGUNUSEDPARM(self
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->buf_idx = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18293,10 +20351,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_buf_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_buf_idx_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18335,7 +20393,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_maxlr_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->maxlr = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18346,10 +20403,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_maxlr_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_maxlr_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18388,7 +20445,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_complexity_set(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->complexity = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18399,10 +20455,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_complexity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_complexity_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18441,7 +20497,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_alpha_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->alpha = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18452,10 +20507,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_alpha_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_alpha_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18494,7 +20549,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_node_risk_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->node_risk = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18505,10 +20559,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_node_risk_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_node_risk_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18547,7 +20601,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_tree_risk_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->tree_risk = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18558,10 +20611,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_tree_risk_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_tree_risk_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18600,7 +20653,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_tree_error_set(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< double >(val2);
   if (arg1) (arg1)->tree_error = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18611,10 +20663,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_tree_error_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_tree_error_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18653,7 +20705,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_Tn_set(PyObject *SWIGUNUSEDPARM(self),
   }
   arg2 = reinterpret_cast< int * >(argp2);
   if (arg1) (arg1)->cv_Tn = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18664,10 +20715,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_Tn_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  int *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_cv_Tn_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18706,7 +20757,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_node_risk_set(PyObject *SWIGUNUSEDPARM
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->cv_node_risk = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18717,10 +20767,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_node_risk_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_cv_node_risk_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18759,7 +20809,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_node_error_set(PyObject *SWIGUNUSEDPAR
   }
   arg2 = reinterpret_cast< double * >(argp2);
   if (arg1) (arg1)->cv_node_error = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18770,10 +20819,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeNode_cv_node_error_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
-  double *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeNode_cv_node_error_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18793,13 +20842,13 @@ SWIGINTERN PyObject *_wrap_CvDTreeNode_get_num_valid(PyObject *SWIGUNUSEDPARM(se
   PyObject *resultobj = 0;
   CvDTreeNode *arg1 = (CvDTreeNode *) 0 ;
   int arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeNode_get_num_valid",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
@@ -18911,7 +20960,7 @@ SWIGINTERN PyObject *_wrap_delete_CvDTreeNode(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< CvDTreeNode * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -18955,7 +21004,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_max_categories_set(PyObject *SWIGUNUSED
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->max_categories = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -18966,10 +21014,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_max_categories_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_max_categories_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19008,7 +21056,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_max_depth_set(PyObject *SWIGUNUSEDPARM(
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->max_depth = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19019,10 +21066,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_max_depth_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_max_depth_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19061,7 +21108,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_min_sample_count_set(PyObject *SWIGUNUS
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->min_sample_count = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19072,10 +21118,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_min_sample_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_min_sample_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19114,7 +21160,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_cv_folds_set(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->cv_folds = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19125,10 +21170,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_cv_folds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_cv_folds_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19167,7 +21212,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_use_surrogates_set(PyObject *SWIGUNUSED
   } 
   arg2 = static_cast< bool >(val2);
   if (arg1) (arg1)->use_surrogates = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19178,10 +21222,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_use_surrogates_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_use_surrogates_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19220,7 +21264,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_use_1se_rule_set(PyObject *SWIGUNUSEDPA
   } 
   arg2 = static_cast< bool >(val2);
   if (arg1) (arg1)->use_1se_rule = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19231,10 +21274,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_use_1se_rule_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_use_1se_rule_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19273,7 +21316,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_truncate_pruned_tree_set(PyObject *SWIG
   } 
   arg2 = static_cast< bool >(val2);
   if (arg1) (arg1)->truncate_pruned_tree = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19284,10 +21326,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_truncate_pruned_tree_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_truncate_pruned_tree_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19326,7 +21368,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_regression_accuracy_set(PyObject *SWIGU
   } 
   arg2 = static_cast< float >(val2);
   if (arg1) (arg1)->regression_accuracy = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19337,10 +21378,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_regression_accuracy_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  float result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_regression_accuracy_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19379,7 +21420,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeParams_priors_set(PyObject *SWIGUNUSEDPARM(sel
   }
   arg2 = reinterpret_cast< float * >(argp2);
   if (arg1) (arg1)->priors = (float const *)arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -19390,10 +21430,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeParams_priors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeParams *arg1 = (CvDTreeParams *) 0 ;
-  float *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  float *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeParams_priors_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
@@ -19441,7 +21481,6 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeParams__SWIG_1(PyObject *SWIGUNUSEDPARM(se
   bool arg7 ;
   bool arg8 ;
   float *arg9 = (float *) 0 ;
-  CvDTreeParams *result = 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -19469,6 +21508,7 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeParams__SWIG_1(PyObject *SWIGUNUSEDPARM(se
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  CvDTreeParams *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:new_CvDTreeParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   ecode1 = SWIG_AsVal_int(obj0, &val1);
@@ -19627,7 +21667,7 @@ SWIGINTERN PyObject *_wrap_delete_CvDTreeParams(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< CvDTreeParams * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -19681,21 +21721,14 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_1(PyObject *SWIGUNUSEDPARM
   CvDTreeParams *arg8 = 0 ;
   bool arg9 ;
   bool arg10 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   void *argp8 = 0 ;
   int res8 = 0 ;
   bool val9 ;
@@ -19712,43 +21745,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_1(PyObject *SWIGUNUSEDPARM
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
   PyObject * obj9 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvDTreeTrainData" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvDTreeTrainData" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res8)) {
     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvDTreeTrainData" "', argument " "8"" of type '" "CvDTreeParams const &""'"); 
@@ -19777,8 +21799,80 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_1(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -19794,21 +21888,14 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_2(PyObject *SWIGUNUSEDPARM
   CvMat *arg7 = (CvMat *) 0 ;
   CvDTreeParams *arg8 = 0 ;
   bool arg9 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   void *argp8 = 0 ;
   int res8 = 0 ;
   bool val9 ;
@@ -19822,43 +21909,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_2(PyObject *SWIGUNUSEDPARM
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvDTreeTrainData" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvDTreeTrainData" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res8)) {
     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvDTreeTrainData" "', argument " "8"" of type '" "CvDTreeParams const &""'"); 
@@ -19882,8 +21958,80 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_2(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -19898,21 +22046,14 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_3(PyObject *SWIGUNUSEDPARM
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
   CvDTreeParams *arg8 = 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   void *argp8 = 0 ;
   int res8 = 0 ;
   PyObject * obj0 = 0 ;
@@ -19923,43 +22064,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_3(PyObject *SWIGUNUSEDPARM
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvDTreeTrainData" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvDTreeTrainData" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res8)) {
     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvDTreeTrainData" "', argument " "8"" of type '" "CvDTreeParams const &""'"); 
@@ -19978,8 +22108,80 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_3(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -19993,21 +22195,14 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_4(PyObject *SWIGUNUSEDPARM
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -20015,43 +22210,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_4(PyObject *SWIGUNUSEDPARM
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvDTreeTrainData" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvDTreeTrainData" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
       result = (CvDTreeTrainData *)new CvDTreeTrainData((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
@@ -20062,8 +22246,80 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_4(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -20076,57 +22332,42 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_5(PyObject *SWIGUNUSEDPARM
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvDTreeTrainData" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
       result = (CvDTreeTrainData *)new CvDTreeTrainData((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
@@ -20137,8 +22378,68 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_5(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
@@ -20150,49 +22451,37 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_6(PyObject *SWIGUNUSEDPARM
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvDTreeTrainData" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (CvDTreeTrainData *)new CvDTreeTrainData((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -20203,8 +22492,56 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_6(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -20215,41 +22552,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_7(PyObject *SWIGUNUSEDPARM
   int arg2 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvDTreeTrainData" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (CvDTreeTrainData *)new CvDTreeTrainData((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
@@ -20260,8 +22588,44 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_7(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -20271,33 +22635,27 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_8(PyObject *SWIGUNUSEDPARM
   CvMat *arg1 = (CvMat *) 0 ;
   int arg2 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  CvDTreeTrainData *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvDTreeTrainData",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvDTreeTrainData" "', argument " "1"" of type '" "CvMat const *""'"); 
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvDTreeTrainData" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvDTreeTrainData" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
       result = (CvDTreeTrainData *)new CvDTreeTrainData((CvMat const *)arg1,arg2,(CvMat const *)arg3); 
@@ -20308,8 +22666,32 @@ SWIGINTERN PyObject *_wrap_new_CvDTreeTrainData__SWIG_8(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
@@ -20659,7 +23041,7 @@ SWIGINTERN PyObject *_wrap_delete_CvDTreeTrainData(PyObject *SWIGUNUSEDPARM(self
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -20689,20 +23071,14 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_0(PyObject *SWIGUNUSE
   bool arg12 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   void *argp9 = 0 ;
   int res9 = 0 ;
   bool val10 ;
@@ -20730,41 +23106,29 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_0(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTreeTrainData_set_data" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res9)) {
     SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
@@ -20798,8 +23162,80 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_0(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
@@ -20819,20 +23255,14 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_1(PyObject *SWIGUNUSE
   bool arg11 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   void *argp9 = 0 ;
   int res9 = 0 ;
   bool val10 ;
@@ -20857,41 +23287,29 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_1(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTreeTrainData_set_data" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res9)) {
     SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
@@ -20920,8 +23338,80 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_1(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
@@ -20940,20 +23430,14 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_2(PyObject *SWIGUNUSE
   bool arg10 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   void *argp9 = 0 ;
   int res9 = 0 ;
   bool val10 ;
@@ -20975,41 +23459,29 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_2(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTreeTrainData_set_data" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res9)) {
     SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
@@ -21033,8 +23505,80 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_2(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
@@ -21052,20 +23596,14 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_3(PyObject *SWIGUNUSE
   CvDTreeParams *arg9 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   void *argp9 = 0 ;
   int res9 = 0 ;
   PyObject * obj0 = 0 ;
@@ -21084,41 +23622,29 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_3(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTreeTrainData_set_data" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
   if (!SWIG_IsOK(res9)) {
     SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
@@ -21137,8 +23663,80 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_3(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
@@ -21155,20 +23753,14 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_4(PyObject *SWIGUNUSE
   CvMat *arg8 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -21184,41 +23776,29 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_4(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTreeTrainData_set_data" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   {
     try {
       (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
@@ -21229,8 +23809,80 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_4(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
@@ -21246,18 +23898,13 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_5(PyObject *SWIGUNUSE
   CvMat *arg7 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -21272,36 +23919,26 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_5(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_set_data" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
       (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
@@ -21312,8 +23949,68 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_5(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
@@ -21328,16 +24025,12 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_6(PyObject *SWIGUNUSE
   CvMat *arg6 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -21351,31 +24044,23 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_6(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTreeTrainData_set_data" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
       (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
@@ -21386,8 +24071,56 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_6(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
@@ -21401,14 +24134,11 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_7(PyObject *SWIGUNUSE
   CvMat *arg5 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -21421,26 +24151,20 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_7(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_set_data" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -21451,8 +24175,44 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_7(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
@@ -21465,12 +24225,10 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_8(PyObject *SWIGUNUSE
   CvMat *arg4 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -21482,21 +24240,17 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_8(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_set_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_set_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_set_data" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
@@ -21507,8 +24261,32 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_data__SWIG_8(PyObject *SWIGUNUSE
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
@@ -21947,6 +24725,35 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_do_responses_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_do_responses_copy",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_do_responses_copy" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  {
+    try {
+      (arg1)->do_responses_copy(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
@@ -21957,8 +24764,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_0(PyObject *SWIGUN
   bool arg6 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   void *argp3 = 0 ;
   int res3 = 0 ;
   void *argp4 = 0 ;
@@ -21980,11 +24786,9 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_0(PyObject *SWIGUN
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "3"" of type '" "float *""'"); 
@@ -22015,8 +24819,20 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_0(PyObject *SWIGUN
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -22030,8 +24846,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_1(PyObject *SWIGUN
   float *arg5 = (float *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   void *argp3 = 0 ;
   int res3 = 0 ;
   void *argp4 = 0 ;
@@ -22050,11 +24865,9 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_1(PyObject *SWIGUN
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_vectors" "', argument " "3"" of type '" "float *""'"); 
@@ -22080,8 +24893,20 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_vectors__SWIG_1(PyObject *SWIGUN
     } 
   }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -22174,13 +24999,12 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_subsample_data(PyObject *SWIGUNUSEDP
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvDTreeNode *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_subsample_data",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22188,11 +25012,9 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_subsample_data(PyObject *SWIGUNUSEDP
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_subsample_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_subsample_data" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
     try {
       result = (CvDTreeNode *)(arg1)->subsample_data((CvMat const *)arg2); 
@@ -22203,8 +25025,20 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_subsample_data(PyObject *SWIGUNUSEDP
     } 
   }
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
@@ -22223,7 +25057,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_write_params(PyObject *SWIGUNUSEDPAR
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_write_params",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_write_params" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_write_params" "', argument " "1"" of type '" "CvDTreeTrainData const *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
@@ -22233,7 +25067,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_write_params(PyObject *SWIGUNUSEDPAR
   arg2 = reinterpret_cast< CvFileStorage * >(argp2);
   {
     try {
-      (arg1)->write_params(arg2); 
+      ((CvDTreeTrainData const *)arg1)->write_params(arg2); 
     } 
     catch (...) 
     {
@@ -22326,10 +25160,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_num_classes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_num_classes",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22357,13 +25191,13 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_var_type(PyObject *SWIGUNUSEDPAR
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   int arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_get_var_type",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22395,10 +25229,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_work_var_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_work_var_count",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22422,19 +25256,84 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_ord_responses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  float *arg3 = (float *) 0 ;
+  float **arg4 = (float **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *vptr4 ;
+  float *buffer4 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTreeTrainData_get_ord_responses",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_ord_responses" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_ord_responses" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_ord_responses" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  {
+    if ((SWIG_ConvertPtr(obj3, &vptr4, SWIGTYPE_p_float, 1)) == -1){
+      SWIG_fail;
+    }
+    buffer4 = (float *) vptr4;
+    arg4=&buffer4;
+  }
+  {
+    try {
+      (arg1)->get_ord_responses(arg2,arg3,(float const **)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_class_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
-  int *result = 0 ;
+  int *arg3 = (int *) 0 ;
+  int **arg4 = (int **) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_get_class_labels",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTreeTrainData_get_class_labels",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_class_labels" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
@@ -22445,94 +25344,138 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_class_labels(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_class_labels" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_class_labels" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = reinterpret_cast< int * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_get_class_labels" "', argument " "4"" of type '" "int const **""'"); 
+  }
+  arg4 = reinterpret_cast< int ** >(argp4);
   {
     try {
-      result = (int *)(arg1)->get_class_labels(arg2); 
+      (arg1)->get_class_labels(arg2,arg3,(int const **)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_ord_responses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_cv_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
-  float *result = 0 ;
+  int *arg3 = (int *) 0 ;
+  int **arg4 = (int **) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_get_ord_responses",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTreeTrainData_get_cv_labels",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_ord_responses" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_cv_labels" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_ord_responses" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_cv_labels" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_cv_labels" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = reinterpret_cast< int * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_get_cv_labels" "', argument " "4"" of type '" "int const **""'"); 
+  }
+  arg4 = reinterpret_cast< int ** >(argp4);
   {
     try {
-      result = (float *)(arg1)->get_ord_responses(arg2); 
+      (arg1)->get_cv_labels(arg2,arg3,(int const **)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_sample_indices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
-  int *result = 0 ;
+  int *arg3 = (int *) 0 ;
+  int **arg4 = (int **) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_get_labels",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTreeTrainData_get_sample_indices",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_labels" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_sample_indices" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_labels" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_get_sample_indices" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
   }
   arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTreeTrainData_get_sample_indices" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = reinterpret_cast< int * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_get_sample_indices" "', argument " "4"" of type '" "int const **""'"); 
+  }
+  arg4 = reinterpret_cast< int ** >(argp4);
   {
     try {
-      result = (int *)(arg1)->get_labels(arg2); 
+      (arg1)->get_sample_indices(arg2,arg3,(int const **)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
@@ -22544,18 +25487,26 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_cat_var_data(PyObject *SWIGUNUSE
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
   int arg3 ;
-  int *result = 0 ;
+  int *arg4 = (int *) 0 ;
+  int **arg5 = (int **) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTreeTrainData_get_cat_var_data",&obj0,&obj1,&obj2)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvDTreeTrainData_get_cat_var_data",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_cat_var_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
@@ -22571,16 +25522,26 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_cat_var_data(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_get_cat_var_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_get_cat_var_data" "', argument " "4"" of type '" "int *""'"); 
+  }
+  arg4 = reinterpret_cast< int * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_get_cat_var_data" "', argument " "5"" of type '" "int const **""'"); 
+  }
+  arg5 = reinterpret_cast< int ** >(argp5);
   {
     try {
-      result = (int *)(arg1)->get_cat_var_data(arg2,arg3); 
+      result = (int)(arg1)->get_cat_var_data(arg2,arg3,arg4,(int const **)arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
@@ -22592,18 +25553,34 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_ord_var_data(PyObject *SWIGUNUSE
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
   int arg3 ;
-  CvPair32s32f *result = 0 ;
+  float *arg4 = (float *) 0 ;
+  int *arg5 = (int *) 0 ;
+  float **arg6 = (float **) 0 ;
+  int **arg7 = (int **) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *vptr6 ;
+  float *buffer6 ;
+  void *argp7 = 0 ;
+  int res7 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTreeTrainData_get_ord_var_data",&obj0,&obj1,&obj2)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvDTreeTrainData_get_ord_var_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_ord_var_data" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
@@ -22619,16 +25596,38 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_ord_var_data(PyObject *SWIGUNUSE
     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTreeTrainData_get_ord_var_data" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTreeTrainData_get_ord_var_data" "', argument " "4"" of type '" "float *""'"); 
+  }
+  arg4 = reinterpret_cast< float * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTreeTrainData_get_ord_var_data" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = reinterpret_cast< int * >(argp5);
+  {
+    if ((SWIG_ConvertPtr(obj5, &vptr6, SWIGTYPE_p_float, 1)) == -1){
+      SWIG_fail;
+    }
+    buffer6 = (float *) vptr6;
+    arg6=&buffer6;
+  }
+  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res7)) {
+    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTreeTrainData_get_ord_var_data" "', argument " "7"" of type '" "int const **""'"); 
+  }
+  arg7 = reinterpret_cast< int ** >(argp7);
   {
     try {
-      result = (CvPair32s32f *)(arg1)->get_ord_var_data(arg2,arg3); 
+      result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(int const **)arg7); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvPair32s32f, 0 |  0 );
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
@@ -22639,13 +25638,13 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_child_buf_idx(PyObject *SWIGUNUS
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_get_child_buf_idx",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22678,13 +25677,13 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_set_params(PyObject *SWIGUNUSEDPARM(
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvDTreeParams *arg2 = 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_set_params",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22723,7 +25722,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_node(PyObject *SWIGUNUSEDPARM(se
   int arg3 ;
   int arg4 ;
   int arg5 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -22739,6 +25737,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_node(PyObject *SWIGUNUSEDPARM(se
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  CvDTreeNode *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvDTreeTrainData_new_node",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22790,7 +25789,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_split_ord(PyObject *SWIGUNUSEDPA
   int arg4 ;
   int arg5 ;
   float arg6 ;
-  CvDTreeSplit *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -22809,6 +25807,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_split_ord(PyObject *SWIGUNUSEDPA
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  CvDTreeSplit *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvDTreeTrainData_new_split_ord",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -22862,7 +25861,6 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_split_cat(PyObject *SWIGUNUSEDPA
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   int arg2 ;
   float arg3 ;
-  CvDTreeSplit *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -22872,6 +25870,7 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_new_split_cat(PyObject *SWIGUNUSEDPA
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  CvDTreeSplit *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTreeTrainData_new_split_cat",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
@@ -23010,189 +26009,217 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_pred_float_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  float *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_sample_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_pred_float_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_pred_float_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_sample_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->sample_count = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  {
+    try {
+      result = (float *)(arg1)->get_pred_float_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_pred_int_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_sample_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_pred_int_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_pred_int_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->sample_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    try {
+      result = (int *)(arg1)->get_pred_int_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_all_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_resp_float_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  float *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_all_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_resp_float_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_all_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_resp_float_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_var_all_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->var_all = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  {
+    try {
+      result = (float *)(arg1)->get_resp_float_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_all_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_resp_int_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_all_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_resp_int_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_all_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_resp_int_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->var_all);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    try {
+      result = (int *)(arg1)->get_resp_int_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_cv_lables_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_cv_lables_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_cv_lables_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_var_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->var_count = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  {
+    try {
+      result = (int *)(arg1)->get_cv_lables_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_get_sample_idx_buf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_get_sample_idx_buf",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_get_sample_idx_buf" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->var_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    try {
+      result = (int *)(arg1)->get_sample_idx_buf(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_max_c_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_pred_float_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
+  vector< vector< float > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_max_c_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_pred_float_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_max_c_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_pred_float_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_max_c_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->max_c_count = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_float_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_pred_float_buf_set" "', argument " "2"" of type '" "vector< vector< float > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_pred_float_buf_set" "', argument " "2"" of type '" "vector< vector< float > >""'");
+    } else {
+      vector< vector< float > > * temp = reinterpret_cast< vector< vector< float > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->pred_float_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23200,52 +26227,59 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_max_c_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_pred_float_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< float > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_max_c_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_pred_float_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_max_c_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_pred_float_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->max_c_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  result =  ((arg1)->pred_float_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< float > >(static_cast< const vector< vector< float > >& >(result))), SWIGTYPE_p_vectorT_vectorT_float_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_ord_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_pred_int_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
+  vector< vector< int > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_ord_var_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_pred_int_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_ord_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_pred_int_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_ord_var_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->ord_var_count = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_int_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_pred_int_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_pred_int_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'");
+    } else {
+      vector< vector< int > > * temp = reinterpret_cast< vector< vector< int > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->pred_int_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23253,52 +26287,59 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_ord_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_pred_int_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< int > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_ord_var_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_pred_int_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_ord_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_pred_int_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->ord_var_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  result =  ((arg1)->pred_int_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< int > >(static_cast< const vector< vector< int > >& >(result))), SWIGTYPE_p_vectorT_vectorT_int_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_resp_float_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int arg2 ;
+  vector< vector< float > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_var_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_resp_float_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_resp_float_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_cat_var_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->cat_var_count = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_float_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_resp_float_buf_set" "', argument " "2"" of type '" "vector< vector< float > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_resp_float_buf_set" "', argument " "2"" of type '" "vector< vector< float > >""'");
+    } else {
+      vector< vector< float > > * temp = reinterpret_cast< vector< vector< float > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->resp_float_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23306,52 +26347,59 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_resp_float_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< float > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_var_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_resp_float_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_resp_float_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->cat_var_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  result =  ((arg1)->resp_float_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< float > >(static_cast< const vector< vector< float > >& >(result))), SWIGTYPE_p_vectorT_vectorT_float_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_labels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_resp_int_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool arg2 ;
+  vector< vector< int > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  bool val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_have_labels_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_resp_int_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_labels_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_resp_int_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_have_labels_set" "', argument " "2"" of type '" "bool""'");
-  } 
-  arg2 = static_cast< bool >(val2);
-  if (arg1) (arg1)->have_labels = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_int_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_resp_int_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_resp_int_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'");
+    } else {
+      vector< vector< int > > * temp = reinterpret_cast< vector< vector< int > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->resp_int_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23359,52 +26407,59 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_labels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_resp_int_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< int > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_have_labels_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_resp_int_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_labels_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_resp_int_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (bool) ((arg1)->have_labels);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  result =  ((arg1)->resp_int_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< int > >(static_cast< const vector< vector< int > >& >(result))), SWIGTYPE_p_vectorT_vectorT_int_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_priors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_lables_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool arg2 ;
+  vector< vector< int > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  bool val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_have_priors_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cv_lables_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_priors_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_lables_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_have_priors_set" "', argument " "2"" of type '" "bool""'");
-  } 
-  arg2 = static_cast< bool >(val2);
-  if (arg1) (arg1)->have_priors = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_int_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_cv_lables_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_cv_lables_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'");
+    } else {
+      vector< vector< int > > * temp = reinterpret_cast< vector< vector< int > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->cv_lables_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23412,52 +26467,59 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_priors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_lables_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< int > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_have_priors_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cv_lables_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_priors_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_lables_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (bool) ((arg1)->have_priors);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  result =  ((arg1)->cv_lables_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< int > >(static_cast< const vector< vector< int > >& >(result))), SWIGTYPE_p_vectorT_vectorT_int_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_classifier_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_idx_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool arg2 ;
+  vector< vector< int > > arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  bool val2 ;
-  int ecode2 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_is_classifier_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_sample_idx_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_classifier_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_idx_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_is_classifier_set" "', argument " "2"" of type '" "bool""'");
-  } 
-  arg2 = static_cast< bool >(val2);
-  if (arg1) (arg1)->is_classifier = arg2;
-  
+  {
+    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_vectorT_vectorT_int_t_t,  0  | 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_sample_idx_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'"); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTreeTrainData_sample_idx_buf_set" "', argument " "2"" of type '" "vector< vector< int > >""'");
+    } else {
+      vector< vector< int > > * temp = reinterpret_cast< vector< vector< int > > * >(argp2);
+      arg2 = *temp;
+      if (SWIG_IsNewObj(res2)) delete temp;
+    }
+  }
+  if (arg1) (arg1)->sample_idx_buf = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23465,29 +26527,29 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_classifier_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_idx_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  vector< vector< int > > result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_is_classifier_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_sample_idx_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_classifier_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_idx_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (bool) ((arg1)->is_classifier);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  result =  ((arg1)->sample_idx_buf);
+  resultobj = SWIG_NewPointerObj((new vector< vector< int > >(static_cast< const vector< vector< int > >& >(result))), SWIGTYPE_p_vectorT_vectorT_int_t_t, SWIG_POINTER_OWN |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   int arg2 ;
@@ -23498,19 +26560,18 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_count_set(PyObject *SWIGUNUSEDPA
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_sample_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_buf_count_set" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_sample_count_set" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->buf_count = arg2;
-  
+  if (arg1) (arg1)->sample_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23518,21 +26579,21 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_sample_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_sample_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_sample_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->buf_count);
+  result = (int) ((arg1)->sample_count);
   resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
@@ -23540,7 +26601,7 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_all_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   int arg2 ;
@@ -23551,19 +26612,18 @@ SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_size_set(PyObject *SWIGUNUSEDPAR
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_size_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_all_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_size_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_all_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_buf_size_set" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_var_all_set" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->buf_size = arg2;
-  
+  if (arg1) (arg1)->var_all = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23571,21 +26631,21 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_all_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_size_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_all_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_size_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_all_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (int) ((arg1)->buf_size);
+  result = (int) ((arg1)->var_all);
   resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
@@ -23593,30 +26653,29 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_shared_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool arg2 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  bool val2 ;
+  int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_shared_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_shared_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_shared_set" "', argument " "2"" of type '" "bool""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_var_count_set" "', argument " "2"" of type '" "int""'");
   } 
-  arg2 = static_cast< bool >(val2);
-  if (arg1) (arg1)->shared = arg2;
-  
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->var_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23624,52 +26683,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_shared_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_shared_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_shared_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (bool) ((arg1)->shared);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  result = (int) ((arg1)->var_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_max_c_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_count_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_max_c_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_max_c_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_cat_count_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->cat_count = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_max_c_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->max_c_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23677,52 +26735,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_max_c_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_count_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_max_c_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_max_c_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->cat_count);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (int) ((arg1)->max_c_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_ofs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_ord_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_ofs_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_ord_var_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_ofs_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_ord_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_cat_ofs_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->cat_ofs = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_ord_var_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ord_var_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23730,52 +26787,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_ofs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_ord_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_ofs_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_ord_var_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_ofs_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_ord_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->cat_ofs);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (int) ((arg1)->ord_var_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_map_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_var_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_map_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_cat_map_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->cat_map = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_cat_var_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->cat_var_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23783,52 +26839,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_map_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_var_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_map_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->cat_map);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (int) ((arg1)->cat_var_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_counts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_work_var_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_counts_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_work_var_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_counts_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_work_var_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_counts_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->counts = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_work_var_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->work_var_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23836,52 +26891,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_counts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_work_var_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_counts_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_work_var_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_counts_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_work_var_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->counts);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (int) ((arg1)->work_var_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_labels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_have_labels_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_labels_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_buf_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->buf = arg2;
-  
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_have_labels_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->have_labels = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23889,52 +26943,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_labels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_have_labels_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_labels_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->buf);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (bool) ((arg1)->have_labels);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_direction_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_priors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_direction_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_have_priors_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_direction_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_priors_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_direction_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->direction = arg2;
-  
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_have_priors_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->have_priors = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23942,52 +26995,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_direction_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_have_priors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_direction_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_have_priors_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_direction_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_have_priors_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->direction);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (bool) ((arg1)->have_priors);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_classifier_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_split_buf_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_is_classifier_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_classifier_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_split_buf_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->split_buf = arg2;
-  
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_is_classifier_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->is_classifier = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -23995,52 +27047,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_classifier_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_split_buf_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_is_classifier_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_classifier_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->split_buf);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (bool) ((arg1)->is_classifier);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tflag_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_idx_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_tflag_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_idx_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tflag_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_var_idx_set" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->var_idx = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_tflag_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->tflag = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -24048,74 +27099,82 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tflag_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_idx_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_tflag_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_idx_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tflag_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->var_idx);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  result = (int) ((arg1)->tflag);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_train_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_type_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_train_data_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_type_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_train_data_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_var_type_set" "', argument " "2"" of type '" "CvMat *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->var_type = arg2;
-  
+  if (arg1) (arg1)->train_data = (CvMat const *)arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_train_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_type_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_train_data_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_type_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_train_data_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->var_type);
+  result = (CvMat *) ((arg1)->train_data);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
@@ -24123,52 +27182,60 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_responses_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_priors_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_responses_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_responses_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_priors_set" "', argument " "2"" of type '" "CvMat *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->priors = arg2;
-  
+  if (arg1) (arg1)->responses = (CvMat const *)arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_responses_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_priors_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_responses_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_responses_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->priors);
+  result = (CvMat *) ((arg1)->responses);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
@@ -24176,52 +27243,60 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_mult_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_responses_copy_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_priors_mult_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_responses_copy_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_mult_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_responses_copy_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_priors_mult_set" "', argument " "2"" of type '" "CvMat *""'"); 
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  if (arg1) (arg1)->priors_mult = arg2;
-  
+  if (arg1) (arg1)->responses_copy = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_mult_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_responses_copy_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_priors_mult_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_responses_copy_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_mult_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_responses_copy_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMat *) ((arg1)->priors_mult);
+  result = (CvMat *) ((arg1)->responses_copy);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
@@ -24229,30 +27304,29 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_params_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvDTreeParams *arg2 = (CvDTreeParams *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_params_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_params_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_params_set" "', argument " "2"" of type '" "CvDTreeParams *""'"); 
-  }
-  arg2 = reinterpret_cast< CvDTreeParams * >(argp2);
-  if (arg1) (arg1)->params = *arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_buf_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->buf_count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -24260,52 +27334,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_params_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvDTreeParams *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_params_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_params_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvDTreeParams *)& ((arg1)->params);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeParams, 0 |  0 );
+  result = (int) ((arg1)->buf_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tree_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMemStorage *arg2 = (CvMemStorage *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_tree_storage_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_size_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tree_storage_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_size_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMemStorage, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_tree_storage_set" "', argument " "2"" of type '" "CvMemStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMemStorage * >(argp2);
-  if (arg1) (arg1)->tree_storage = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_buf_size_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->buf_size = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -24313,52 +27386,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tree_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMemStorage *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_tree_storage_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_size_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tree_storage_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_size_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMemStorage *) ((arg1)->tree_storage);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMemStorage, 0 |  0 );
+  result = (int) ((arg1)->buf_size);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_temp_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_shared_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMemStorage *arg2 = (CvMemStorage *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_temp_storage_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_shared_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_temp_storage_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_shared_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMemStorage, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_temp_storage_set" "', argument " "2"" of type '" "CvMemStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMemStorage * >(argp2);
-  if (arg1) (arg1)->temp_storage = arg2;
-  
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_shared_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->shared = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -24366,52 +27438,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_temp_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_shared_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvMemStorage *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_temp_storage_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_shared_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_temp_storage_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_shared_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvMemStorage *) ((arg1)->temp_storage);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMemStorage, 0 |  0 );
+  result = (bool) ((arg1)->shared);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_data_root_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_buf_16u_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_data_root_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_is_buf_16u_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_data_root_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_buf_16u_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_data_root_set" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
-  }
-  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
-  if (arg1) (arg1)->data_root = arg2;
-  
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTreeTrainData_is_buf_16u_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->is_buf_16u = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -24419,1283 +27490,703 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_data_root_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_is_buf_16u_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_data_root_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_is_buf_16u_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_data_root_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_is_buf_16u_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvDTreeNode *) ((arg1)->data_root);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  result = (int) ((arg1)->is_buf_16u);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_node_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *arg2 = (CvSet *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *ptr2 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_node_heap_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_count_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_node_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_count_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
-    {
-      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
-      return NULL;
-    }
-    arg2 = (CvSet *)ptr2;
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  if (arg1) (arg1)->node_heap = arg2;
-  
+  if (arg1) (arg1)->cat_count = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_node_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_node_heap_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_count_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_node_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_count_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvSet *) ((arg1)->node_heap);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  result = (CvMat *) ((arg1)->cat_count);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_ofs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *arg2 = (CvSet *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *ptr2 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_split_heap_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_ofs_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_ofs_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
-    {
-      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
-      return NULL;
-    }
-    arg2 = (CvSet *)ptr2;
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  if (arg1) (arg1)->split_heap = arg2;
-  
+  if (arg1) (arg1)->cat_ofs = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_ofs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_split_heap_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_ofs_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_ofs_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvSet *) ((arg1)->split_heap);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  result = (CvMat *) ((arg1)->cat_ofs);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *arg2 = (CvSet *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *ptr2 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cv_heap_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cat_map_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_map_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
-    {
-      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
-      return NULL;
-    }
-    arg2 = (CvSet *)ptr2;
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  if (arg1) (arg1)->cv_heap = arg2;
-  
+  if (arg1) (arg1)->cat_map = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cat_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cv_heap_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cat_map_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cat_map_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvSet *) ((arg1)->cv_heap);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  result = (CvMat *) ((arg1)->cat_map);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_nv_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_counts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *arg2 = (CvSet *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *ptr2 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_nv_heap_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_counts_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_nv_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_counts_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
-      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
-    {
-      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
-      return NULL;
-    }
-    arg2 = (CvSet *)ptr2;
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  if (arg1) (arg1)->nv_heap = arg2;
-  
+  if (arg1) (arg1)->counts = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_nv_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_counts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvSet *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_nv_heap_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_counts_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_nv_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_counts_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvSet *) ((arg1)->nv_heap);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  result = (CvMat *) ((arg1)->counts);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_rng_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvRNG arg2 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *vptr2 ;
-  CvRNG_Wrapper *wrapper2 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_rng_set",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_buf_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_rng_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    if(SWIG_ConvertPtr(obj1, &vptr2, SWIGTYPE_p_CvRNG_Wrapper, 0)==-1){
-      SWIG_exception( SWIG_TypeError, "could not convert Python object to C value");
-      return NULL;
-    }
-    wrapper2 = (CvRNG_Wrapper *) vptr2;
-    arg2 = wrapper2->ref();
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  if (arg1) (arg1)->rng = arg2;
-  
+  if (arg1) (arg1)->buf = arg2;
   resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTreeTrainData_rng_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
-  CvRNG result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_rng_get",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_buf_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_rng_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
   arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
-  result = (CvRNG) ((arg1)->rng);
-  {
-    CvRNG_Wrapper * wrapper = new CvRNG_Wrapper( result );
-    resultobj = SWIG_NewPointerObj( wrapper, SWIGTYPE_p_CvRNG_Wrapper, 1 );
-  }
+  result = (CvMat *) ((arg1)->buf);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvDTreeTrainData_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvDTreeTrainData, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvDTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_direction_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvDTree")) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_direction_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_direction_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      result = (CvDTree *)new CvDTree(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  if (arg1) (arg1)->direction = arg2;
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTree, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvDTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_direction_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvDTree",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_direction_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvDTree" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_direction_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->direction);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  CvDTreeParams arg9 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  void *argp9 ;
-  int res9 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_split_buf_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_buf_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
-    if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
-    }  
-    if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
-    } else {
-      CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp9);
-      arg9 = *temp;
-      if (SWIG_IsNewObj(res9)) delete temp;
-    }
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
+  if (arg1) (arg1)->split_buf = arg2;
+  resultobj = SWIG_Py_Void();
   {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  bool result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_split_buf_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvDTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
-  }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
-  {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_buf_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->split_buf);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_idx_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_idx_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvDTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
+  if (arg1) (arg1)->var_idx = arg2;
+  resultobj = SWIG_Py_Void();
   {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  bool result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_idx_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvDTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_idx_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->var_idx);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_var_type_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_type_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvDTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
+  if (arg1) (arg1)->var_type = arg2;
+  resultobj = SWIG_Py_Void();
   {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_var_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_var_type_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  {
-    try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_var_type_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->var_type);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_priors_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  if (arg1) (arg1)->priors = arg2;
+  resultobj = SWIG_Py_Void();
   {
-    try {
-      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_train(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[10];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvDTree_train__SWIG_6(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvDTree_train__SWIG_5(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_CvDTree_train__SWIG_4(self, args);
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 6) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_CvDTree_train__SWIG_3(self, args);
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 7) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  return _wrap_CvDTree_train__SWIG_2(self, args);
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 8) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    return _wrap_CvDTree_train__SWIG_1(self, args);
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 9) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
-                    _v = SWIG_CheckState(res);
-                    if (_v) {
-                      return _wrap_CvDTree_train__SWIG_0(self, args);
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_priors_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->priors);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_train'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    train(CvDTree *,CvMat const *,int,CvMat const *)\n"
-    "    train(CvDTree *,CvDTreeTrainData *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_mult_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  bool arg4 ;
-  CvDTreeNode *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  bool val4 ;
-  int ecode4 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_predict",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_priors_mult_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_mult_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  ecode4 = SWIG_AsVal_bool(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvDTree_predict" "', argument " "4"" of type '" "bool""'");
-  } 
-  arg4 = static_cast< bool >(val4);
+  if (arg1) (arg1)->priors_mult = arg2;
+  resultobj = SWIG_Py_Void();
   {
-    try {
-      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_priors_mult_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvDTreeNode *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_predict",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_priors_mult_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  {
-    try {
-      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_priors_mult_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->priors_mult);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_params_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvDTreeNode *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvDTreeParams *arg2 = (CvDTreeParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -25703,211 +28194,122 @@ SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_2(PyObject *SWIGUNUSEDPARM(self
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_predict",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_params_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_params_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeParams, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  {
-    try {
-      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_params_set" "', argument " "2"" of type '" "CvDTreeParams *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  arg2 = reinterpret_cast< CvDTreeParams * >(argp2);
+  if (arg1) (arg1)->params = *arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_predict(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[5];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_params_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvDTreeParams *result = 0 ;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_CvDTree_predict__SWIG_2(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvDTree_predict__SWIG_1(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          {
-            int res = SWIG_AsVal_bool(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            return _wrap_CvDTree_predict__SWIG_0(self, args);
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_params_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_params_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvDTreeParams *)& ((arg1)->params);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeParams, 0 |  0 );
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_predict'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    predict(CvDTree const *,CvMat const *,CvMat const *,bool)\n"
-    "    predict(CvDTree const *,CvMat const *,CvMat const *)\n"
-    "    predict(CvDTree const *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_get_var_importance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tree_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvMat *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvMemStorage *arg2 = (CvMemStorage *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_var_importance",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_tree_storage_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_var_importance" "', argument " "1"" of type '" "CvDTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tree_storage_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  {
-    try {
-      result = (CvMat *)(arg1)->get_var_importance(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMemStorage, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_tree_storage_set" "', argument " "2"" of type '" "CvMemStorage *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  arg2 = reinterpret_cast< CvMemStorage * >(argp2);
+  if (arg1) (arg1)->tree_storage = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_tree_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMemStorage *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_clear",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_tree_storage_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_clear" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  {
-    try {
-      (arg1)->clear(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_tree_storage_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMemStorage *) ((arg1)->tree_storage);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMemStorage, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_temp_storage_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvMemStorage *arg2 = (CvMemStorage *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_temp_storage_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_read" "', argument " "1"" of type '" "CvDTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_temp_storage_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMemStorage, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
-  }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  {
-    try {
-      (arg1)->read(arg2,arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_temp_storage_set" "', argument " "2"" of type '" "CvMemStorage *""'"); 
   }
+  arg2 = reinterpret_cast< CvMemStorage * >(argp2);
+  if (arg1) (arg1)->temp_storage = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -25915,105 +28317,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_write__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_temp_storage_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  char *arg3 = (char *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  CvMemStorage *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_write",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_temp_storage_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_write" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_write" "', argument " "3"" of type '" "char const *""'");
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
-  {
-    try {
-      (arg1)->write(arg2,(char const *)arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_temp_storage_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_Py_Void();
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvMemStorage *) ((arg1)->temp_storage);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMemStorage, 0 |  0 );
   return resultobj;
 fail:
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_data_root_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
-  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_data_root_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_read" "', argument " "1"" of type '" "CvDTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_data_root_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
-  }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
-  }
-  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
-  {
-    try {
-      (arg1)->read(arg2,arg3,arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTreeTrainData_data_root_set" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
   }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  if (arg1) (arg1)->data_root = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -26021,100 +28369,55 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_read(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[5];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_data_root_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvDTreeNode *result = 0 ;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvDTree_read__SWIG_0(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvDTree_read__SWIG_1(self, args);
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_data_root_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_data_root_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvDTreeNode *) ((arg1)->data_root);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_read'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    read(CvDTree *,CvFileStorage *,CvFileNode *)\n"
-    "    read(CvDTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_write__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_node_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvSet *arg2 = (CvSet *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  void *ptr2 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_write",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_node_heap_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_write" "', argument " "1"" of type '" "CvDTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_node_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      (arg1)->write(arg2); 
-    } 
-    catch (...) 
+    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
     {
-      SWIG_fail;
-    } 
+      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
+      return NULL;
+    }
+    arg2 = (CvSet *)ptr2;
   }
+  if (arg1) (arg1)->node_heap = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -26122,198 +28425,167 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_write(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[4];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_node_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvSet *result = 0 ;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_CvDTree_write__SWIG_1(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvDTree_write__SWIG_0(self, args);
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_node_heap_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_node_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvSet *) ((arg1)->node_heap);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_write'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    write(CvDTree *,CvFileStorage *,char const *)\n"
-    "    write(CvDTree *,CvFileStorage *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_get_root(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvDTreeNode *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvSet *arg2 = (CvSet *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *ptr2 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_root",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_split_heap_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_root" "', argument " "1"" of type '" "CvDTree const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      result = (CvDTreeNode *)((CvDTree const *)arg1)->get_root(); 
-    } 
-    catch (...) 
+    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
     {
-      SWIG_fail;
-    } 
+      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
+      return NULL;
+    }
+    arg2 = (CvSet *)ptr2;
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (arg1) (arg1)->split_heap = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_get_pruned_tree_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_split_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  int result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvSet *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_pruned_tree_idx",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_split_heap_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_pruned_tree_idx" "', argument " "1"" of type '" "CvDTree const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
-  {
-    try {
-      result = (int)((CvDTree const *)arg1)->get_pruned_tree_idx(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_split_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvSet *) ((arg1)->split_heap);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvDTree_get_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvDTree *arg1 = (CvDTree *) 0 ;
-  CvDTreeTrainData *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvSet *arg2 = (CvSet *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *ptr2 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_data",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_cv_heap_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_data" "', argument " "1"" of type '" "CvDTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      result = (CvDTreeTrainData *)(arg1)->get_data(); 
-    } 
-    catch (...) 
+    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
     {
-      SWIG_fail;
-    } 
+      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
+      return NULL;
+    }
+    arg2 = (CvSet *)ptr2;
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (arg1) (arg1)->cv_heap = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvDTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvDTree, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvForestTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_cv_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *result = 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvSet *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvForestTree")) SWIG_fail;
-  {
-    try {
-      result = (CvForestTree *)new CvForestTree(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_cv_heap_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_cv_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvForestTree, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvSet *) ((arg1)->cv_heap);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvForestTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_nv_heap_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvSet *arg2 = (CvSet *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *ptr2 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvForestTree",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_nv_heap_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvForestTree" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_nv_heap_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
+    if( SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSet, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvGraph, 0) == -1 &&
+      SWIG_ConvertPtr(obj1, &ptr2, SWIGTYPE_p_CvSubdiv2D, 0) == -1) 
     {
-      SWIG_fail;
-    } 
+      SWIG_exception (SWIG_TypeError, "could not convert to CvSet");
+      return NULL;
+    }
+    arg2 = (CvSet *)ptr2;
   }
+  if (arg1) (arg1)->nv_heap = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -26321,145 +28593,130 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_nv_heap_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvRTrees *arg4 = (CvRTrees *) 0 ;
-  bool result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  CvSet *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_nv_heap_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
-  }
-  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_nv_heap_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvRTrees, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvRTrees *""'"); 
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result = (CvSet *) ((arg1)->nv_heap);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSet, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_rng_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
+  CvRNG arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *vptr2 ;
+  CvRNG_Wrapper *wrapper2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTreeTrainData_rng_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_rng_set" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg4 = reinterpret_cast< CvRTrees * >(argp4);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
   {
-    try {
-      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3,arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(SWIG_ConvertPtr(obj1, &vptr2, SWIGTYPE_p_CvRNG_Wrapper, 0)==-1){
+      SWIG_exception( SWIG_TypeError, "could not convert Python object to C value");
+      return NULL;
+    }
+    wrapper2 = (CvRNG_Wrapper *) vptr2;
+    arg2 = wrapper2->ref();
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  if (arg1) (arg1)->rng = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_get_var_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTreeTrainData_rng_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  int result;
+  CvDTreeTrainData *arg1 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvRNG result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvForestTree_get_var_count",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTreeTrainData_rng_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_get_var_count" "', argument " "1"" of type '" "CvForestTree const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTreeTrainData_rng_get" "', argument " "1"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  arg1 = reinterpret_cast< CvDTreeTrainData * >(argp1);
+  result =  ((arg1)->rng);
+  {
+    CvRNG_Wrapper * wrapper = new CvRNG_Wrapper( result );
+    resultobj = SWIG_NewPointerObj( wrapper, SWIGTYPE_p_CvRNG_Wrapper, 1 );
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvDTreeTrainData_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvDTreeTrainData, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvDTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvDTree")) SWIG_fail;
   {
     try {
-      result = (int)((CvForestTree const *)arg1)->get_var_count(); 
+      result = (CvDTree *)new CvDTree(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTree, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvDTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
-  CvRTrees *arg4 = (CvRTrees *) 0 ;
-  CvDTreeTrainData *arg5 = (CvDTreeTrainData *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvForestTree_read",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvDTree",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
-  }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvRTrees, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_read" "', argument " "4"" of type '" "CvRTrees *""'"); 
-  }
-  arg4 = reinterpret_cast< CvRTrees * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_read" "', argument " "5"" of type '" "CvDTreeTrainData *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvDTree" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg5 = reinterpret_cast< CvDTreeTrainData * >(argp5);
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
   {
     try {
-      (arg1)->read(arg2,arg3,arg4,arg5); 
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -26473,9 +28730,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
@@ -26484,23 +28741,16 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(s
   CvMat *arg7 = (CvMat *) 0 ;
   CvMat *arg8 = (CvMat *) 0 ;
   CvDTreeParams arg9 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   void *argp9 ;
   int res9 = 0 ;
   PyObject * obj0 = 0 ;
@@ -26512,55 +28762,44 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(s
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
   PyObject * obj8 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvForestTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvForestTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvForestTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   {
     res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
     if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvForestTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvDTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
     }  
     if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvForestTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
     } else {
       CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp9);
       arg9 = *temp;
@@ -26577,15 +28816,87 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(s
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
@@ -26593,23 +28904,16 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(s
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
   CvMat *arg8 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -26618,48 +28922,37 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(s
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
   PyObject * obj7 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvForestTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvForestTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvForestTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
@@ -26670,36 +28963,102 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(s
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -26707,43 +29066,34 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(s
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvForestTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvForestTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
@@ -26754,71 +29104,119 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(s
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
-  return NULL;
-}
-
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvForestTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
@@ -26829,62 +29227,101 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(s
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -26895,19 +29332,224 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(s
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  CvDTreeParams arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_train" "', argument " "3"" of type '" "CvDTreeParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvDTree_train" "', argument " "3"" of type '" "CvDTreeParams""'");
+    } else {
+      CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_train",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_calc_error__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
+  vector< float > *arg4 = (vector< float > *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -26920,117 +29562,119 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(s
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_calc_error",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_calc_error" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_calc_error" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_vectorT_float_t, 0 |  0 );
   if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_calc_error" "', argument " "4"" of type '" "vector< float > *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
+  arg4 = reinterpret_cast< vector< float > * >(argp4);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+      result = (float)(arg1)->calc_error(arg2,arg3,arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_calc_error__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvForestTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_calc_error",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_calc_error" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
-  }
-  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvDTree_calc_error" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
   {
     try {
-      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
+      result = (float)(arg1)->calc_error(arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_calc_error(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[10];
+  PyObject *argv[5];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
         if (_v) {
-          return _wrap_CvForestTree_train__SWIG_7(self, args);
+          return _wrap_CvDTree_calc_error__SWIG_1(self, args);
         }
       }
     }
@@ -27038,11 +29682,11 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         {
@@ -27051,19 +29695,128 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
         }
         if (_v) {
           void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_vectorT_float_t, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvForestTree_train__SWIG_6(self, args);
+            return _wrap_CvDTree_calc_error__SWIG_0(self, args);
           }
         }
       }
     }
   }
-  if (argc == 4) {
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_calc_error'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    calc_error(CvDTree *,CvMLData *,int,vector< float > *)\n"
+    "    calc_error(CvDTree *,CvMLData *,int)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_train__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_train" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_train(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[10];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvDTree_train__SWIG_7(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvDTreeParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvDTree_train__SWIG_6(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27074,11 +29827,31 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
+          return _wrap_CvDTree_train__SWIG_8(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
           void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvRTrees, 0);
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvForestTree_train__SWIG_0(self, args);
+            return _wrap_CvDTree_train__SWIG_5(self, args);
           }
         }
       }
@@ -27087,7 +29860,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 5) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27107,7 +29880,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
             int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
             _v = SWIG_CheckState(res);
             if (_v) {
-              return _wrap_CvForestTree_train__SWIG_5(self, args);
+              return _wrap_CvDTree_train__SWIG_4(self, args);
             }
           }
         }
@@ -27117,7 +29890,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 6) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27141,7 +29914,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
               int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
               _v = SWIG_CheckState(res);
               if (_v) {
-                return _wrap_CvForestTree_train__SWIG_4(self, args);
+                return _wrap_CvDTree_train__SWIG_3(self, args);
               }
             }
           }
@@ -27152,7 +29925,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 7) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27180,7 +29953,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
                 int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
                 _v = SWIG_CheckState(res);
                 if (_v) {
-                  return _wrap_CvForestTree_train__SWIG_3(self, args);
+                  return _wrap_CvDTree_train__SWIG_2(self, args);
                 }
               }
             }
@@ -27192,7 +29965,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 8) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27224,7 +29997,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
                   int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
                   _v = SWIG_CheckState(res);
                   if (_v) {
-                    return _wrap_CvForestTree_train__SWIG_2(self, args);
+                    return _wrap_CvDTree_train__SWIG_1(self, args);
                   }
                 }
               }
@@ -27237,7 +30010,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   if (argc == 9) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -27272,7 +30045,7 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
                     int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
                     _v = SWIG_CheckState(res);
                     if (_v) {
-                      return _wrap_CvForestTree_train__SWIG_1(self, args);
+                      return _wrap_CvDTree_train__SWIG_0(self, args);
                     }
                   }
                 }
@@ -27285,200 +30058,273 @@ SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvForestTree_train'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_train'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    train(CvForestTree *,CvDTreeTrainData *,CvMat const *,CvRTrees *)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    train(CvForestTree *,CvMat const *,int,CvMat const *)\n"
-    "    train(CvForestTree *,CvDTreeTrainData *,CvMat const *)\n");
+    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
+    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvDTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvDTree *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvDTree *,CvMLData *,CvDTreeParams)\n"
+    "    train(CvDTree *,CvMLData *)\n"
+    "    train(CvDTree *,CvDTreeTrainData *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  bool arg4 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool val4 ;
+  int ecode4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  CvDTreeNode *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvForestTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_predict",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  ecode4 = SWIG_AsVal_bool(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvDTree_predict" "', argument " "4"" of type '" "bool""'");
+  } 
+  arg4 = static_cast< bool >(val4);
   {
     try {
-      (arg1)->read(arg2,arg3); 
+      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvForestTree *arg1 = (CvForestTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
-  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  CvDTreeNode *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_predict",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
   }
-  arg1 = reinterpret_cast< CvForestTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
+  {
+    try {
+      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_predict__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  CvDTreeNode *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_predict",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_predict" "', argument " "1"" of type '" "CvDTree const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
   {
     try {
-      (arg1)->read(arg2,arg3,arg4); 
+      result = (CvDTreeNode *)((CvDTree const *)arg1)->predict((CvMat const *)arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvForestTree_read(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_predict(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[6];
+  PyObject *argv[5];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  if (argc == 3) {
+  if (argc == 2) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvForestTree_read__SWIG_1(self, args);
-        }
+        return _wrap_CvDTree_predict__SWIG_2(self, args);
       }
     }
   }
-  if (argc == 4) {
+  if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvForestTree_read__SWIG_2(self, args);
-          }
+          return _wrap_CvDTree_predict__SWIG_1(self, args);
         }
       }
     }
   }
-  if (argc == 5) {
+  if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvRTrees, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+          {
+            int res = SWIG_AsVal_bool(argv[3], NULL);
             _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_CvForestTree_read__SWIG_0(self, args);
-            }
+          }
+          if (_v) {
+            return _wrap_CvDTree_predict__SWIG_0(self, args);
           }
         }
       }
@@ -27486,99 +30332,114 @@ SWIGINTERN PyObject *_wrap_CvForestTree_read(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvForestTree_read'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_predict'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    read(CvForestTree *,CvFileStorage *,CvFileNode *,CvRTrees *,CvDTreeTrainData *)\n"
-    "    read(CvForestTree *,CvFileStorage *,CvFileNode *)\n"
-    "    read(CvForestTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
+    "    predict(CvDTree const *,CvMat const *,CvMat const *,bool)\n"
+    "    predict(CvDTree const *,CvMat const *,CvMat const *)\n"
+    "    predict(CvDTree const *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvForestTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvForestTree, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_CvRTParams_calc_var_importance_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_get_var_importance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  bool arg2 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  bool val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_calc_var_importance_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_var_importance",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_calc_var_importance_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_var_importance" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  ecode2 = SWIG_AsVal_bool(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTParams_calc_var_importance_set" "', argument " "2"" of type '" "bool""'");
-  } 
-  arg2 = static_cast< bool >(val2);
-  if (arg1) (arg1)->calc_var_importance = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_var_importance(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTParams_calc_var_importance_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  bool result;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_calc_var_importance_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_calc_var_importance_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_clear" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  result = (bool) ((arg1)->calc_var_importance);
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    try {
+      (arg1)->clear(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTParams_nactive_vars_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  int arg2 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_nactive_vars_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_nactive_vars_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_read" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  {
+    try {
+      (arg1)->read(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTParams_nactive_vars_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->nactive_vars = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -27586,52 +30447,105 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTParams_nactive_vars_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_write__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  int result;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  char *arg3 = (char *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_nactive_vars_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvDTree_write",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_nactive_vars_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_write" "', argument " "1"" of type '" "CvDTree const *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  result = (int) ((arg1)->nactive_vars);
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_write" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = reinterpret_cast< char * >(buf3);
+  {
+    try {
+      ((CvDTree const *)arg1)->write(arg2,(char const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return resultobj;
 fail:
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTParams_term_crit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  CvTermCriteria *arg2 = (CvTermCriteria *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_term_crit_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvDTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_term_crit_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_read" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvTermCriteria, 0 |  0 );
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTParams_term_crit_set" "', argument " "2"" of type '" "CvTermCriteria *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvDTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvDTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
+  {
+    try {
+      (arg1)->read(arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
-  if (arg1) (arg1)->term_crit = *arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -27639,283 +30553,272 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
-  CvTermCriteria *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+SWIGINTERN PyObject *_wrap_CvDTree_read(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_term_crit_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_term_crit_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
-  result = (CvTermCriteria *)& ((arg1)->term_crit);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTermCriteria, 0 |  0 );
-  return resultobj;
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvDTree_read__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvDTree_read__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
 fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_read'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    read(CvDTree *,CvFileStorage *,CvFileNode *)\n"
+    "    read(CvDTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvRTParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_write__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *result = 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvRTParams")) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_write",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_write" "', argument " "1"" of type '" "CvDTree const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvDTree_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
   {
     try {
-      result = (CvRTParams *)new CvRTParams(); 
+      ((CvDTree const *)arg1)->write(arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTParams, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvRTParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  int arg1 ;
-  int arg2 ;
-  float arg3 ;
-  bool arg4 ;
-  int arg5 ;
-  float *arg6 = (float *) 0 ;
-  bool arg7 ;
-  int arg8 ;
-  int arg9 ;
-  float arg10 ;
-  int arg11 ;
-  CvRTParams *result = 0 ;
-  int val1 ;
-  int ecode1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  float val3 ;
-  int ecode3 = 0 ;
-  bool val4 ;
-  int ecode4 = 0 ;
-  int val5 ;
-  int ecode5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  bool val7 ;
-  int ecode7 = 0 ;
-  int val8 ;
-  int ecode8 = 0 ;
-  int val9 ;
-  int ecode9 = 0 ;
-  float val10 ;
-  int ecode10 = 0 ;
-  int val11 ;
-  int ecode11 = 0 ;
+SWIGINTERN PyObject *_wrap_CvDTree_write(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvDTree_write__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvDTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvDTree_write__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvDTree_write'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    write(CvDTree const *,CvFileStorage *,char const *)\n"
+    "    write(CvDTree const *,CvFileStorage *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_get_root(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
-  PyObject * obj9 = 0 ;
-  PyObject * obj10 = 0 ;
+  CvDTreeNode *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:new_CvRTParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvRTParams" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvRTParams" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_float(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvRTParams" "', argument " "3"" of type '" "float""'");
-  } 
-  arg3 = static_cast< float >(val3);
-  ecode4 = SWIG_AsVal_bool(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvRTParams" "', argument " "4"" of type '" "bool""'");
-  } 
-  arg4 = static_cast< bool >(val4);
-  ecode5 = SWIG_AsVal_int(obj4, &val5);
-  if (!SWIG_IsOK(ecode5)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_CvRTParams" "', argument " "5"" of type '" "int""'");
-  } 
-  arg5 = static_cast< int >(val5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvRTParams" "', argument " "6"" of type '" "float const *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_root",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_root" "', argument " "1"" of type '" "CvDTree const *""'"); 
   }
-  arg6 = reinterpret_cast< float * >(argp6);
-  ecode7 = SWIG_AsVal_bool(obj6, &val7);
-  if (!SWIG_IsOK(ecode7)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_CvRTParams" "', argument " "7"" of type '" "bool""'");
-  } 
-  arg7 = static_cast< bool >(val7);
-  ecode8 = SWIG_AsVal_int(obj7, &val8);
-  if (!SWIG_IsOK(ecode8)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_CvRTParams" "', argument " "8"" of type '" "int""'");
-  } 
-  arg8 = static_cast< int >(val8);
-  ecode9 = SWIG_AsVal_int(obj8, &val9);
-  if (!SWIG_IsOK(ecode9)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_CvRTParams" "', argument " "9"" of type '" "int""'");
-  } 
-  arg9 = static_cast< int >(val9);
-  ecode10 = SWIG_AsVal_float(obj9, &val10);
-  if (!SWIG_IsOK(ecode10)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_CvRTParams" "', argument " "10"" of type '" "float""'");
-  } 
-  arg10 = static_cast< float >(val10);
-  ecode11 = SWIG_AsVal_int(obj10, &val11);
-  if (!SWIG_IsOK(ecode11)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "new_CvRTParams" "', argument " "11"" of type '" "int""'");
-  } 
-  arg11 = static_cast< int >(val11);
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
   {
     try {
-      result = (CvRTParams *)new CvRTParams(arg1,arg2,arg3,arg4,arg5,(float const *)arg6,arg7,arg8,arg9,arg10,arg11); 
+      result = (CvDTreeNode *)((CvDTree const *)arg1)->get_root(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTParams, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvRTParams(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[12];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvDTree_get_pruned_tree_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 11); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 0) {
-    return _wrap_new_CvRTParams__SWIG_0(self, args);
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_pruned_tree_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_pruned_tree_idx" "', argument " "1"" of type '" "CvDTree const *""'"); 
   }
-  if (argc == 11) {
-    int _v;
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  {
+    try {
+      result = (int)((CvDTree const *)arg1)->get_pruned_tree_idx(); 
+    } 
+    catch (...) 
     {
-      int res = SWIG_AsVal_int(argv[0], NULL);
-      _v = SWIG_CheckState(res);
-    }
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_float(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_bool(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            {
-              int res = SWIG_AsVal_int(argv[4], NULL);
-              _v = SWIG_CheckState(res);
-            }
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                {
-                  int res = SWIG_AsVal_bool(argv[6], NULL);
-                  _v = SWIG_CheckState(res);
-                }
-                if (_v) {
-                  {
-                    int res = SWIG_AsVal_int(argv[7], NULL);
-                    _v = SWIG_CheckState(res);
-                  }
-                  if (_v) {
-                    {
-                      int res = SWIG_AsVal_int(argv[8], NULL);
-                      _v = SWIG_CheckState(res);
-                    }
-                    if (_v) {
-                      {
-                        int res = SWIG_AsVal_float(argv[9], NULL);
-                        _v = SWIG_CheckState(res);
-                      }
-                      if (_v) {
-                        {
-                          int res = SWIG_AsVal_int(argv[10], NULL);
-                          _v = SWIG_CheckState(res);
-                        }
-                        if (_v) {
-                          return _wrap_new_CvRTParams__SWIG_1(self, args);
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
+      SWIG_fail;
+    } 
   }
-  
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvRTParams'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    CvRTParams()\n"
-    "    CvRTParams(int,int,float,bool,int,float const *,bool,int,int,float,int)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvRTParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_get_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  CvDTree *arg1 = (CvDTree *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvDTreeTrainData *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvRTParams",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_get_data",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvRTParams" "', argument " "1"" of type '" "CvRTParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_get_data" "', argument " "1"" of type '" "CvDTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
   {
     try {
-      delete arg1;
+      result = (CvDTreeTrainData *)(arg1)->get_data(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvDTree_pruned_tree_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvDTree_pruned_tree_idx_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_pruned_tree_idx_set" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvDTree_pruned_tree_idx_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->pruned_tree_idx = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -27923,50 +30826,72 @@ fail:
 }
 
 
-SWIGINTERN PyObject *CvRTParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvDTree_pruned_tree_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvDTree *arg1 = (CvDTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvDTree_pruned_tree_idx_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvDTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvDTree_pruned_tree_idx_get" "', argument " "1"" of type '" "CvDTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvDTree * >(argp1);
+  result = (int) ((arg1)->pruned_tree_idx);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvDTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvRTParams, SWIG_NewClientData(obj));
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvDTree, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
-SWIGINTERN PyObject *_wrap_new_CvRTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvForestTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *result = 0 ;
+  CvForestTree *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvRTrees")) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)":new_CvForestTree")) SWIG_fail;
   {
     try {
-      result = (CvRTrees *)new CvRTrees(); 
+      result = (CvForestTree *)new CvForestTree(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTrees, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvForestTree, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvRTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvForestTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvRTrees",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvForestTree",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvRTrees" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvForestTree" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
   {
     try {
-      delete arg1;
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -27980,233 +30905,190 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  CvRTParams arg9 ;
-  bool result;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvRTrees *arg4 = (CvRTrees *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
+  bool freearg3 = false ;
   void *argp4 = 0 ;
   int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  void *argp9 ;
-  int res9 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvRTrees_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_train" "', argument " "4"" of type '" "CvRTrees *""'"); 
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvRTrees_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  arg4 = reinterpret_cast< CvRTrees * >(argp4);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvRTrees_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  return resultobj;
+fail:
   {
-    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvRTParams,  0  | 0);
-    if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvRTrees_train" "', argument " "9"" of type '" "CvRTParams""'"); 
-    }  
-    if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvRTrees_train" "', argument " "9"" of type '" "CvRTParams""'");
-    } else {
-      CvRTParams * temp = reinterpret_cast< CvRTParams * >(argp9);
-      arg9 = *temp;
-      if (SWIG_IsNewObj(res9)) delete temp;
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
     }
   }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvForestTree_get_var_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvForestTree_get_var_count",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_get_var_count" "', argument " "1"" of type '" "CvForestTree const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+      result = (int)((CvForestTree const *)arg1)->get_var_count(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  bool result;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvRTrees *arg4 = (CvRTrees *) 0 ;
+  CvDTreeTrainData *arg5 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
   void *argp4 = 0 ;
   int res4 = 0 ;
   void *argp5 = 0 ;
   int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvForestTree_read",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_read" "', argument " "4"" of type '" "CvRTrees *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg4 = reinterpret_cast< CvRTrees * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
   if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvRTrees_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvRTrees_train" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvRTrees_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvForestTree_read" "', argument " "5"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  arg5 = reinterpret_cast< CvDTreeTrainData * >(argp5);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+      (arg1)->read(arg2,arg3,arg4,arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
   CvMat *arg7 = (CvMat *) 0 ;
-  bool result;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams arg9 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -28214,46 +31096,55 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvRTrees_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvRTrees_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvForestTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvForestTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
+    } else {
+      CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
     } 
     catch (...) 
     {
@@ -28261,74 +31152,287 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
   CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
   bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvRTrees_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
     } 
     catch (...) 
     {
@@ -28336,62 +31440,224 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
   bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
@@ -28402,53 +31668,83 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvForestTree_train" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
       result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
@@ -28459,13 +31755,94 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self)
     } 
   }
   resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvForestTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_train" "', argument " "1"" of type '" "CvForestTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvForestTree_train(PyObject *self, PyObject *args) {
   int argc;
   PyObject *argv[10];
   int ii;
@@ -28475,10 +31852,29 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   for (ii = 0; (ii < argc) && (ii < 9); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvForestTree_train__SWIG_7(self, args);
+        }
+      }
+    }
+  }
   if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28494,7 +31890,31 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvRTrees_train__SWIG_5(self, args);
+            return _wrap_CvForestTree_train__SWIG_6(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvRTrees, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvForestTree_train__SWIG_0(self, args);
           }
         }
       }
@@ -28503,7 +31923,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   if (argc == 5) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28523,7 +31943,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
             int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
             _v = SWIG_CheckState(res);
             if (_v) {
-              return _wrap_CvRTrees_train__SWIG_4(self, args);
+              return _wrap_CvForestTree_train__SWIG_5(self, args);
             }
           }
         }
@@ -28533,7 +31953,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   if (argc == 6) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28557,7 +31977,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
               int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
               _v = SWIG_CheckState(res);
               if (_v) {
-                return _wrap_CvRTrees_train__SWIG_3(self, args);
+                return _wrap_CvForestTree_train__SWIG_4(self, args);
               }
             }
           }
@@ -28568,7 +31988,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   if (argc == 7) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28596,7 +32016,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
                 int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
                 _v = SWIG_CheckState(res);
                 if (_v) {
-                  return _wrap_CvRTrees_train__SWIG_2(self, args);
+                  return _wrap_CvForestTree_train__SWIG_3(self, args);
                 }
               }
             }
@@ -28608,7 +32028,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   if (argc == 8) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28640,7 +32060,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
                   int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
                   _v = SWIG_CheckState(res);
                   if (_v) {
-                    return _wrap_CvRTrees_train__SWIG_1(self, args);
+                    return _wrap_CvForestTree_train__SWIG_2(self, args);
                   }
                 }
               }
@@ -28653,7 +32073,7 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   if (argc == 9) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -28685,10 +32105,10 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
                   int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
                   _v = SWIG_CheckState(res);
                   if (_v) {
-                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvRTParams, 0);
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
                     _v = SWIG_CheckState(res);
                     if (_v) {
-                      return _wrap_CvRTrees_train__SWIG_0(self, args);
+                      return _wrap_CvForestTree_train__SWIG_1(self, args);
                     }
                   }
                 }
@@ -28701,24 +32121,25 @@ SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_train'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvForestTree_train'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvRTParams)\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    train(CvRTrees *,CvMat const *,int,CvMat const *)\n");
+    "    train(CvForestTree *,CvDTreeTrainData *,CvMat const *,CvRTrees *)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvForestTree *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvForestTree *,CvDTreeTrainData *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  float result;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -28729,152 +32150,217 @@ SWIGINTERN PyObject *_wrap_CvRTrees_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(sel
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_predict",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvForestTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
   if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
   {
     try {
-      result = (float)((CvRTrees const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
+      (arg1)->read(arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_read__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  float result;
+  CvForestTree *arg1 = (CvForestTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_predict",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvForestTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestTree, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvForestTree_read" "', argument " "1"" of type '" "CvForestTree *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvForestTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvForestTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvForestTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvForestTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
+  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
   {
     try {
-      result = (float)((CvRTrees const *)arg1)->predict((CvMat const *)arg2); 
+      (arg1)->read(arg2,arg3,arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_predict(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvForestTree_read(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[4];
+  PyObject *argv[6];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  if (argc == 2) {
+  if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        return _wrap_CvRTrees_predict__SWIG_1(self, args);
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvForestTree_read__SWIG_1(self, args);
+        }
       }
     }
   }
-  if (argc == 3) {
+  if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
-          return _wrap_CvRTrees_predict__SWIG_0(self, args);
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvForestTree_read__SWIG_2(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvForestTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvRTrees, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvForestTree_read__SWIG_0(self, args);
+            }
+          }
         }
       }
     }
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_predict'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvForestTree_read'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    predict(CvRTrees const *,CvMat const *,CvMat const *)\n"
-    "    predict(CvRTrees const *,CvMat const *)\n");
+    "    read(CvForestTree *,CvFileStorage *,CvFileNode *,CvRTrees *,CvDTreeTrainData *)\n"
+    "    read(CvForestTree *,CvFileStorage *,CvFileNode *)\n"
+    "    read(CvForestTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *CvForestTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvForestTree, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_CvRTParams_calc_var_importance_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_clear",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_calc_var_importance_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_clear" "', argument " "1"" of type '" "CvRTrees *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  {
-    try {
-      (arg1)->clear(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_calc_var_importance_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTParams_calc_var_importance_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->calc_var_importance = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -28882,283 +32368,349 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_var_importance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTParams_calc_var_importance_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *result = 0 ;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_var_importance",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_calc_var_importance_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_var_importance" "', argument " "1"" of type '" "CvRTrees *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  {
-    try {
-      result = (CvMat *)(arg1)->get_var_importance(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_calc_var_importance_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  result = (bool) ((arg1)->calc_var_importance);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTParams_nactive_vars_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  float result;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_nactive_vars_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_get_proximity" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_get_proximity" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_get_proximity" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvRTrees_get_proximity" "', argument " "5"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_nactive_vars_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  {
-    try {
-      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTParams_nactive_vars_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->nactive_vars = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTParams_nactive_vars_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_nactive_vars_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_nactive_vars_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  result = (int) ((arg1)->nactive_vars);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTParams_term_crit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  float result;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  CvTermCriteria *arg2 = (CvTermCriteria *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTParams_term_crit_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_term_crit_set" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvTermCriteria, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_get_proximity" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_get_proximity" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTParams_term_crit_set" "', argument " "2"" of type '" "CvTermCriteria *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_get_proximity" "', argument " "4"" of type '" "CvMat const *""'"); 
+  arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
+  if (arg1) (arg1)->term_crit = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvTermCriteria *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTParams_term_crit_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTParams_term_crit_get" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
+  result = (CvTermCriteria *)& ((arg1)->term_crit);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTermCriteria, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvRTParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvRTParams")) SWIG_fail;
   {
     try {
-      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
+      result = (CvRTParams *)new CvRTParams(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTParams, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvRTParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  float result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  int arg1 ;
+  int arg2 ;
+  float arg3 ;
+  bool arg4 ;
+  int arg5 ;
+  float *arg6 = (float *) 0 ;
+  bool arg7 ;
+  int arg8 ;
+  int arg9 ;
+  float arg10 ;
+  int arg11 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  float val3 ;
+  int ecode3 = 0 ;
+  bool val4 ;
+  int ecode4 = 0 ;
+  int val5 ;
+  int ecode5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  bool val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  float val10 ;
+  int ecode10 = 0 ;
+  int val11 ;
+  int ecode11 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  PyObject * obj10 = 0 ;
+  CvRTParams *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_get_proximity" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_get_proximity" "', argument " "3"" of type '" "CvMat const *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:new_CvRTParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvRTParams" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvRTParams" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_float(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvRTParams" "', argument " "3"" of type '" "float""'");
+  } 
+  arg3 = static_cast< float >(val3);
+  ecode4 = SWIG_AsVal_bool(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvRTParams" "', argument " "4"" of type '" "bool""'");
+  } 
+  arg4 = static_cast< bool >(val4);
+  ecode5 = SWIG_AsVal_int(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_CvRTParams" "', argument " "5"" of type '" "int""'");
+  } 
+  arg5 = static_cast< int >(val5);
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvRTParams" "', argument " "6"" of type '" "float const *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  arg6 = reinterpret_cast< float * >(argp6);
+  ecode7 = SWIG_AsVal_bool(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_CvRTParams" "', argument " "7"" of type '" "bool""'");
+  } 
+  arg7 = static_cast< bool >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_CvRTParams" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_CvRTParams" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  ecode10 = SWIG_AsVal_float(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_CvRTParams" "', argument " "10"" of type '" "float""'");
+  } 
+  arg10 = static_cast< float >(val10);
+  ecode11 = SWIG_AsVal_int(obj10, &val11);
+  if (!SWIG_IsOK(ecode11)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "new_CvRTParams" "', argument " "11"" of type '" "int""'");
+  } 
+  arg11 = static_cast< int >(val11);
   {
     try {
-      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3); 
+      result = (CvRTParams *)new CvRTParams(arg1,arg2,arg3,arg4,arg5,(float const *)arg6,arg7,arg8,arg9,arg10,arg11); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTParams, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvRTParams(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[6];
+  PyObject *argv[12];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 11); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  if (argc == 3) {
+  if (argc == 0) {
+    return _wrap_new_CvRTParams__SWIG_0(self, args);
+  }
+  if (argc == 11) {
     int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
       _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
         _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvRTrees_get_proximity__SWIG_2(self, args);
-        }
       }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
       if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+        {
+          int res = SWIG_AsVal_float(argv[2], NULL);
           _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvRTrees_get_proximity__SWIG_1(self, args);
-          }
         }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+          {
+            int res = SWIG_AsVal_bool(argv[3], NULL);
             _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            {
+              int res = SWIG_AsVal_int(argv[4], NULL);
+              _v = SWIG_CheckState(res);
+            }
             if (_v) {
-              return _wrap_CvRTrees_get_proximity__SWIG_0(self, args);
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_bool(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      {
+                        int res = SWIG_AsVal_float(argv[9], NULL);
+                        _v = SWIG_CheckState(res);
+                      }
+                      if (_v) {
+                        {
+                          int res = SWIG_AsVal_int(argv[10], NULL);
+                          _v = SWIG_CheckState(res);
+                        }
+                        if (_v) {
+                          return _wrap_new_CvRTParams__SWIG_1(self, args);
+                        }
+                      }
+                    }
+                  }
+                }
+              }
             }
           }
         }
@@ -29167,49 +32719,30 @@ SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity(PyObject *self, PyObject *args
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_get_proximity'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvRTParams'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *)\n");
+    "    CvRTParams()\n"
+    "    CvRTParams(int,int,float,bool,int,float const *,bool,int,int,float,int)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvRTParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvRTParams *arg1 = (CvRTParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvRTParams",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTParams, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_read" "', argument " "1"" of type '" "CvRTrees *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvRTParams" "', argument " "1"" of type '" "CvRTParams *""'"); 
   }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  arg1 = reinterpret_cast< CvRTParams * >(argp1);
   {
     try {
-      (arg1)->read(arg2,arg3); 
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -29223,695 +32756,825 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *CvRTParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvRTParams, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvRTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  char *arg3 = (char *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  CvRTrees *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_write",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_write" "', argument " "1"" of type '" "CvRTrees *""'"); 
-  }
-  arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_write" "', argument " "3"" of type '" "char const *""'");
-  }
-  arg3 = reinterpret_cast< char * >(buf3);
+  if (!PyArg_ParseTuple(args,(char *)":new_CvRTrees")) SWIG_fail;
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      result = (CvRTrees *)new CvRTrees(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRTrees, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_active_var_mask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvRTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvMat *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_active_var_mask",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvRTrees",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_active_var_mask" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvRTrees" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
   arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
     try {
-      result = (CvMat *)(arg1)->get_active_var_mask(); 
+      delete arg1; 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_rng(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRTrees *arg1 = (CvRTrees *) 0 ;
-  CvRNG *result = 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvRTParams arg9 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_rng",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_rng" "', argument " "1"" of type '" "CvRTrees *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
   arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvRTParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvRTrees_train" "', argument " "9"" of type '" "CvRTParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvRTrees_train" "', argument " "9"" of type '" "CvRTParams""'");
+    } else {
+      CvRTParams * temp = reinterpret_cast< CvRTParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
+  }
+  {
     try {
-      result = (CvRNG *)(arg1)->get_rng(); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   {
-    CvRNG_Wrapper * wrapper = new CvRNG_Wrapper( *(result) );
-    resultobj = SWIG_NewPointerObj( wrapper, SWIGTYPE_p_CvRNG_Wrapper, 1 );
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
   }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_tree_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRTrees *arg1 = (CvRTrees *) 0 ;
-  int result;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_tree_count",&obj0)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_tree_count" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
   arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
     try {
-      result = (int)((CvRTrees const *)arg1)->get_tree_count(); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvRTrees_get_tree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvRTrees *arg1 = (CvRTrees *) 0 ;
-  int arg2 ;
-  CvForestTree *result = 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_get_tree",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_tree" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
   arg1 = reinterpret_cast< CvRTrees * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTrees_get_tree" "', argument " "2"" of type '" "int""'");
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
   } 
-  arg2 = static_cast< int >(val2);
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
   {
     try {
-      result = (CvForestTree *)((CvRTrees const *)arg1)->get_tree(arg2); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvForestTree, 0 |  0 );
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvRTrees_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvRTrees, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_boost_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int arg2 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_boost_type_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_boost_type_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_boost_type_set" "', argument " "2"" of type '" "int""'");
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
   } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->boost_type = arg2;
-  
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_boost_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_boost_type_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_boost_type_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  result = (int) ((arg1)->boost_type);
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_weak_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_weak_count_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weak_count_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_weak_count_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->weak_count = arg2;
-  
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_weak_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_weak_count_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weak_count_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  result = (int) ((arg1)->weak_count);
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_split_criteria_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_split_criteria_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_split_criteria_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_split_criteria_set" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->split_criteria = arg2;
-  
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_split_criteria_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_split_criteria_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_split_criteria_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  result = (int) ((arg1)->split_criteria);
-  resultobj = SWIG_From_int(static_cast< int >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_weight_trim_rate_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  double arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_weight_trim_rate_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weight_trim_rate_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_weight_trim_rate_set" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->weight_trim_rate = arg2;
-  
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoostParams_weight_trim_rate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_weight_trim_rate_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weight_trim_rate_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
   }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
-  result = (double) ((arg1)->weight_trim_rate);
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvBoostParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostParams *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)":new_CvBoostParams")) SWIG_fail;
   {
     try {
-      result = (CvBoostParams *)new CvBoostParams(); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoostParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  int arg1 ;
-  int arg2 ;
-  double arg3 ;
-  int arg4 ;
-  bool arg5 ;
-  float *arg6 = (float *) 0 ;
-  CvBoostParams *result = 0 ;
-  int val1 ;
-  int ecode1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
   int ecode3 = 0 ;
-  int val4 ;
-  int ecode4 = 0 ;
-  bool val5 ;
-  int ecode5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvBoostParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvBoostParams" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoostParams" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvBoostParams" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  ecode4 = SWIG_AsVal_int(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvBoostParams" "', argument " "4"" of type '" "int""'");
-  } 
-  arg4 = static_cast< int >(val4);
-  ecode5 = SWIG_AsVal_bool(obj4, &val5);
-  if (!SWIG_IsOK(ecode5)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_CvBoostParams" "', argument " "5"" of type '" "bool""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
   } 
-  arg5 = static_cast< bool >(val5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvBoostParams" "', argument " "6"" of type '" "float const *""'"); 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg6 = reinterpret_cast< float * >(argp6);
   {
     try {
-      result = (CvBoostParams *)new CvBoostParams(arg1,arg2,arg3,arg4,arg5,(float const *)arg6); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvBoostParams(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[7];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 0) {
-    return _wrap_new_CvBoostParams__SWIG_0(self, args);
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  if (argc == 6) {
-    int _v;
-    {
-      int res = SWIG_AsVal_int(argv[0], NULL);
-      _v = SWIG_CheckState(res);
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
     }
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_double(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_int(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            {
-              int res = SWIG_AsVal_bool(argv[4], NULL);
-              _v = SWIG_CheckState(res);
-            }
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_new_CvBoostParams__SWIG_1(self, args);
-              }
-            }
-          }
-        }
-      }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
     }
   }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvBoostParams'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    CvBoostParams()\n"
-    "    CvBoostParams(int,int,double,int,bool,float const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvBoostParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoostParams",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvRTrees_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoostParams" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *CvBoostParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoostParams, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvBoostTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostTree *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)":new_CvBoostTree")) SWIG_fail;
   {
     try {
-      result = (CvBoostTree *)new CvBoostTree(); 
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostTree, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_delete_CvBoostTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoostTree",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoostTree" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
   {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
   }
-  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvBoost *arg4 = (CvBoost *) 0 ;
-  bool result;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  CvRTParams arg3 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
-  void *argp3 = 0 ;
+  void *argp3 ;
   int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
-  }
-  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMLData *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvBoost *""'"); 
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvRTParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_train" "', argument " "3"" of type '" "CvRTParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvRTrees_train" "', argument " "3"" of type '" "CvRTParams""'");
+    } else {
+      CvRTParams * temp = reinterpret_cast< CvRTParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
   }
-  arg4 = reinterpret_cast< CvBoost * >(argp4);
   {
     try {
-      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3,arg4); 
+      result = (bool)(arg1)->train(arg2,arg3); 
     } 
     catch (...) 
     {
@@ -29925,696 +33588,997 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  double arg2 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostTree_scale",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_train",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_scale" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_train" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostTree_scale" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
   {
     try {
-      (arg1)->scale(arg2); 
+      result = (bool)(arg1)->train(arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
-  CvBoost *arg4 = (CvBoost *) 0 ;
-  CvDTreeTrainData *arg5 = (CvDTreeTrainData *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
+SWIGINTERN PyObject *_wrap_CvRTrees_train(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[10];
+  int ii;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoostTree_read",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvRTrees_train__SWIG_7(self, args);
+      }
+    }
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvRTParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvRTrees_train__SWIG_6(self, args);
+        }
+      }
+    }
   }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_read" "', argument " "4"" of type '" "CvBoost *""'"); 
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvRTrees_train__SWIG_5(self, args);
+          }
+        }
+      }
+    }
   }
-  arg4 = reinterpret_cast< CvBoost * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_read" "', argument " "5"" of type '" "CvDTreeTrainData *""'"); 
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvRTrees_train__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvRTrees_train__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_CvRTrees_train__SWIG_2(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_CvRTrees_train__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvRTParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      return _wrap_CvRTrees_train__SWIG_0(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_train'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvRTParams)\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvRTrees *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvRTrees *,CvMLData *,CvRTParams)\n"
+    "    train(CvRTrees *,CvMLData *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_predict",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg5 = reinterpret_cast< CvDTreeTrainData * >(argp5);
   {
     try {
-      (arg1)->read(arg2,arg3,arg4,arg5); 
+      result = (float)((CvRTrees const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostTree_clear",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_predict",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_clear" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
   {
     try {
-      (arg1)->clear(); 
+      result = (float)((CvRTrees const *)arg1)->predict((CvMat const *)arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_predict(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvRTrees_predict__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvRTrees_predict__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_predict'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    predict(CvRTrees const *,CvMat const *,CvMat const *)\n"
+    "    predict(CvRTrees const *,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_predict_prob__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  CvDTreeParams arg9 ;
-  bool result;
+  CvMat *arg3 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  void *argp9 ;
-  int res9 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_predict_prob",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoostTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoostTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict_prob" "', argument " "1"" of type '" "CvRTrees const *""'"); 
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvBoostTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   {
-    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
-    if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoostTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
-    }  
-    if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoostTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
-    } else {
-      CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp9);
-      arg9 = *temp;
-      if (SWIG_IsNewObj(res9)) delete temp;
-    }
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+      result = (float)((CvRTrees const *)arg1)->predict_prob((CvMat const *)arg2,(CvMat const *)arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_predict_prob__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_predict_prob",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoostTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoostTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_predict_prob" "', argument " "1"" of type '" "CvRTrees const *""'"); 
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvBoostTree_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+      result = (float)((CvRTrees const *)arg1)->predict_prob((CvMat const *)arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_predict_prob(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvRTrees_predict_prob__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvRTrees_predict_prob__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_predict_prob'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    predict_prob(CvRTrees const *,CvMat const *,CvMat const *)\n"
+    "    predict_prob(CvRTrees const *,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  bool result;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoostTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoostTree_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_clear" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+      (arg1)->clear(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_get_var_importance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  bool result;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_var_importance",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoostTree_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_var_importance" "', argument " "1"" of type '" "CvRTrees *""'"); 
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+      result = (CvMat *)(arg1)->get_var_importance(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
+  CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
   CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
+  CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoostTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_get_proximity",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_proximity" "', argument " "1"" of type '" "CvRTrees const *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
-      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
+      result = (float)((CvRTrees const *)arg1)->get_proximity((CvMat const *)arg2,(CvMat const *)arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvRTrees_get_proximity(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[10];
+  PyObject *argv[6];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         void *vptr = 0;
         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
-          return _wrap_CvBoostTree_train__SWIG_7(self, args);
+          return _wrap_CvRTrees_get_proximity__SWIG_2(self, args);
         }
       }
     }
@@ -30622,36 +34586,35 @@ SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
   if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
         if (_v) {
           void *vptr = 0;
           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvBoostTree_train__SWIG_6(self, args);
+            return _wrap_CvRTrees_get_proximity__SWIG_1(self, args);
           }
         }
       }
     }
   }
-  if (argc == 4) {
+  if (argc == 5) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         void *vptr = 0;
@@ -30659,23 +34622,154 @@ SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
         _v = SWIG_CheckState(res);
         if (_v) {
           void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvBoost, 0);
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvBoostTree_train__SWIG_0(self, args);
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvRTrees_get_proximity__SWIG_0(self, args);
+            }
           }
         }
       }
     }
   }
-  if (argc == 5) {
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_get_proximity'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    get_proximity(CvRTrees const *,CvMat const *,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_calc_error__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
+  vector< float > *arg4 = (vector< float > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvRTrees_calc_error",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_calc_error" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_calc_error" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_vectorT_float_t, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvRTrees_calc_error" "', argument " "4"" of type '" "vector< float > *""'"); 
+  }
+  arg4 = reinterpret_cast< vector< float > * >(argp4);
+  {
+    try {
+      result = (float)(arg1)->calc_error(arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_calc_error__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_calc_error",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_calc_error" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvRTrees_calc_error" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    try {
+      result = (float)(arg1)->calc_error(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_calc_error(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         {
@@ -30683,185 +34777,9728 @@ SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
+          return _wrap_CvRTrees_calc_error__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvRTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_vectorT_float_t, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvRTrees_calc_error__SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvRTrees_calc_error'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    calc_error(CvRTrees *,CvMLData *,int,vector< float > *)\n"
+    "    calc_error(CvRTrees *,CvMLData *,int)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_get_train_error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_train_error",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_train_error" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    try {
+      result = (float)(arg1)->get_train_error(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_read" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  {
+    try {
+      (arg1)->read(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  char *arg3 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvRTrees_write",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_write" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRTrees_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvRTrees_write" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = reinterpret_cast< char * >(buf3);
+  {
+    try {
+      ((CvRTrees const *)arg1)->write(arg2,(char const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_get_active_var_mask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_active_var_mask",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_active_var_mask" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_active_var_mask(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_get_rng(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvRNG *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_rng",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_rng" "', argument " "1"" of type '" "CvRTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    try {
+      result = (CvRNG *)(arg1)->get_rng(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  {
+    CvRNG_Wrapper * wrapper = new CvRNG_Wrapper( *(result) );
+    resultobj = SWIG_NewPointerObj( wrapper, SWIGTYPE_p_CvRNG_Wrapper, 1 );
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_get_tree_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvRTrees_get_tree_count",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_tree_count" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  {
+    try {
+      result = (int)((CvRTrees const *)arg1)->get_tree_count(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvRTrees_get_tree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvRTrees *arg1 = (CvRTrees *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  CvForestTree *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvRTrees_get_tree",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRTrees_get_tree" "', argument " "1"" of type '" "CvRTrees const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvRTrees * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvRTrees_get_tree" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    try {
+      result = (CvForestTree *)((CvRTrees const *)arg1)->get_tree(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvForestTree, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvRTrees_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvRTrees, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams *arg9 = 0 ;
+  bool arg10 ;
+  bool arg11 ;
+  bool arg12 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  bool val10 ;
+  int ecode10 = 0 ;
+  bool val11 ;
+  int ecode11 = 0 ;
+  bool val12 ;
+  int ecode12 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  PyObject * obj10 = 0 ;
+  PyObject * obj11 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  if (!argp9) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  arg9 = reinterpret_cast< CvDTreeParams * >(argp9);
+  ecode10 = SWIG_AsVal_bool(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "CvERTreeTrainData_set_data" "', argument " "10"" of type '" "bool""'");
+  } 
+  arg10 = static_cast< bool >(val10);
+  ecode11 = SWIG_AsVal_bool(obj10, &val11);
+  if (!SWIG_IsOK(ecode11)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "CvERTreeTrainData_set_data" "', argument " "11"" of type '" "bool""'");
+  } 
+  arg11 = static_cast< bool >(val11);
+  ecode12 = SWIG_AsVal_bool(obj11, &val12);
+  if (!SWIG_IsOK(ecode12)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "CvERTreeTrainData_set_data" "', argument " "12"" of type '" "bool""'");
+  } 
+  arg12 = static_cast< bool >(val12);
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,(CvDTreeParams const &)*arg9,arg10,arg11,arg12); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams *arg9 = 0 ;
+  bool arg10 ;
+  bool arg11 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  bool val10 ;
+  int ecode10 = 0 ;
+  bool val11 ;
+  int ecode11 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  PyObject * obj10 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  if (!argp9) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  arg9 = reinterpret_cast< CvDTreeParams * >(argp9);
+  ecode10 = SWIG_AsVal_bool(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "CvERTreeTrainData_set_data" "', argument " "10"" of type '" "bool""'");
+  } 
+  arg10 = static_cast< bool >(val10);
+  ecode11 = SWIG_AsVal_bool(obj10, &val11);
+  if (!SWIG_IsOK(ecode11)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "CvERTreeTrainData_set_data" "', argument " "11"" of type '" "bool""'");
+  } 
+  arg11 = static_cast< bool >(val11);
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,(CvDTreeParams const &)*arg9,arg10,arg11); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams *arg9 = 0 ;
+  bool arg10 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  bool val10 ;
+  int ecode10 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  if (!argp9) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  arg9 = reinterpret_cast< CvDTreeParams * >(argp9);
+  ecode10 = SWIG_AsVal_bool(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "CvERTreeTrainData_set_data" "', argument " "10"" of type '" "bool""'");
+  } 
+  arg10 = static_cast< bool >(val10);
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,(CvDTreeParams const &)*arg9,arg10); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams *arg9 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  if (!argp9) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTreeTrainData_set_data" "', argument " "9"" of type '" "CvDTreeParams const &""'"); 
+  }
+  arg9 = reinterpret_cast< CvDTreeParams * >(argp9);
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,(CvDTreeParams const &)*arg9); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvERTreeTrainData_set_data",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_set_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_set_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      (arg1)->set_data((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_set_data(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[13];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 12); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvERTreeTrainData_set_data__SWIG_8(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvERTreeTrainData_set_data__SWIG_7(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvERTreeTrainData_set_data__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_CvERTreeTrainData_set_data__SWIG_5(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_CvERTreeTrainData_set_data__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      return _wrap_CvERTreeTrainData_set_data__SWIG_3(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 10) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      {
+                        int res = SWIG_AsVal_bool(argv[9], NULL);
+                        _v = SWIG_CheckState(res);
+                      }
+                      if (_v) {
+                        return _wrap_CvERTreeTrainData_set_data__SWIG_2(self, args);
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 11) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      {
+                        int res = SWIG_AsVal_bool(argv[9], NULL);
+                        _v = SWIG_CheckState(res);
+                      }
+                      if (_v) {
+                        {
+                          int res = SWIG_AsVal_bool(argv[10], NULL);
+                          _v = SWIG_CheckState(res);
+                        }
+                        if (_v) {
+                          return _wrap_CvERTreeTrainData_set_data__SWIG_1(self, args);
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 12) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      {
+                        int res = SWIG_AsVal_bool(argv[9], NULL);
+                        _v = SWIG_CheckState(res);
+                      }
+                      if (_v) {
+                        {
+                          int res = SWIG_AsVal_bool(argv[10], NULL);
+                          _v = SWIG_CheckState(res);
+                        }
+                        if (_v) {
+                          {
+                            int res = SWIG_AsVal_bool(argv[11], NULL);
+                            _v = SWIG_CheckState(res);
+                          }
+                          if (_v) {
+                            return _wrap_CvERTreeTrainData_set_data__SWIG_0(self, args);
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvERTreeTrainData_set_data'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams const &,bool,bool,bool)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams const &,bool,bool)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams const &,bool)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams const &)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    set_data(CvERTreeTrainData *,CvMat const *,int,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_ord_var_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  int arg3 ;
+  float *arg4 = (float *) 0 ;
+  int *arg5 = (int *) 0 ;
+  float **arg6 = (float **) 0 ;
+  int **arg7 = (int **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *vptr6 ;
+  float *buffer6 ;
+  void *argp7 = 0 ;
+  int res7 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvERTreeTrainData_get_ord_var_data",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "4"" of type '" "float *""'"); 
+  }
+  arg4 = reinterpret_cast< float * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = reinterpret_cast< int * >(argp5);
+  {
+    if ((SWIG_ConvertPtr(obj5, &vptr6, SWIGTYPE_p_float, 1)) == -1){
+      SWIG_fail;
+    }
+    buffer6 = (float *) vptr6;
+    arg6=&buffer6;
+  }
+  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res7)) {
+    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvERTreeTrainData_get_ord_var_data" "', argument " "7"" of type '" "int const **""'"); 
+  }
+  arg7 = reinterpret_cast< int ** >(argp7);
+  {
+    try {
+      result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(int const **)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_sample_indices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int **arg4 = (int **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvERTreeTrainData_get_sample_indices",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_sample_indices" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTreeTrainData_get_sample_indices" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvERTreeTrainData_get_sample_indices" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = reinterpret_cast< int * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_sample_indices" "', argument " "4"" of type '" "int const **""'"); 
+  }
+  arg4 = reinterpret_cast< int ** >(argp4);
+  {
+    try {
+      (arg1)->get_sample_indices(arg2,arg3,(int const **)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_cv_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int **arg4 = (int **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvERTreeTrainData_get_cv_labels",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_cv_labels" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTreeTrainData_get_cv_labels" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvERTreeTrainData_get_cv_labels" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = reinterpret_cast< int * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_cv_labels" "', argument " "4"" of type '" "int const **""'"); 
+  }
+  arg4 = reinterpret_cast< int ** >(argp4);
+  {
+    try {
+      (arg1)->get_cv_labels(arg2,arg3,(int const **)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_cat_var_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvDTreeNode *arg2 = (CvDTreeNode *) 0 ;
+  int arg3 ;
+  int *arg4 = (int *) 0 ;
+  int **arg5 = (int **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvERTreeTrainData_get_cat_var_data",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_cat_var_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTreeTrainData_get_cat_var_data" "', argument " "2"" of type '" "CvDTreeNode *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeNode * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTreeTrainData_get_cat_var_data" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_cat_var_data" "', argument " "4"" of type '" "int *""'"); 
+  }
+  arg4 = reinterpret_cast< int * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvERTreeTrainData_get_cat_var_data" "', argument " "5"" of type '" "int const **""'"); 
+  }
+  arg5 = reinterpret_cast< int ** >(argp5);
+  {
+    try {
+      result = (int)(arg1)->get_cat_var_data(arg2,arg3,arg4,(int const **)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_vectors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  float *arg3 = (float *) 0 ;
+  uchar *arg4 = (uchar *) 0 ;
+  float *arg5 = (float *) 0 ;
+  bool arg6 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  bool val6 ;
+  int ecode6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvERTreeTrainData_get_vectors",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "4"" of type '" "uchar *""'"); 
+  }
+  arg4 = reinterpret_cast< uchar * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "5"" of type '" "float *""'"); 
+  }
+  arg5 = reinterpret_cast< float * >(argp5);
+  ecode6 = SWIG_AsVal_bool(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "6"" of type '" "bool""'");
+  } 
+  arg6 = static_cast< bool >(val6);
+  {
+    try {
+      (arg1)->get_vectors((CvMat const *)arg2,arg3,arg4,arg5,arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_vectors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  float *arg3 = (float *) 0 ;
+  uchar *arg4 = (uchar *) 0 ;
+  float *arg5 = (float *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvERTreeTrainData_get_vectors",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "4"" of type '" "uchar *""'"); 
+  }
+  arg4 = reinterpret_cast< uchar * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvERTreeTrainData_get_vectors" "', argument " "5"" of type '" "float *""'"); 
+  }
+  arg5 = reinterpret_cast< float * >(argp5);
+  {
+    try {
+      (arg1)->get_vectors((CvMat const *)arg2,arg3,arg4,arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_get_vectors(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvERTreeTrainData_get_vectors__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTreeTrainData, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              {
+                int res = SWIG_AsVal_bool(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                return _wrap_CvERTreeTrainData_get_vectors__SWIG_0(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvERTreeTrainData_get_vectors'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    get_vectors(CvERTreeTrainData *,CvMat const *,float *,uchar *,float *,bool)\n"
+    "    get_vectors(CvERTreeTrainData *,CvMat const *,float *,uchar *,float *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_subsample_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  CvDTreeNode *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvERTreeTrainData_subsample_data",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_subsample_data" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    try {
+      result = (CvDTreeNode *)(arg1)->subsample_data((CvMat const *)arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeNode, 0 |  0 );
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_missing_mask_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvERTreeTrainData_missing_mask_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_missing_mask_set" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  if (arg1) (arg1)->missing_mask = (CvMat const *)arg2;
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTreeTrainData_missing_mask_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvERTreeTrainData_missing_mask_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTreeTrainData_missing_mask_get" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  result = (CvMat *) ((arg1)->missing_mask);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvERTreeTrainData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvERTreeTrainData")) SWIG_fail;
+  {
+    try {
+      result = (CvERTreeTrainData *)new CvERTreeTrainData(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvERTreeTrainData, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvERTreeTrainData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTreeTrainData *arg1 = (CvERTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvERTreeTrainData",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTreeTrainData, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvERTreeTrainData" "', argument " "1"" of type '" "CvERTreeTrainData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTreeTrainData * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvERTreeTrainData_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvERTreeTrainData, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvForestERTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestERTree *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvForestERTree")) SWIG_fail;
+  {
+    try {
+      result = (CvForestERTree *)new CvForestERTree(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvForestERTree, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvForestERTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvForestERTree *arg1 = (CvForestERTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvForestERTree",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvForestERTree, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvForestERTree" "', argument " "1"" of type '" "CvForestERTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvForestERTree * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvForestERTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvForestERTree, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvERTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvERTrees")) SWIG_fail;
+  {
+    try {
+      result = (CvERTrees *)new CvERTrees(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvERTrees, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvERTrees(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvERTrees",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvERTrees" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvRTParams arg9 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvRTParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvERTrees_train" "', argument " "9"" of type '" "CvRTParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTrees_train" "', argument " "9"" of type '" "CvRTParams""'");
+    } else {
+      CvRTParams * temp = reinterpret_cast< CvRTParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvERTrees_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  CvRTParams arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvERTrees_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTrees_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvRTParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvERTrees_train" "', argument " "3"" of type '" "CvRTParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvERTrees_train" "', argument " "3"" of type '" "CvRTParams""'");
+    } else {
+      CvRTParams * temp = reinterpret_cast< CvRTParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvERTrees *arg1 = (CvERTrees *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvERTrees_train",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvERTrees, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvERTrees_train" "', argument " "1"" of type '" "CvERTrees *""'"); 
+  }
+  arg1 = reinterpret_cast< CvERTrees * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvERTrees_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvERTrees_train(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[10];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvERTrees_train__SWIG_7(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvRTParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvERTrees_train__SWIG_6(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvERTrees_train__SWIG_5(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvERTrees_train__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvERTrees_train__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_CvERTrees_train__SWIG_2(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_CvERTrees_train__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvERTrees, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvRTParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      return _wrap_CvERTrees_train__SWIG_0(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvERTrees_train'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvRTParams)\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvERTrees *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvERTrees *,CvMLData *,CvRTParams)\n"
+    "    train(CvERTrees *,CvMLData *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvERTrees_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvERTrees, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_boost_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_boost_type_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_boost_type_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_boost_type_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->boost_type = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_boost_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_boost_type_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_boost_type_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  result = (int) ((arg1)->boost_type);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_weak_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_weak_count_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weak_count_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_weak_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->weak_count = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_weak_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_weak_count_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weak_count_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  result = (int) ((arg1)->weak_count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_split_criteria_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_split_criteria_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_split_criteria_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_split_criteria_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->split_criteria = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_split_criteria_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_split_criteria_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_split_criteria_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  result = (int) ((arg1)->split_criteria);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_weight_trim_rate_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostParams_weight_trim_rate_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weight_trim_rate_set" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostParams_weight_trim_rate_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->weight_trim_rate = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostParams_weight_trim_rate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostParams_weight_trim_rate_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostParams_weight_trim_rate_get" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  result = (double) ((arg1)->weight_trim_rate);
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoostParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvBoostParams")) SWIG_fail;
+  {
+    try {
+      result = (CvBoostParams *)new CvBoostParams(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoostParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int arg4 ;
+  bool arg5 ;
+  float *arg6 = (float *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  bool val5 ;
+  int ecode5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  CvBoostParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvBoostParams",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvBoostParams" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoostParams" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvBoostParams" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvBoostParams" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = static_cast< int >(val4);
+  ecode5 = SWIG_AsVal_bool(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_CvBoostParams" "', argument " "5"" of type '" "bool""'");
+  } 
+  arg5 = static_cast< bool >(val5);
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvBoostParams" "', argument " "6"" of type '" "float const *""'"); 
+  }
+  arg6 = reinterpret_cast< float * >(argp6);
+  {
+    try {
+      result = (CvBoostParams *)new CvBoostParams(arg1,arg2,arg3,arg4,arg5,(float const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoostParams(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CvBoostParams__SWIG_0(self, args);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_int(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            {
+              int res = SWIG_AsVal_bool(argv[4], NULL);
+              _v = SWIG_CheckState(res);
+            }
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_new_CvBoostParams__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvBoostParams'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CvBoostParams()\n"
+    "    CvBoostParams(int,int,double,int,bool,float const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvBoostParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostParams *arg1 = (CvBoostParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoostParams",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostParams, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoostParams" "', argument " "1"" of type '" "CvBoostParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostParams * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvBoostParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoostParams, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvBoostTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvBoostTree")) SWIG_fail;
+  {
+    try {
+      result = (CvBoostTree *)new CvBoostTree(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostTree, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvBoostTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoostTree",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoostTree" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvBoost *arg4 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  bool freearg3 = false ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_train" "', argument " "4"" of type '" "CvBoost *""'"); 
+  }
+  arg4 = reinterpret_cast< CvBoost * >(argp4);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoostTree_scale",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_scale" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoostTree_scale" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  {
+    try {
+      (arg1)->scale(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvBoost *arg4 = (CvBoost *) 0 ;
+  CvDTreeTrainData *arg5 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoostTree_read",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_read" "', argument " "4"" of type '" "CvBoost *""'"); 
+  }
+  arg4 = reinterpret_cast< CvBoost * >(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoostTree_read" "', argument " "5"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg5 = reinterpret_cast< CvDTreeTrainData * >(argp5);
+  {
+    try {
+      (arg1)->read(arg2,arg3,arg4,arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoostTree_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_clear" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    try {
+      (arg1)->clear(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvDTreeParams arg9 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvDTreeParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoostTree_train" "', argument " "9"" of type '" "CvDTreeParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoostTree_train" "', argument " "9"" of type '" "CvDTreeParams""'");
+    } else {
+      CvDTreeParams * temp = reinterpret_cast< CvDTreeParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoostTree_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvDTreeTrainData *arg2 = (CvDTreeTrainData *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoostTree_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_train" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_train" "', argument " "2"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvDTreeTrainData * >(argp2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[10];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvBoostTree_train__SWIG_7(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoostTree_train__SWIG_6(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvBoost, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoostTree_train__SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvBoostTree_train__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvBoostTree_train__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_CvBoostTree_train__SWIG_3(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_CvBoostTree_train__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      return _wrap_CvBoostTree_train__SWIG_1(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoostTree_train'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    train(CvBoostTree *,CvDTreeTrainData *,CvMat const *,CvBoost *)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvBoostTree *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvBoostTree *,CvDTreeTrainData *,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoostTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  {
+    try {
+      (arg1)->read(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
+  }
+  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
+  {
+    try {
+      (arg1)->read(arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoostTree_read(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvBoostTree_read__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoostTree_read__SWIG_2(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvBoost, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvBoostTree_read__SWIG_0(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoostTree_read'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *,CvBoost *,CvDTreeTrainData *)\n"
+    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *)\n"
+    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvBoostTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoostTree, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvBoost")) SWIG_fail;
+  {
+    try {
+      result = (CvBoost *)new CvBoost(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvBoost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoost",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoost" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvBoostParams arg8 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  void *argp8 ;
+  int res8 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_CvBoostParams,  0  | 0);
+    if (!SWIG_IsOK(res8)) {
+      SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvBoost" "', argument " "8"" of type '" "CvBoostParams""'"); 
+    }  
+    if (!argp8) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvBoost" "', argument " "8"" of type '" "CvBoostParams""'");
+    } else {
+      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp8);
+      arg8 = *temp;
+      if (SWIG_IsNewObj(res8)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  CvBoost *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvBoost",&obj0,&obj1,&obj2)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    try {
+      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvBoost(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CvBoost__SWIG_0(self, args);
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_new_CvBoost__SWIG_6(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_new_CvBoost__SWIG_5(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_new_CvBoost__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_new_CvBoost__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_new_CvBoost__SWIG_2(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  int res = SWIG_ConvertPtr(argv[7], 0, SWIGTYPE_p_CvBoostParams, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_new_CvBoost__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvBoost'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CvBoost()\n"
+    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams)\n"
+    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    CvBoost(CvMat const *,int,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvBoostParams arg9 ;
+  bool arg10 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
+  bool val10 ;
+  int ecode10 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvBoostParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'");
+    } else {
+      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
+  }
+  ecode10 = SWIG_AsVal_bool(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "CvBoost_train" "', argument " "10"" of type '" "bool""'");
+  } 
+  arg10 = static_cast< bool >(val10);
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9,arg10); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  CvBoostParams arg9 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  void *argp9 ;
+  int res9 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvBoostParams,  0  | 0);
+    if (!SWIG_IsOK(res9)) {
+      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'"); 
+    }  
+    if (!argp9) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'");
+    } else {
+      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp9);
+      arg9 = *temp;
+      if (SWIG_IsNewObj(res9)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  CvMat *arg8 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  bool freearg8 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    arg8 = (CvMat*)PyObject_to_CvArr(obj7, &freearg8);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  {
+    if(arg8!=NULL && freearg8){
+      cvReleaseData( arg8 );
+      cvFree(&(arg8));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  CvMat *arg7 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  bool freearg7 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    arg7 = (CvMat*)PyObject_to_CvArr(obj6, &freearg7);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  {
+    if(arg7!=NULL && freearg7){
+      cvReleaseData( arg7 );
+      cvFree(&(arg7));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  int arg3 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  int val3 ;
+  int ecode3 = 0 ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  CvBoostParams arg3 ;
+  bool arg4 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  bool val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvBoostParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "CvBoostParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "3"" of type '" "CvBoostParams""'");
+    } else {
+      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  ecode4 = SWIG_AsVal_bool(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "bool""'");
+  } 
+  arg4 = static_cast< bool >(val4);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  CvBoostParams arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_train",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CvBoostParams,  0  | 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "CvBoostParams""'"); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "3"" of type '" "CvBoostParams""'");
+    } else {
+      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp3);
+      arg3 = *temp;
+      if (SWIG_IsNewObj(res3)) delete temp;
+    }
+  }
+  {
+    try {
+      result = (bool)(arg1)->train(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_9(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_train",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  {
+    try {
+      result = (bool)(arg1)->train(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[11];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 10); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvBoost_train__SWIG_9(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvBoostParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvBoost_train__SWIG_8(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoost_train__SWIG_6(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CvBoostParams, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          {
+            int res = SWIG_AsVal_bool(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_CvBoost_train__SWIG_7(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvBoost_train__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvBoost_train__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  return _wrap_CvBoost_train__SWIG_3(self, args);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    return _wrap_CvBoost_train__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvBoostParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      return _wrap_CvBoost_train__SWIG_1(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 10) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
             void *vptr = 0;
             int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
             _v = SWIG_CheckState(res);
             if (_v) {
-              return _wrap_CvBoostTree_train__SWIG_5(self, args);
+              void *vptr = 0;
+              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                void *vptr = 0;
+                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
+                _v = SWIG_CheckState(res);
+                if (_v) {
+                  void *vptr = 0;
+                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
+                  _v = SWIG_CheckState(res);
+                  if (_v) {
+                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvBoostParams, 0);
+                    _v = SWIG_CheckState(res);
+                    if (_v) {
+                      {
+                        int res = SWIG_AsVal_bool(argv[9], NULL);
+                        _v = SWIG_CheckState(res);
+                      }
+                      if (_v) {
+                        return _wrap_CvBoost_train__SWIG_0(self, args);
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_train'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams,bool)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *)\n"
+    "    train(CvBoost *,CvMat const *,int,CvMat const *)\n"
+    "    train(CvBoost *,CvMLData *,CvBoostParams,bool)\n"
+    "    train(CvBoost *,CvMLData *,CvBoostParams)\n"
+    "    train(CvBoost *,CvMLData *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvSlice arg5 ;
+  bool arg6 ;
+  bool arg7 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  CvSlice temp5 ;
+  bool val6 ;
+  int ecode6 = 0 ;
+  bool val7 ;
+  int ecode7 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    if (PyTuple_Check(obj4)) 
+    {
+      if (!PyArg_ParseTuple(obj4,"ii", & temp5.start_index, & temp5.end_index)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers (start_index, end_index)");
+        return NULL;
+      }
+      arg5 = temp5;
+    } 
+    else
+    {
+      CvSlice * ptr;
+      if (SWIG_ConvertPtr (obj4, (void **) & ptr, SWIGTYPE_p_CvSlice, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvSlice");
+        return NULL;
+      }
+      arg5 = *ptr;
+    }
+  }
+  ecode6 = SWIG_AsVal_bool(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CvBoost_predict" "', argument " "6"" of type '" "bool""'");
+  } 
+  arg6 = static_cast< bool >(val6);
+  ecode7 = SWIG_AsVal_bool(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CvBoost_predict" "', argument " "7"" of type '" "bool""'");
+  } 
+  arg7 = static_cast< bool >(val7);
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5,arg6,arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvSlice arg5 ;
+  bool arg6 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  CvSlice temp5 ;
+  bool val6 ;
+  int ecode6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    if (PyTuple_Check(obj4)) 
+    {
+      if (!PyArg_ParseTuple(obj4,"ii", & temp5.start_index, & temp5.end_index)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers (start_index, end_index)");
+        return NULL;
+      }
+      arg5 = temp5;
+    } 
+    else
+    {
+      CvSlice * ptr;
+      if (SWIG_ConvertPtr (obj4, (void **) & ptr, SWIGTYPE_p_CvSlice, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvSlice");
+        return NULL;
+      }
+      arg5 = *ptr;
+    }
+  }
+  ecode6 = SWIG_AsVal_bool(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CvBoost_predict" "', argument " "6"" of type '" "bool""'");
+  } 
+  arg6 = static_cast< bool >(val6);
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5,arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  CvSlice arg5 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  CvSlice temp5 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    if (PyTuple_Check(obj4)) 
+    {
+      if (!PyArg_ParseTuple(obj4,"ii", & temp5.start_index, & temp5.end_index)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers (start_index, end_index)");
+        return NULL;
+      }
+      arg5 = temp5;
+    } 
+    else
+    {
+      CvSlice * ptr;
+      if (SWIG_ConvertPtr (obj4, (void **) & ptr, SWIGTYPE_p_CvSlice, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvSlice");
+        return NULL;
+      }
+      arg5 = *ptr;
+    }
+  }
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvMat *arg4 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_predict",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool freearg2 = false ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_predict",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    try {
+      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return resultobj;
+fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[8];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 7); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_CvBoost_predict__SWIG_5(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_CvBoost_predict__SWIG_4(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoost_predict__SWIG_3(self, args);
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_CvSlice, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvBoost_predict__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_CvSlice, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              {
+                int res = SWIG_AsVal_bool(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                return _wrap_CvBoost_predict__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 7) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_CvSlice, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              {
+                int res = SWIG_AsVal_bool(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_bool(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  return _wrap_CvBoost_predict__SWIG_0(self, args);
+                }
+              }
             }
           }
         }
       }
     }
   }
-  if (argc == 6) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_CvBoostTree_train__SWIG_4(self, args);
-              }
-            }
-          }
-        }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_predict'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *,CvSlice,bool,bool)\n"
+    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *,CvSlice,bool)\n"
+    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *,CvSlice)\n"
+    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *)\n"
+    "    predict(CvBoost const *,CvMat const *,CvMat const *)\n"
+    "    predict(CvBoost const *,CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_calc_error__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
+  vector< float > *arg4 = (vector< float > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_calc_error",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_calc_error" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_calc_error" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_vectorT_float_t, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_calc_error" "', argument " "4"" of type '" "vector< float > *""'"); 
+  }
+  arg4 = reinterpret_cast< vector< float > * >(argp4);
+  {
+    try {
+      result = (float)(arg1)->calc_error(arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_calc_error__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvMLData *arg2 = (CvMLData *) 0 ;
+  int arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_calc_error",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_calc_error" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_calc_error" "', argument " "2"" of type '" "CvMLData *""'"); 
+  }
+  arg2 = reinterpret_cast< CvMLData * >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_calc_error" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  {
+    try {
+      result = (float)(arg1)->calc_error(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_calc_error(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_CvBoost_calc_error__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMLData, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_vectorT_float_t, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvBoost_calc_error__SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_calc_error'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    calc_error(CvBoost *,CvMLData *,int,vector< float > *)\n"
+    "    calc_error(CvBoost *,CvMLData *,int)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_prune(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvSlice arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  CvSlice temp2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_prune",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_prune" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    if (PyTuple_Check(obj1)) 
+    {
+      if (!PyArg_ParseTuple(obj1,"ii", & temp2.start_index, & temp2.end_index)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers (start_index, end_index)");
+        return NULL;
+      }
+      arg2 = temp2;
+    } 
+    else
+    {
+      CvSlice * ptr;
+      if (SWIG_ConvertPtr (obj1, (void **) & ptr, SWIGTYPE_p_CvSlice, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvSlice");
+        return NULL;
+      }
+      arg2 = *ptr;
+    }
+  }
+  {
+    try {
+      (arg1)->prune(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_clear" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      (arg1)->clear(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  char *arg3 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_write",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_write" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_write" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = reinterpret_cast< char * >(buf3);
+  {
+    try {
+      ((CvBoost const *)arg1)->write(arg2,(char const *)arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_read" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  }
+  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  {
+    try {
+      (arg1)->read(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_active_vars__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_get_active_vars",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_active_vars" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvBoost_get_active_vars" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_active_vars(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_active_vars__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_active_vars",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_active_vars" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_active_vars(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_active_vars(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CvBoost_get_active_vars__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_bool(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CvBoost_get_active_vars__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_get_active_vars'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    get_active_vars(CvBoost *,bool)\n"
+    "    get_active_vars(CvBoost *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_weak_predictors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvSeq *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weak_predictors",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weak_predictors" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvSeq *)(arg1)->get_weak_predictors(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSeq, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weights",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weights" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_weights(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_subtree_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_subtree_weights",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_subtree_weights" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_subtree_weights(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_weak_response(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weak_response",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weak_response" "', argument " "1"" of type '" "CvBoost *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_weak_response(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvBoostParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_params",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_params" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvBoostParams *) &((CvBoost const *)arg1)->get_params(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvBoost_get_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvBoost *arg1 = (CvBoost *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvDTreeTrainData *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_data",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_data" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  }
+  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  {
+    try {
+      result = (CvDTreeTrainData *)((CvBoost const *)arg1)->get_data(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvBoost_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoost, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvANN_MLP_TrainParams")) SWIG_fail;
+  {
+    try {
+      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvTermCriteria arg1 ;
+  int arg2 ;
+  double arg3 ;
+  double arg4 ;
+  CvTermCriteria temp1 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  CvANN_MLP_TrainParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvANN_MLP_TrainParams",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  {
+    if (PyTuple_Check(obj0)) 
+    {
+      if (!PyArg_ParseTuple(obj0,"iid", & temp1.type, & temp1.max_iter, & temp1.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg1 = temp1;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj0, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
+      }
+      arg1 = *ptr;
+    }
+  }
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = static_cast< double >(val4);
+  {
+    try {
+      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(arg1,arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvTermCriteria arg1 ;
+  int arg2 ;
+  double arg3 ;
+  CvTermCriteria temp1 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  CvANN_MLP_TrainParams *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvANN_MLP_TrainParams",&obj0,&obj1,&obj2)) SWIG_fail;
+  {
+    if (PyTuple_Check(obj0)) 
+    {
+      if (!PyArg_ParseTuple(obj0,"iid", & temp1.type, & temp1.max_iter, & temp1.epsilon)) 
+      {
+        PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers and a float (type, max_iter, epsilon)");
+        return NULL;
+      }
+      arg1 = temp1;
+    } 
+    else
+    {
+      CvTermCriteria * ptr;
+      if (SWIG_ConvertPtr (obj0, (void **) & ptr, SWIGTYPE_p_CvTermCriteria, SWIG_POINTER_EXCEPTION) == -1)
+      {
+        PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvTermCriteria");
+        return NULL;
       }
+      arg1 = *ptr;
     }
   }
-  if (argc == 7) {
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  {
+    try {
+      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(arg1,arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CvANN_MLP_TrainParams__SWIG_0(self, args);
+  }
+  if (argc == 3) {
     int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_CvTermCriteria, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
       if (_v) {
         {
-          int res = SWIG_AsVal_int(argv[2], NULL);
+          int res = SWIG_AsVal_double(argv[2], NULL);
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  return _wrap_CvBoostTree_train__SWIG_3(self, args);
-                }
-              }
-            }
-          }
+          return _wrap_new_CvANN_MLP_TrainParams__SWIG_2(self, args);
         }
       }
     }
   }
-  if (argc == 8) {
+  if (argc == 4) {
     int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_CvTermCriteria, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
       if (_v) {
         {
-          int res = SWIG_AsVal_int(argv[2], NULL);
+          int res = SWIG_AsVal_double(argv[2], NULL);
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
             _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    return _wrap_CvBoostTree_train__SWIG_2(self, args);
-                  }
-                }
-              }
-            }
           }
-        }
-      }
-    }
-  }
-  if (argc == 9) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
           if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvDTreeParams, 0);
-                    _v = SWIG_CheckState(res);
-                    if (_v) {
-                      return _wrap_CvBoostTree_train__SWIG_1(self, args);
-                    }
-                  }
-                }
-              }
-            }
+            return _wrap_new_CvANN_MLP_TrainParams__SWIG_1(self, args);
           }
         }
       }
@@ -30869,116 +44506,275 @@ SWIGINTERN PyObject *_wrap_CvBoostTree_train(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoostTree_train'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvANN_MLP_TrainParams'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    train(CvBoostTree *,CvDTreeTrainData *,CvMat const *,CvBoost *)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvDTreeParams)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    train(CvBoostTree *,CvMat const *,int,CvMat const *)\n"
-    "    train(CvBoostTree *,CvDTreeTrainData *,CvMat const *)\n");
+    "    CvANN_MLP_TrainParams()\n"
+    "    CvANN_MLP_TrainParams(CvTermCriteria,int,double,double)\n"
+    "    CvANN_MLP_TrainParams(CvTermCriteria,int,double)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvANN_MLP_TrainParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvANN_MLP_TrainParams",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  {
+    try {
+      delete arg1; 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_term_crit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  CvTermCriteria *arg2 = (CvTermCriteria *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_term_crit_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_term_crit_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvTermCriteria, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_TrainParams_term_crit_set" "', argument " "2"" of type '" "CvTermCriteria *""'"); 
+  }
+  arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
+  if (arg1) (arg1)->term_crit = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvTermCriteria *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_term_crit_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_term_crit_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (CvTermCriteria *)& ((arg1)->term_crit);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTermCriteria, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_train_method_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_train_method_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_train_method_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_train_method_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->train_method = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_train_method_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_train_method_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_train_method_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (int) ((arg1)->train_method);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_dw_scale_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_bp_dw_scale_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->bp_dw_scale = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_dw_scale_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_bp_dw_scale_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->bp_dw_scale);
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_moment_scale_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_bp_moment_scale_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->bp_moment_scale = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_moment_scale_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  double result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoostTree_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_bp_moment_scale_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
-  }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  {
-    try {
-      (arg1)->read(arg2,arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->bp_moment_scale);
+  resultobj = SWIG_From_double(static_cast< double >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_read__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoostTree *arg1 = (CvBoostTree *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
-  CvDTreeTrainData *arg4 = (CvDTreeTrainData *) 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoostTree_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoostTree, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw0_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoostTree_read" "', argument " "1"" of type '" "CvBoostTree *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoostTree * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoostTree_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoostTree_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
-  }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvDTreeTrainData, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoostTree_read" "', argument " "4"" of type '" "CvDTreeTrainData *""'"); 
-  }
-  arg4 = reinterpret_cast< CvDTreeTrainData * >(argp4);
-  {
-    try {
-      (arg1)->read(arg2,arg3,arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw0_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw0_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->rp_dw0 = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -30986,1557 +44782,871 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoostTree_read(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[6];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_CvBoostTree_read__SWIG_1(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvBoostTree_read__SWIG_2(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoostTree, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvFileStorage, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvFileNode, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvBoost, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvDTreeTrainData, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_CvBoostTree_read__SWIG_0(self, args);
-            }
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw0_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw0_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->rp_dw0);
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoostTree_read'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *,CvBoost *,CvDTreeTrainData *)\n"
-    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *)\n"
-    "    read(CvBoostTree *,CvFileStorage *,CvFileNode *,CvDTreeTrainData *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvBoostTree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoostTree, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_plus_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)":new_CvBoost")) SWIG_fail;
-  {
-    try {
-      result = (CvBoost *)new CvBoost(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_plus_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->rp_dw_plus = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_CvBoost(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_plus_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  double result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvBoost",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_plus_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvBoost" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->rp_dw_plus);
+  resultobj = SWIG_From_double(static_cast< double >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_minus_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvBoostParams arg8 ;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
+  double val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 ;
-  int res8 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_minus_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_set" "', argument " "2"" of type '" "double""'");
   } 
-  arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvBoost" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvBoost" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvBoost" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvBoost" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  {
-    res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_CvBoostParams,  0  | 0);
-    if (!SWIG_IsOK(res8)) {
-      SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_CvBoost" "', argument " "8"" of type '" "CvBoostParams""'"); 
-    }  
-    if (!argp8) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvBoost" "', argument " "8"" of type '" "CvBoostParams""'");
-    } else {
-      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp8);
-      arg8 = *temp;
-      if (SWIG_IsNewObj(res8)) delete temp;
-    }
-  }
-  {
-    try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,arg8); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->rp_dw_minus = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_minus_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
+  double result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_minus_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvBoost" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvBoost" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvBoost" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_CvBoost" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  {
-    try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->rp_dw_minus);
+  resultobj = SWIG_From_double(static_cast< double >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_min_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
+  double val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_min_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_set" "', argument " "2"" of type '" "double""'");
   } 
-  arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvBoost" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvBoost" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_CvBoost" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  {
-    try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->rp_dw_min = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_min_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvBoost" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_CvBoost" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  {
-    try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_min_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->rp_dw_min);
+  resultobj = SWIG_From_double(static_cast< double >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_max_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvBoost *result = 0 ;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  double arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
+  double val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvBoost",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_max_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_set" "', argument " "2"" of type '" "double""'");
   } 
-  arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_CvBoost" "', argument " "4"" of type '" "CvMat const *""'"); 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->rp_dw_max = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_max_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_max_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
+  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  result = (double) ((arg1)->rp_dw_max);
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvANN_MLP_TrainParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvANN_MLP")) SWIG_fail;
   {
     try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
+      result = (CvANN_MLP *)new CvANN_MLP(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvBoost__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CvMat *arg1 = (CvMat *) 0 ;
   int arg2 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvBoost *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  double arg3 ;
+  double arg4 ;
+  bool freearg1 = false ;
   int val2 ;
   int ecode2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  CvANN_MLP *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvBoost",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvBoost" "', argument " "1"" of type '" "CvMat const *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvANN_MLP",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvBoost" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_CvBoost" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvANN_MLP" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = static_cast< double >(val4);
   {
     try {
-      result = (CvBoost *)new CvBoost((CvMat const *)arg1,arg2,(CvMat const *)arg3); 
+      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2,arg3,arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoost, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvBoost(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[9];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 0) {
-    return _wrap_new_CvBoost__SWIG_0(self, args);
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          return _wrap_new_CvBoost__SWIG_6(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_new_CvBoost__SWIG_5(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_new_CvBoost__SWIG_4(self, args);
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 6) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_new_CvBoost__SWIG_3(self, args);
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 7) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  return _wrap_new_CvBoost__SWIG_2(self, args);
-                }
-              }
-            }
-          }
-        }
-      }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
     }
   }
-  if (argc == 8) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  int res = SWIG_ConvertPtr(argv[7], 0, SWIGTYPE_p_CvBoostParams, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    return _wrap_new_CvBoost__SWIG_1(self, args);
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
+  return resultobj;
+fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
     }
   }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvBoost'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    CvBoost()\n"
-    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams)\n"
-    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    CvBoost(CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    CvBoost(CvMat const *,int,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  CvBoostParams arg9 ;
-  bool arg10 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  double arg3 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  void *argp9 ;
-  int res9 = 0 ;
-  bool val10 ;
-  int ecode10 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
-  PyObject * obj9 = 0 ;
+  CvANN_MLP *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoost_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoost_train" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvBoost_train" "', argument " "8"" of type '" "CvMat const *""'"); 
-  }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvANN_MLP",&obj0,&obj1,&obj2)) SWIG_fail;
   {
-    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvBoostParams,  0  | 0);
-    if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'"); 
-    }  
-    if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'");
-    } else {
-      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp9);
-      arg9 = *temp;
-      if (SWIG_IsNewObj(res9)) delete temp;
-    }
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  ecode10 = SWIG_AsVal_bool(obj9, &val10);
-  if (!SWIG_IsOK(ecode10)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "CvBoost_train" "', argument " "10"" of type '" "bool""'");
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
   } 
-  arg10 = static_cast< bool >(val10);
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = static_cast< double >(val3);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9,arg10); 
+      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  CvBoostParams arg9 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  void *argp9 ;
-  int res9 = 0 ;
+  CvMat *arg1 = (CvMat *) 0 ;
+  int arg2 ;
+  bool freearg1 = false ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
-  PyObject * obj8 = 0 ;
+  CvANN_MLP *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoost_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_CvANN_MLP",&obj0,&obj1)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoost_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    try {
+      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvBoost_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  return resultobj;
+fail:
   {
-    res9 = SWIG_ConvertPtr(obj8, &argp9, SWIGTYPE_p_CvBoostParams,  0  | 0);
-    if (!SWIG_IsOK(res9)) {
-      SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'"); 
-    }  
-    if (!argp9) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_train" "', argument " "9"" of type '" "CvBoostParams""'");
-    } else {
-      CvBoostParams * temp = reinterpret_cast< CvBoostParams * >(argp9);
-      arg9 = *temp;
-      if (SWIG_IsNewObj(res9)) delete temp;
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
     }
   }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  bool freearg1 = false ;
+  PyObject * obj0 = 0 ;
+  CvANN_MLP *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CvANN_MLP",&obj0)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8,arg9); 
+      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  CvMat *arg8 = (CvMat *) 0 ;
-  bool result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
-  void *argp8 = 0 ;
-  int res8 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
-  PyObject * obj7 = 0 ;
+SWIGINTERN PyObject *_wrap_new_CvANN_MLP(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  if (argc == 0) {
+    return _wrap_new_CvANN_MLP__SWIG_0(self, args);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_CvANN_MLP__SWIG_4(self, args);
+    }
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_CvANN_MLP__SWIG_3(self, args);
+      }
+    }
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoost_train" "', argument " "6"" of type '" "CvMat const *""'"); 
+  if (argc == 3) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_new_CvANN_MLP__SWIG_2(self, args);
+        }
+      }
+    }
   }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoost_train" "', argument " "7"" of type '" "CvMat const *""'"); 
+  if (argc == 4) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_new_CvANN_MLP__SWIG_1(self, args);
+          }
+        }
+      }
+    }
   }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
-  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res8)) {
-    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CvBoost_train" "', argument " "8"" of type '" "CvMat const *""'"); 
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvANN_MLP'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CvANN_MLP()\n"
+    "    CvANN_MLP(CvMat const *,int,double,double)\n"
+    "    CvANN_MLP(CvMat const *,int,double)\n"
+    "    CvANN_MLP(CvMat const *,int)\n"
+    "    CvANN_MLP(CvMat const *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CvANN_MLP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvANN_MLP",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvANN_MLP" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg8 = reinterpret_cast< CvMat * >(argp8);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7,(CvMat const *)arg8); 
+      delete arg1; 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  CvMat *arg7 = (CvMat *) 0 ;
-  bool result;
+  double arg4 ;
+  double arg5 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
-  void *argp7 = 0 ;
-  int res7 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  double val5 ;
+  int ecode5 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvANN_MLP_create",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoost_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
-  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res7)) {
-    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CvBoost_train" "', argument " "7"" of type '" "CvMat const *""'"); 
-  }
-  arg7 = reinterpret_cast< CvMat * >(argp7);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvANN_MLP_create" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = static_cast< double >(val4);
+  ecode5 = SWIG_AsVal_double(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvANN_MLP_create" "', argument " "5"" of type '" "double""'");
+  } 
+  arg5 = static_cast< double >(val5);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6,(CvMat const *)arg7); 
+      (arg1)->create((CvMat const *)arg2,arg3,arg4,arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
-  bool result;
+  double arg4 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvANN_MLP_create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res6)) {
-    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvBoost_train" "', argument " "6"" of type '" "CvMat const *""'"); 
-  }
-  arg6 = reinterpret_cast< CvMat * >(argp6);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvANN_MLP_create" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = static_cast< double >(val4);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5,(CvMat const *)arg6); 
+      (arg1)->create((CvMat const *)arg2,arg3,arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
   int val3 ;
   int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_create",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+      (arg1)->create((CvMat const *)arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_create",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_train" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_train" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvBoost_train" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
-      result = (bool)(arg1)->train((CvMat const *)arg2,arg3,(CvMat const *)arg4); 
+      (arg1)->create((CvMat const *)arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_create(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[11];
+  PyObject *argv[6];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 10); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvBoost_train__SWIG_6(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_CvBoost_train__SWIG_5(self, args);
-            }
-          }
-        }
-      }
-    }
-  }
-  if (argc == 6) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_CvBoost_train__SWIG_4(self, args);
-              }
-            }
-          }
-        }
-      }
-    }
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  if (argc == 7) {
+  if (argc == 2) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
       _v = SWIG_CheckState(res);
       if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  return _wrap_CvBoost_train__SWIG_3(self, args);
-                }
-              }
-            }
-          }
-        }
+        return _wrap_CvANN_MLP_create__SWIG_3(self, args);
       }
     }
   }
-  if (argc == 8) {
+  if (argc == 3) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -32548,40 +45658,15 @@ SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    return _wrap_CvBoost_train__SWIG_2(self, args);
-                  }
-                }
-              }
-            }
-          }
+          return _wrap_CvANN_MLP_create__SWIG_2(self, args);
         }
       }
     }
   }
-  if (argc == 9) {
+  if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -32593,44 +45678,21 @@ SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
             _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvBoostParams, 0);
-                    _v = SWIG_CheckState(res);
-                    if (_v) {
-                      return _wrap_CvBoost_train__SWIG_1(self, args);
-                    }
-                  }
-                }
-              }
-            }
+          }
+          if (_v) {
+            return _wrap_CvANN_MLP_create__SWIG_1(self, args);
           }
         }
       }
     }
   }
-  if (argc == 10) {
+  if (argc == 5) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -32642,40 +45704,17 @@ SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
           _v = SWIG_CheckState(res);
         }
         if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
             _v = SWIG_CheckState(res);
-            if (_v) {
-              void *vptr = 0;
-              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_CvMat, 0);
+          }
+          if (_v) {
+            {
+              int res = SWIG_AsVal_double(argv[4], NULL);
               _v = SWIG_CheckState(res);
-              if (_v) {
-                void *vptr = 0;
-                int res = SWIG_ConvertPtr(argv[6], &vptr, SWIGTYPE_p_CvMat, 0);
-                _v = SWIG_CheckState(res);
-                if (_v) {
-                  void *vptr = 0;
-                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CvMat, 0);
-                  _v = SWIG_CheckState(res);
-                  if (_v) {
-                    int res = SWIG_ConvertPtr(argv[8], 0, SWIGTYPE_p_CvBoostParams, 0);
-                    _v = SWIG_CheckState(res);
-                    if (_v) {
-                      {
-                        int res = SWIG_AsVal_bool(argv[9], NULL);
-                        _v = SWIG_CheckState(res);
-                      }
-                      if (_v) {
-                        return _wrap_CvBoost_train__SWIG_0(self, args);
-                      }
-                    }
-                  }
-                }
-              }
+            }
+            if (_v) {
+              return _wrap_CvANN_MLP_create__SWIG_0(self, args);
             }
           }
         }
@@ -32684,348 +45723,463 @@ SWIGINTERN PyObject *_wrap_CvBoost_train(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_train'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvANN_MLP_create'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams,bool)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvBoostParams)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *,CvMat const *)\n"
-    "    train(CvBoost *,CvMat const *,int,CvMat const *)\n");
+    "    create(CvANN_MLP *,CvMat const *,int,double,double)\n"
+    "    create(CvANN_MLP *,CvMat const *,int,double)\n"
+    "    create(CvANN_MLP *,CvMat const *,int)\n"
+    "    create(CvANN_MLP *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  CvSlice arg5 ;
-  bool arg6 ;
-  float result;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvANN_MLP_TrainParams arg6 ;
+  int arg7 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 ;
-  int res5 = 0 ;
-  bool val6 ;
-  int ecode6 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  void *argp6 ;
+  int res6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_predict" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
-    res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_CvSlice,  0  | 0);
-    if (!SWIG_IsOK(res5)) {
-      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_predict" "', argument " "5"" of type '" "CvSlice""'"); 
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvANN_MLP_TrainParams,  0  | 0);
+    if (!SWIG_IsOK(res6)) {
+      SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'"); 
     }  
-    if (!argp5) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_predict" "', argument " "5"" of type '" "CvSlice""'");
+    if (!argp6) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'");
     } else {
-      CvSlice * temp = reinterpret_cast< CvSlice * >(argp5);
-      arg5 = *temp;
-      if (SWIG_IsNewObj(res5)) delete temp;
+      CvANN_MLP_TrainParams * temp = reinterpret_cast< CvANN_MLP_TrainParams * >(argp6);
+      arg6 = *temp;
+      if (SWIG_IsNewObj(res6)) delete temp;
     }
   }
-  ecode6 = SWIG_AsVal_bool(obj5, &val6);
-  if (!SWIG_IsOK(ecode6)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CvBoost_predict" "', argument " "6"" of type '" "bool""'");
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CvANN_MLP_train" "', argument " "7"" of type '" "int""'");
   } 
-  arg6 = static_cast< bool >(val6);
+  arg7 = static_cast< int >(val7);
   {
     try {
-      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5,arg6); 
+      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,arg6,arg7); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  CvSlice arg5 ;
-  float result;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvANN_MLP_TrainParams arg6 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 ;
-  int res5 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
+  void *argp6 ;
+  int res6 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_predict" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
-    res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_CvSlice,  0  | 0);
-    if (!SWIG_IsOK(res5)) {
-      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvBoost_predict" "', argument " "5"" of type '" "CvSlice""'"); 
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  {
+    res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvANN_MLP_TrainParams,  0  | 0);
+    if (!SWIG_IsOK(res6)) {
+      SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'"); 
     }  
-    if (!argp5) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_predict" "', argument " "5"" of type '" "CvSlice""'");
+    if (!argp6) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'");
     } else {
-      CvSlice * temp = reinterpret_cast< CvSlice * >(argp5);
-      arg5 = *temp;
-      if (SWIG_IsNewObj(res5)) delete temp;
+      CvANN_MLP_TrainParams * temp = reinterpret_cast< CvANN_MLP_TrainParams * >(argp6);
+      arg6 = *temp;
+      if (SWIG_IsNewObj(res6)) delete temp;
     }
   }
   {
     try {
-      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4,arg5); 
+      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,arg6); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
   CvMat *arg4 = (CvMat *) 0 ;
-  float result;
+  CvMat *arg5 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
+  bool freearg5 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvBoost_predict",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvBoost_predict" "', argument " "4"" of type '" "CvMat *""'"); 
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
+  }
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
   {
     try {
-      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3,arg4); 
+      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvMat *arg2 = (CvMat *) 0 ;
   CvMat *arg3 = (CvMat *) 0 ;
-  float result;
+  CvMat *arg4 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  bool freearg4 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_predict",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_predict" "', argument " "3"" of type '" "CvMat const *""'"); 
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  {
+    arg4 = (CvMat*)PyObject_to_CvArr(obj3, &freearg4);
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
   {
     try {
-      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2,(CvMat const *)arg3); 
+      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_predict__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  float result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_predict",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_predict" "', argument " "1"" of type '" "CvBoost const *""'"); 
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
   {
-    try {
-      result = (float)((CvBoost const *)arg1)->predict((CvMat const *)arg2); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
+  {
+    if(arg4!=NULL && freearg4){
+      cvReleaseData( arg4 );
+      cvFree(&(arg4));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_train(PyObject *self, PyObject *args) {
   int argc;
-  PyObject *argv[7];
+  PyObject *argv[8];
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
   argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+  for (ii = 0; (ii < argc) && (ii < 7); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_CvBoost_predict__SWIG_4(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
+  if (argc == 4) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -33036,15 +46190,20 @@ SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
         _v = SWIG_CheckState(res);
         if (_v) {
-          return _wrap_CvBoost_predict__SWIG_3(self, args);
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_CvANN_MLP_train__SWIG_3(self, args);
+          }
         }
       }
     }
   }
-  if (argc == 4) {
+  if (argc == 5) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -33059,16 +46218,21 @@ SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            return _wrap_CvBoost_predict__SWIG_2(self, args);
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
+            _v = SWIG_CheckState(res);
+            if (_v) {
+              return _wrap_CvANN_MLP_train__SWIG_2(self, args);
+            }
           }
         }
       }
     }
   }
-  if (argc == 5) {
+  if (argc == 6) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -33083,20 +46247,25 @@ SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_CvSlice, 0);
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
             _v = SWIG_CheckState(res);
             if (_v) {
-              return _wrap_CvBoost_predict__SWIG_1(self, args);
+              int res = SWIG_ConvertPtr(argv[5], 0, SWIGTYPE_p_CvANN_MLP_TrainParams, 0);
+              _v = SWIG_CheckState(res);
+              if (_v) {
+                return _wrap_CvANN_MLP_train__SWIG_1(self, args);
+              }
             }
           }
         }
       }
     }
   }
-  if (argc == 6) {
+  if (argc == 7) {
     int _v;
     void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvBoost, 0);
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
     _v = SWIG_CheckState(res);
     if (_v) {
       void *vptr = 0;
@@ -33111,15 +46280,20 @@ SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
           _v = SWIG_CheckState(res);
           if (_v) {
-            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_CvSlice, 0);
+            void *vptr = 0;
+            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
             _v = SWIG_CheckState(res);
             if (_v) {
-              {
-                int res = SWIG_AsVal_bool(argv[5], NULL);
-                _v = SWIG_CheckState(res);
-              }
+              int res = SWIG_ConvertPtr(argv[5], 0, SWIGTYPE_p_CvANN_MLP_TrainParams, 0);
+              _v = SWIG_CheckState(res);
               if (_v) {
-                return _wrap_CvBoost_predict__SWIG_0(self, args);
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  return _wrap_CvANN_MLP_train__SWIG_0(self, args);
+                }
               }
             }
           }
@@ -33129,127 +46303,98 @@ SWIGINTERN PyObject *_wrap_CvBoost_predict(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvBoost_predict'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvANN_MLP_train'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *,CvSlice,bool)\n"
-    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *,CvSlice)\n"
-    "    predict(CvBoost const *,CvMat const *,CvMat const *,CvMat *)\n"
-    "    predict(CvBoost const *,CvMat const *,CvMat const *)\n"
-    "    predict(CvBoost const *,CvMat const *)\n");
+    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvANN_MLP_TrainParams,int)\n"
+    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvANN_MLP_TrainParams)\n"
+    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
+    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_prune(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_predict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvSlice arg2 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 ;
-  int res2 = 0 ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  float result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvBoost_prune",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_predict",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_prune" "', argument " "1"" of type '" "CvBoost *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_predict" "', argument " "1"" of type '" "CvANN_MLP const *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
   {
-    res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvSlice,  0  | 0);
-    if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_prune" "', argument " "2"" of type '" "CvSlice""'"); 
-    }  
-    if (!argp2) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvBoost_prune" "', argument " "2"" of type '" "CvSlice""'");
-    } else {
-      CvSlice * temp = reinterpret_cast< CvSlice * >(argp2);
-      arg2 = *temp;
-      if (SWIG_IsNewObj(res2)) delete temp;
-    }
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
   }
   {
     try {
-      (arg1)->prune(arg2); 
+      result = (float)((CvANN_MLP const *)arg1)->predict((CvMat const *)arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_clear",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_clear" "', argument " "1"" of type '" "CvBoost *""'"); 
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
   {
-    try {
-      (arg1)->clear(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
   }
-  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  char *arg3 = (char *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_write",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_write" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
-  }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_write" "', argument " "3"" of type '" "char const *""'");
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_clear" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg3 = reinterpret_cast< char * >(buf3);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      (arg1)->clear(); 
     } 
     catch (...) 
     {
@@ -33257,17 +46402,15 @@ SWIGINTERN PyObject *_wrap_CvBoost_write(PyObject *SWIGUNUSEDPARM(self), PyObjec
     } 
   }
   resultobj = SWIG_Py_Void();
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return resultobj;
 fail:
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   CvFileStorage *arg2 = (CvFileStorage *) 0 ;
   CvFileNode *arg3 = (CvFileNode *) 0 ;
   void *argp1 = 0 ;
@@ -33280,20 +46423,20 @@ SWIGINTERN PyObject *_wrap_CvBoost_read(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvBoost_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_read",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_read" "', argument " "1"" of type '" "CvBoost *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_read" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvBoost_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
   }
   arg2 = reinterpret_cast< CvFileStorage * >(argp2);
   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
   if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvBoost_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
   }
   arg3 = reinterpret_cast< CvFileNode * >(argp3);
   {
@@ -33312,394 +46455,41 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvBoost_get_weak_predictors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvSeq *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weak_predictors",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weak_predictors" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      result = (CvSeq *)(arg1)->get_weak_predictors(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSeq, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_get_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weights",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weights" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      result = (CvMat *)(arg1)->get_weights(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_get_subtree_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_subtree_weights",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_subtree_weights" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      result = (CvMat *)(arg1)->get_subtree_weights(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_get_weak_response(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvMat *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_weak_response",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_weak_response" "', argument " "1"" of type '" "CvBoost *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      result = (CvMat *)(arg1)->get_weak_response(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_CvBoost_get_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvBoost *arg1 = (CvBoost *) 0 ;
-  CvBoostParams *result = 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
+  char *arg3 = (char *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:CvBoost_get_params",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvBoost, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvBoost_get_params" "', argument " "1"" of type '" "CvBoost const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvBoost * >(argp1);
-  {
-    try {
-      {
-        CvBoostParams const &_result_ref = ((CvBoost const *)arg1)->get_params();
-        result = (CvBoostParams *) &_result_ref;
-      } 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvBoostParams, 0 |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *CvBoost_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvBoost, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)":new_CvANN_MLP_TrainParams")) SWIG_fail;
-  {
-    try {
-      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvTermCriteria arg1 ;
-  int arg2 ;
-  double arg3 ;
-  double arg4 ;
-  CvANN_MLP_TrainParams *result = 0 ;
-  void *argp1 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  double val4 ;
-  int ecode4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvANN_MLP_TrainParams",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  {
-    res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp1) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp1);
-      arg1 = *temp;
-      if (SWIG_IsNewObj(res1)) delete temp;
-    }
-  }
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  ecode4 = SWIG_AsVal_double(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "4"" of type '" "double""'");
-  } 
-  arg4 = static_cast< double >(val4);
-  {
-    try {
-      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(arg1,arg2,arg3,arg4); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvTermCriteria arg1 ;
-  int arg2 ;
-  double arg3 ;
-  CvANN_MLP_TrainParams *result = 0 ;
-  void *argp1 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvANN_MLP_TrainParams",&obj0,&obj1,&obj2)) SWIG_fail;
-  {
-    res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_CvTermCriteria,  0  | 0);
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvTermCriteria""'"); 
-    }  
-    if (!argp1) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvTermCriteria""'");
-    } else {
-      CvTermCriteria * temp = reinterpret_cast< CvTermCriteria * >(argp1);
-      arg1 = *temp;
-      if (SWIG_IsNewObj(res1)) delete temp;
-    }
-  }
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP_TrainParams" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try {
-      result = (CvANN_MLP_TrainParams *)new CvANN_MLP_TrainParams(arg1,arg2,arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP_TrainParams(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[5];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 0) {
-    return _wrap_new_CvANN_MLP_TrainParams__SWIG_0(self, args);
-  }
-  if (argc == 3) {
-    int _v;
-    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_CvTermCriteria, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_double(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          return _wrap_new_CvANN_MLP_TrainParams__SWIG_2(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_CvTermCriteria, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_double(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_double(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            return _wrap_new_CvANN_MLP_TrainParams__SWIG_1(self, args);
-          }
-        }
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvANN_MLP_TrainParams'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    CvANN_MLP_TrainParams()\n"
-    "    CvANN_MLP_TrainParams(CvTermCriteria,int,double,double)\n"
-    "    CvANN_MLP_TrainParams(CvTermCriteria,int,double)\n");
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_delete_CvANN_MLP_TrainParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvANN_MLP_TrainParams",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_write",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvANN_MLP_TrainParams" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_write" "', argument " "1"" of type '" "CvANN_MLP const *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  }
+  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_write" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = reinterpret_cast< char * >(buf3);
   {
     try {
-      delete arg1;
+      ((CvANN_MLP const *)arg1)->write(arg2,(char const *)arg3); 
     } 
     catch (...) 
     {
@@ -33707,68 +46497,77 @@ SWIGINTERN PyObject *_wrap_delete_CvANN_MLP_TrainParams(PyObject *SWIGUNUSEDPARM
     } 
   }
   resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return resultobj;
 fail:
+  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_term_crit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_get_layer_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  CvTermCriteria *arg2 = (CvTermCriteria *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_term_crit_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_get_layer_count",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_term_crit_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_layer_count" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvTermCriteria, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_TrainParams_term_crit_set" "', argument " "2"" of type '" "CvTermCriteria *""'"); 
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    try {
+      result = (int)(arg1)->get_layer_count(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg2 = reinterpret_cast< CvTermCriteria * >(argp2);
-  if (arg1) (arg1)->term_crit = *arg2;
-  
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_term_crit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_get_layer_sizes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  CvTermCriteria *result = 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_term_crit_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_get_layer_sizes",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_term_crit_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_layer_sizes" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (CvTermCriteria *)& ((arg1)->term_crit);
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTermCriteria, 0 |  0 );
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_layer_sizes(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_train_method_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvANN_MLP_get_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
+  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
   int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -33776,73 +46575,292 @@ SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_train_method_set(PyObject *SWIG
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  double *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_train_method_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_get_weights",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_train_method_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_weights" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
+  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_train_method_set" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_get_weights" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
-  if (arg1) (arg1)->train_method = arg2;
+  {
+    try {
+      result = (double *)(arg1)->get_weights(arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvANN_MLP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvANN_MLP, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_cvRandMVNormal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMat *arg1 = (CvMat *) 0 ;
+  CvMat *arg2 = (CvMat *) 0 ;
+  CvMat *arg3 = (CvMat *) 0 ;
+  CvRNG *arg4 = (CvRNG *) 0 ;
+  bool freearg1 = false ;
+  bool freearg2 = false ;
+  bool freearg3 = false ;
+  void *vptr4 ;
+  CvRNG_Wrapper *wrapper4 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
   
+  if (!PyArg_ParseTuple(args,(char *)"OOO|O:cvRandMVNormal",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  {
+    arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
+  }
+  {
+    arg2 = (CvMat*)PyObject_to_CvArr(obj1, &freearg2);
+  }
+  {
+    arg3 = (CvMat*)PyObject_to_CvArr(obj2, &freearg3);
+  }
+  if (obj3) {
+    {
+      if(SWIG_ConvertPtr(obj3, &vptr4, SWIGTYPE_p_CvRNG_Wrapper, 0)==-1){
+        SWIG_exception( SWIG_TypeError, "could not convert Python object to C value");
+        return NULL;
+      }
+      wrapper4 = (CvRNG_Wrapper *) vptr4;
+      arg4 = wrapper4->ptr();
+    }
+  }
+  {
+    try {
+      cvRandMVNormal(arg1,arg2,arg3,arg4); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
   resultobj = SWIG_Py_Void();
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return resultobj;
 fail:
+  {
+    if(arg1!=NULL && freearg1){
+      cvReleaseData( arg1 );
+      cvFree(&(arg1));
+    }
+  }
+  {
+    if(arg2!=NULL && freearg2){
+      cvReleaseData( arg2 );
+      cvFree(&(arg2));
+    }
+  }
+  {
+    if(arg3!=NULL && freearg3){
+      cvReleaseData( arg3 );
+      cvFree(&(arg3));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_train_method_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_cvRandGaussMixture(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  int result;
+  CvMat **arg1 ;
+  CvMat **arg2 ;
+  float *arg3 ;
+  int arg4 ;
+  CvMat *arg5 = (CvMat *) 0 ;
+  CvMat *arg6 = (CvMat *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  bool freearg5 = false ;
+  bool freearg6 = false ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_train_method_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO|O:cvRandGaussMixture",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_CvMat, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_train_method_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvRandGaussMixture" "', argument " "1"" of type '" "CvMat *[]""'"); 
+  } 
+  arg1 = reinterpret_cast< CvMat ** >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_CvMat, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvRandGaussMixture" "', argument " "2"" of type '" "CvMat *[]""'"); 
+  } 
+  arg2 = reinterpret_cast< CvMat ** >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvRandGaussMixture" "', argument " "3"" of type '" "float []""'"); 
+  } 
+  arg3 = reinterpret_cast< float * >(argp3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvRandGaussMixture" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = static_cast< int >(val4);
+  {
+    arg5 = (CvMat*)PyObject_to_CvArr(obj4, &freearg5);
+  }
+  if (obj5) {
+    {
+      arg6 = (CvMat*)PyObject_to_CvArr(obj5, &freearg6);
+    }
+  }
+  {
+    try {
+      cvRandGaussMixture(arg1,arg2,arg3,arg4,arg5,arg6); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_Py_Void();
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (int) ((arg1)->train_method);
-  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
+  {
+    if(arg5!=NULL && freearg5){
+      cvReleaseData( arg5 );
+      cvFree(&(arg5));
+    }
+  }
+  {
+    if(arg6!=NULL && freearg6){
+      cvReleaseData( arg6 );
+      cvFree(&(arg6));
+    }
+  }
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_dw_scale_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_cvCreateTestSet__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
+  int arg1 ;
+  CvMat **arg2 = (CvMat **) 0 ;
+  int arg3 ;
+  int arg4 ;
+  CvMat **arg5 = (CvMat **) 0 ;
+  int arg6 ;
+  void *arg7 = 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  int val6 ;
+  int ecode6 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_bp_dw_scale_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cvCreateTestSet",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvCreateTestSet" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_CvMat, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvCreateTestSet" "', argument " "2"" of type '" "CvMat **""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_set" "', argument " "2"" of type '" "double""'");
+  arg2 = reinterpret_cast< CvMat ** >(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvCreateTestSet" "', argument " "3"" of type '" "int""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->bp_dw_scale = arg2;
-  
+  arg3 = static_cast< int >(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvCreateTestSet" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = static_cast< int >(val4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_p_CvMat, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "cvCreateTestSet" "', argument " "5"" of type '" "CvMat **""'"); 
+  }
+  arg5 = reinterpret_cast< CvMat ** >(argp5);
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "cvCreateTestSet" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  {
+    try {
+      cvCreateTestSet(arg1,arg2,arg3,arg4,arg5,arg6,arg7); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -33850,158 +46868,280 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_dw_scale_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_cvCreateTestSet(PyObject *self, PyObject *args) {
+  PyObject *resultobj;
+  PyObject *varargs;
+  PyObject *newargs;
+  
+  newargs = PyTuple_GetSlice(args,0,6);
+  varargs = PyTuple_GetSlice(args,6,PyTuple_Size(args)+1);
+  resultobj = _wrap_cvCreateTestSet__varargs__(self,newargs,varargs);
+  Py_XDECREF(newargs);
+  Py_XDECREF(varargs);
+  return resultobj;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
+  CvTrainTestSplit *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_bp_dw_scale_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_dw_scale_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)":new_CvTrainTestSplit")) SWIG_fail;
+  {
+    try {
+      result = (CvTrainTestSplit *)new CvTrainTestSplit(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->bp_dw_scale);
-  resultobj = SWIG_From_double(static_cast< double >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_moment_scale_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
+  int arg1 ;
+  bool arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  bool val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvTrainTestSplit *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_bp_moment_scale_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_CvTrainTestSplit",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvTrainTestSplit" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_set" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvTrainTestSplit" "', argument " "2"" of type '" "bool""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->bp_moment_scale = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  arg2 = static_cast< bool >(val2);
+  {
+    try {
+      result = (CvTrainTestSplit *)new CvTrainTestSplit(arg1,arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_bp_moment_scale_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvTrainTestSplit *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_bp_moment_scale_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_bp_moment_scale_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CvTrainTestSplit",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvTrainTestSplit" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  {
+    try {
+      result = (CvTrainTestSplit *)new CvTrainTestSplit(arg1); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->bp_moment_scale);
-  resultobj = SWIG_From_double(static_cast< double >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  double val2 ;
+  float arg1 ;
+  bool arg2 ;
+  float val1 ;
+  int ecode1 = 0 ;
+  bool val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  CvTrainTestSplit *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw0_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw0_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_CvTrainTestSplit",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_float(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvTrainTestSplit" "', argument " "1"" of type '" "float""'");
+  } 
+  arg1 = static_cast< float >(val1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw0_set" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvTrainTestSplit" "', argument " "2"" of type '" "bool""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->rp_dw0 = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  arg2 = static_cast< bool >(val2);
+  {
+    try {
+      result = (CvTrainTestSplit *)new CvTrainTestSplit(arg1,arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
+  float arg1 ;
+  float val1 ;
+  int ecode1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvTrainTestSplit *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw0_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw0_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CvTrainTestSplit",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_float(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvTrainTestSplit" "', argument " "1"" of type '" "float""'");
+  } 
+  arg1 = static_cast< float >(val1);
+  {
+    try {
+      result = (CvTrainTestSplit *)new CvTrainTestSplit(arg1); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = (int)PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CvTrainTestSplit__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CvTrainTestSplit__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_float(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CvTrainTestSplit__SWIG_4(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_bool(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_CvTrainTestSplit__SWIG_1(self, args);
+      }
+    }
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->rp_dw0);
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_float(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_bool(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_CvTrainTestSplit__SWIG_3(self, args);
+      }
+    }
+  }
+  
 fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvTrainTestSplit'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CvTrainTestSplit()\n"
+    "    CvTrainTestSplit(int,bool)\n"
+    "    CvTrainTestSplit(int)\n"
+    "    CvTrainTestSplit(float,bool)\n"
+    "    CvTrainTestSplit(float)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_plus_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_mode_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  double val2 ;
+  int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_plus_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_train_sample_part_mode_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_mode_set" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_set" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvTrainTestSplit_train_sample_part_mode_set" "', argument " "2"" of type '" "int""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->rp_dw_plus = arg2;
-  
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->train_sample_part_mode = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -34009,52 +47149,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_plus_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_mode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_plus_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_train_sample_part_mode_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_plus_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_mode_get" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->rp_dw_plus);
-  resultobj = SWIG_From_double(static_cast< double >(result));
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  result = (int) ((arg1)->train_sample_part_mode);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_minus_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_mode_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  double val2 ;
+  int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_minus_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_class_part_mode_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_mode_set" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_set" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvTrainTestSplit_class_part_mode_set" "', argument " "2"" of type '" "int""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->rp_dw_minus = arg2;
-  
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->class_part_mode = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -34062,52 +47201,51 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_minus_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_mode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_minus_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_class_part_mode_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_minus_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_mode_get" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->rp_dw_minus);
-  resultobj = SWIG_From_double(static_cast< double >(result));
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  result = (int) ((arg1)->class_part_mode);
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_min_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_mix_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
+  bool arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  double val2 ;
+  bool val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_min_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_mix_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_mix_set" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_set" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvTrainTestSplit_mix_set" "', argument " "2"" of type '" "bool""'");
   } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->rp_dw_min = arg2;
-  
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->mix = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -34115,403 +47253,183 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_min_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_mix_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_min_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_mix_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_min_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_mix_get" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->rp_dw_min);
-  resultobj = SWIG_From_double(static_cast< double >(result));
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  result = (bool) ((arg1)->mix);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_max_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double arg2 ;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  double val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
+  CvTrainTestSplit_class_part *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_TrainParams_rp_dw_max_set",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_class_part_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_set" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_get" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  ecode2 = SWIG_AsVal_double(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_set" "', argument " "2"" of type '" "double""'");
-  } 
-  arg2 = static_cast< double >(val2);
-  if (arg1) (arg1)->rp_dw_max = arg2;
-  
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  result = (CvTrainTestSplit_class_part *) ((arg1)->class_part);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit_class_part, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_TrainParams_rp_dw_max_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP_TrainParams *arg1 = (CvANN_MLP_TrainParams *) 0 ;
-  double result;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvTrainTestSplit_train_sample_part *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_TrainParams_rp_dw_max_get",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP_TrainParams, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_train_sample_part_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_TrainParams_rp_dw_max_get" "', argument " "1"" of type '" "CvANN_MLP_TrainParams *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP_TrainParams * >(argp1);
-  result = (double) ((arg1)->rp_dw_max);
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *CvANN_MLP_TrainParams_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvANN_MLP_TrainParams, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
-}
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvANN_MLP *result = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)":new_CvANN_MLP")) SWIG_fail;
-  {
-    try {
-      result = (CvANN_MLP *)new CvANN_MLP(); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_get" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
+  result = (CvTrainTestSplit_train_sample_part *)& ((arg1)->train_sample_part);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit_train_sample_part, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvTrainTestSplit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  double arg3 ;
-  double arg4 ;
-  CvANN_MLP *result = 0 ;
+  CvTrainTestSplit *arg1 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  double val4 ;
-  int ecode4 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_CvANN_MLP",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvTrainTestSplit",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP" "', argument " "1"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvTrainTestSplit" "', argument " "1"" of type '" "CvTrainTestSplit *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  ecode4 = SWIG_AsVal_double(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_CvANN_MLP" "', argument " "4"" of type '" "double""'");
-  } 
-  arg4 = static_cast< double >(val4);
+  arg1 = reinterpret_cast< CvTrainTestSplit * >(argp1);
   {
     try {
-      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2,arg3,arg4); 
+      delete arg1; 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  double arg3 ;
-  CvANN_MLP *result = 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
-  double val3 ;
-  int ecode3 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CvANN_MLP",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP" "', argument " "1"" of type '" "CvMat const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  ecode3 = SWIG_AsVal_double(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CvANN_MLP" "', argument " "3"" of type '" "double""'");
-  } 
-  arg3 = static_cast< double >(val3);
-  {
-    try {
-      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2,arg3); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
-  }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
+SWIGINTERN PyObject *CvTrainTestSplit_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvTrainTestSplit, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
 }
 
-
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
-  CvANN_MLP *result = 0 ;
+  CvTrainTestSplit_class_part *arg1 = (CvTrainTestSplit_class_part *) 0 ;
+  int *arg2 = (int *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:new_CvANN_MLP",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_class_part_count_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_class_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP" "', argument " "1"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_count_set" "', argument " "1"" of type '" "CvTrainTestSplit_class_part *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CvANN_MLP" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = static_cast< int >(val2);
-  {
-    try {
-      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1,arg2); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  arg1 = reinterpret_cast< CvTrainTestSplit_class_part * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvTrainTestSplit_class_part_count_set" "', argument " "2"" of type '" "int *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  arg2 = reinterpret_cast< int * >(argp2);
+  if (arg1) (arg1)->count = arg2;
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  CvANN_MLP *result = 0 ;
+  CvTrainTestSplit_class_part *arg1 = (CvTrainTestSplit_class_part *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:new_CvANN_MLP",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_class_part_count_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_class_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvANN_MLP" "', argument " "1"" of type '" "CvMat const *""'"); 
-  }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  {
-    try {
-      result = (CvANN_MLP *)new CvANN_MLP((CvMat const *)arg1); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_count_get" "', argument " "1"" of type '" "CvTrainTestSplit_class_part *""'"); 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_NEW |  0 );
+  arg1 = reinterpret_cast< CvTrainTestSplit_class_part * >(argp1);
+  result = (int *) ((arg1)->count);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_new_CvANN_MLP(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[5];
-  int ii;
-  
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 4); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 0) {
-    return _wrap_new_CvANN_MLP__SWIG_0(self, args);
-  }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_new_CvANN_MLP__SWIG_4(self, args);
-    }
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        return _wrap_new_CvANN_MLP__SWIG_3(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_double(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          return _wrap_new_CvANN_MLP__SWIG_2(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvMat, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      {
-        int res = SWIG_AsVal_int(argv[1], NULL);
-        _v = SWIG_CheckState(res);
-      }
-      if (_v) {
-        {
-          int res = SWIG_AsVal_double(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_double(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            return _wrap_new_CvANN_MLP__SWIG_1(self, args);
-          }
-        }
-      }
-    }
-  }
-  
-fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CvANN_MLP'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    CvANN_MLP()\n"
-    "    CvANN_MLP(CvMat const *,int,double,double)\n"
-    "    CvANN_MLP(CvMat const *,int,double)\n"
-    "    CvANN_MLP(CvMat const *,int)\n"
-    "    CvANN_MLP(CvMat const *)\n");
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_delete_CvANN_MLP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_portion_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  CvTrainTestSplit_class_part *arg1 = (CvTrainTestSplit_class_part *) 0 ;
+  float *arg2 = (float *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvANN_MLP",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_class_part_portion_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_class_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvANN_MLP" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_portion_set" "', argument " "1"" of type '" "CvTrainTestSplit_class_part *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  {
-    try {
-      delete arg1;
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+  arg1 = reinterpret_cast< CvTrainTestSplit_class_part * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvTrainTestSplit_class_part_portion_set" "', argument " "2"" of type '" "float *""'"); 
   }
+  arg2 = reinterpret_cast< float * >(argp2);
+  if (arg1) (arg1)->portion = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -34519,161 +47437,65 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_class_part_portion_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  double arg4 ;
-  double arg5 ;
+  CvTrainTestSplit_class_part *arg1 = (CvTrainTestSplit_class_part *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  double val4 ;
-  int ecode4 = 0 ;
-  double val5 ;
-  int ecode5 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
+  float *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvANN_MLP_create",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_class_part_portion_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_class_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_create" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  ecode4 = SWIG_AsVal_double(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvANN_MLP_create" "', argument " "4"" of type '" "double""'");
-  } 
-  arg4 = static_cast< double >(val4);
-  ecode5 = SWIG_AsVal_double(obj4, &val5);
-  if (!SWIG_IsOK(ecode5)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvANN_MLP_create" "', argument " "5"" of type '" "double""'");
-  } 
-  arg5 = static_cast< double >(val5);
-  {
-    try {
-      (arg1)->create((CvMat const *)arg2,arg3,arg4,arg5); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_class_part_portion_get" "', argument " "1"" of type '" "CvTrainTestSplit_class_part *""'"); 
   }
-  resultobj = SWIG_Py_Void();
+  arg1 = reinterpret_cast< CvTrainTestSplit_class_part * >(argp1);
+  result = (float *) ((arg1)->portion);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit_class_part(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
-  double arg4 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
-  double val4 ;
-  int ecode4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  CvTrainTestSplit_class_part *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvANN_MLP_create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_create" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
-  ecode4 = SWIG_AsVal_double(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvANN_MLP_create" "', argument " "4"" of type '" "double""'");
-  } 
-  arg4 = static_cast< double >(val4);
+  if (!PyArg_ParseTuple(args,(char *)":new_CvTrainTestSplit_class_part")) SWIG_fail;
   {
     try {
-      (arg1)->create((CvMat const *)arg2,arg3,arg4); 
+      result = (CvTrainTestSplit_class_part *)new CvTrainTestSplit_class_part(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit_class_part, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvTrainTestSplit_class_part(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  int arg3 ;
+  CvTrainTestSplit_class_part *arg1 = (CvTrainTestSplit_class_part *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int val3 ;
-  int ecode3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_create",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvTrainTestSplit_class_part",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_class_part, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_create" "', argument " "2"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvTrainTestSplit_class_part" "', argument " "1"" of type '" "CvTrainTestSplit_class_part *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  ecode3 = SWIG_AsVal_int(obj2, &val3);
-  if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvANN_MLP_create" "', argument " "3"" of type '" "int""'");
-  } 
-  arg3 = static_cast< int >(val3);
+  arg1 = reinterpret_cast< CvTrainTestSplit_class_part * >(argp1);
   {
     try {
-      (arg1)->create((CvMat const *)arg2,arg3); 
+      delete arg1; 
     } 
     catch (...) 
     {
@@ -34687,37 +47509,36 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_create__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *CvTrainTestSplit_class_part_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvTrainTestSplit_class_part, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_count_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
+  CvTrainTestSplit_train_sample_part *arg1 = (CvTrainTestSplit_train_sample_part *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_create",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_train_sample_part_count_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_train_sample_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_create" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_create" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  {
-    try {
-      (arg1)->create((CvMat const *)arg2); 
-    } 
-    catch (...) 
-    {
-      SWIG_fail;
-    } 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_count_set" "', argument " "1"" of type '" "CvTrainTestSplit_train_sample_part *""'"); 
   }
+  arg1 = reinterpret_cast< CvTrainTestSplit_train_sample_part * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvTrainTestSplit_train_sample_part_count_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->count = arg2;
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -34725,629 +47546,344 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_create(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[6];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvTrainTestSplit_train_sample_part *arg1 = (CvTrainTestSplit_train_sample_part *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 2) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        return _wrap_CvANN_MLP_create__SWIG_3(self, args);
-      }
-    }
-  }
-  if (argc == 3) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          return _wrap_CvANN_MLP_create__SWIG_2(self, args);
-        }
-      }
-    }
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_double(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            return _wrap_CvANN_MLP_create__SWIG_1(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        {
-          int res = SWIG_AsVal_int(argv[2], NULL);
-          _v = SWIG_CheckState(res);
-        }
-        if (_v) {
-          {
-            int res = SWIG_AsVal_double(argv[3], NULL);
-            _v = SWIG_CheckState(res);
-          }
-          if (_v) {
-            {
-              int res = SWIG_AsVal_double(argv[4], NULL);
-              _v = SWIG_CheckState(res);
-            }
-            if (_v) {
-              return _wrap_CvANN_MLP_create__SWIG_0(self, args);
-            }
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_train_sample_part_count_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_train_sample_part, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_count_get" "', argument " "1"" of type '" "CvTrainTestSplit_train_sample_part *""'"); 
   }
-  
+  arg1 = reinterpret_cast< CvTrainTestSplit_train_sample_part * >(argp1);
+  result = (int) ((arg1)->count);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvANN_MLP_create'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    create(CvANN_MLP *,CvMat const *,int,double,double)\n"
-    "    create(CvANN_MLP *,CvMat const *,int,double)\n"
-    "    create(CvANN_MLP *,CvMat const *,int)\n"
-    "    create(CvANN_MLP *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_portion_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvANN_MLP_TrainParams arg6 ;
-  int arg7 ;
-  int result;
+  CvTrainTestSplit_train_sample_part *arg1 = (CvTrainTestSplit_train_sample_part *) 0 ;
+  float arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 ;
-  int res6 = 0 ;
-  int val7 ;
-  int ecode7 = 0 ;
+  float val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
-  PyObject * obj6 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvTrainTestSplit_train_sample_part_portion_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_train_sample_part, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_train" "', argument " "3"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_portion_set" "', argument " "1"" of type '" "CvTrainTestSplit_train_sample_part *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvANN_MLP_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvANN_MLP_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  {
-    res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvANN_MLP_TrainParams,  0  | 0);
-    if (!SWIG_IsOK(res6)) {
-      SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'"); 
-    }  
-    if (!argp6) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'");
-    } else {
-      CvANN_MLP_TrainParams * temp = reinterpret_cast< CvANN_MLP_TrainParams * >(argp6);
-      arg6 = *temp;
-      if (SWIG_IsNewObj(res6)) delete temp;
-    }
-  }
-  ecode7 = SWIG_AsVal_int(obj6, &val7);
-  if (!SWIG_IsOK(ecode7)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CvANN_MLP_train" "', argument " "7"" of type '" "int""'");
+  arg1 = reinterpret_cast< CvTrainTestSplit_train_sample_part * >(argp1);
+  ecode2 = SWIG_AsVal_float(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvTrainTestSplit_train_sample_part_portion_set" "', argument " "2"" of type '" "float""'");
   } 
-  arg7 = static_cast< int >(val7);
+  arg2 = static_cast< float >(val2);
+  if (arg1) (arg1)->portion = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvTrainTestSplit_train_sample_part_portion_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvTrainTestSplit_train_sample_part *arg1 = (CvTrainTestSplit_train_sample_part *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  float result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvTrainTestSplit_train_sample_part_portion_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_train_sample_part, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvTrainTestSplit_train_sample_part_portion_get" "', argument " "1"" of type '" "CvTrainTestSplit_train_sample_part *""'"); 
+  }
+  arg1 = reinterpret_cast< CvTrainTestSplit_train_sample_part * >(argp1);
+  result = (float) ((arg1)->portion);
+  resultobj = SWIG_From_float(static_cast< float >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CvTrainTestSplit_train_sample_part(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvTrainTestSplit_train_sample_part *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CvTrainTestSplit_train_sample_part")) SWIG_fail;
   {
     try {
-      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,arg6,arg7); 
+      result = (CvTrainTestSplit_train_sample_part *)new CvTrainTestSplit_train_sample_part(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvTrainTestSplit_train_sample_part, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvTrainTestSplit_train_sample_part(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvANN_MLP_TrainParams arg6 ;
-  int result;
+  CvTrainTestSplit_train_sample_part *arg1 = (CvTrainTestSplit_train_sample_part *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 ;
-  int res6 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvTrainTestSplit_train_sample_part",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvTrainTestSplit_train_sample_part, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_train" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvANN_MLP_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvANN_MLP_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  {
-    res6 = SWIG_ConvertPtr(obj5, &argp6, SWIGTYPE_p_CvANN_MLP_TrainParams,  0  | 0);
-    if (!SWIG_IsOK(res6)) {
-      SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'"); 
-    }  
-    if (!argp6) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvANN_MLP_train" "', argument " "6"" of type '" "CvANN_MLP_TrainParams""'");
-    } else {
-      CvANN_MLP_TrainParams * temp = reinterpret_cast< CvANN_MLP_TrainParams * >(argp6);
-      arg6 = *temp;
-      if (SWIG_IsNewObj(res6)) delete temp;
-    }
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvTrainTestSplit_train_sample_part" "', argument " "1"" of type '" "CvTrainTestSplit_train_sample_part *""'"); 
   }
+  arg1 = reinterpret_cast< CvTrainTestSplit_train_sample_part * >(argp1);
   {
     try {
-      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5,arg6); 
+      delete arg1; 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *CvTrainTestSplit_train_sample_part_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvTrainTestSplit_train_sample_part, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CvMLData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  int result;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
+  CvMLData *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_train" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvANN_MLP_train" "', argument " "4"" of type '" "CvMat const *""'"); 
-  }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CvANN_MLP_train" "', argument " "5"" of type '" "CvMat const *""'"); 
-  }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
+  if (!PyArg_ParseTuple(args,(char *)":new_CvMLData")) SWIG_fail;
   {
     try {
-      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4,(CvMat const *)arg5); 
+      result = (CvMLData *)new CvMLData(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMLData, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_train__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_CvMLData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvMat *arg4 = (CvMat *) 0 ;
-  int result;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOO:CvANN_MLP_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CvMLData",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_train" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
-  }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_train" "', argument " "2"" of type '" "CvMat const *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_train" "', argument " "3"" of type '" "CvMat const *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res4)) {
-    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CvANN_MLP_train" "', argument " "4"" of type '" "CvMat const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvMLData" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg4 = reinterpret_cast< CvMat * >(argp4);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   {
     try {
-      result = (int)(arg1)->train((CvMat const *)arg2,(CvMat const *)arg3,(CvMat const *)arg4); 
+      delete arg1; 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_train(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[8];
-  int ii;
+SWIGINTERN PyObject *_wrap_CvMLData_read_csv(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 7); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
-  }
-  if (argc == 4) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            return _wrap_CvANN_MLP_train__SWIG_3(self, args);
-          }
-        }
-      }
-    }
-  }
-  if (argc == 5) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              return _wrap_CvANN_MLP_train__SWIG_2(self, args);
-            }
-          }
-        }
-      }
-    }
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_read_csv",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_read_csv" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  if (argc == 6) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              int res = SWIG_ConvertPtr(argv[5], 0, SWIGTYPE_p_CvANN_MLP_TrainParams, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                return _wrap_CvANN_MLP_train__SWIG_1(self, args);
-              }
-            }
-          }
-        }
-      }
-    }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvMLData_read_csv" "', argument " "2"" of type '" "char const *""'");
   }
-  if (argc == 7) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvANN_MLP, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      void *vptr = 0;
-      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvMat, 0);
-      _v = SWIG_CheckState(res);
-      if (_v) {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CvMat, 0);
-        _v = SWIG_CheckState(res);
-        if (_v) {
-          void *vptr = 0;
-          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CvMat, 0);
-          _v = SWIG_CheckState(res);
-          if (_v) {
-            void *vptr = 0;
-            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_CvMat, 0);
-            _v = SWIG_CheckState(res);
-            if (_v) {
-              int res = SWIG_ConvertPtr(argv[5], 0, SWIGTYPE_p_CvANN_MLP_TrainParams, 0);
-              _v = SWIG_CheckState(res);
-              if (_v) {
-                {
-                  int res = SWIG_AsVal_int(argv[6], NULL);
-                  _v = SWIG_CheckState(res);
-                }
-                if (_v) {
-                  return _wrap_CvANN_MLP_train__SWIG_0(self, args);
-                }
-              }
-            }
-          }
-        }
-      }
-    }
+  arg2 = reinterpret_cast< char * >(buf2);
+  {
+    try {
+      result = (int)(arg1)->read_csv((char const *)arg2); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvMLData_get_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_values" "', argument " "1"" of type '" "CvMLData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_values(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvANN_MLP_train'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvANN_MLP_TrainParams,int)\n"
-    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *,CvANN_MLP_TrainParams)\n"
-    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *,CvMat const *)\n"
-    "    train(CvANN_MLP *,CvMat const *,CvMat const *,CvMat const *)\n");
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_predict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_get_responses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  float result;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_predict",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_responses",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_predict" "', argument " "1"" of type '" "CvANN_MLP const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_responses" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_predict" "', argument " "2"" of type '" "CvMat const *""'"); 
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_responses(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_predict" "', argument " "3"" of type '" "CvMat *""'"); 
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvMLData_get_missing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_missing",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_missing" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   {
     try {
-      result = (float)((CvANN_MLP const *)arg1)->predict((CvMat const *)arg2,arg3); 
+      result = (CvMat *)(arg1)->get_missing(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_float(static_cast< float >(result));
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_set_response_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_clear",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_set_response_idx",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_clear" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_set_response_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_set_response_idx" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
   {
     try {
-      (arg1)->clear(); 
+      (arg1)->set_response_idx(arg2); 
     } 
     catch (...) 
     {
@@ -35361,88 +47897,112 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_get_response_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  CvFileNode *arg3 = (CvFileNode *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_read",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_response_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_read" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_response_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_read" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (int)(arg1)->get_response_idx(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvFileNode, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_read" "', argument " "3"" of type '" "CvFileNode *""'"); 
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvMLData_get_train_sample_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_train_sample_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_train_sample_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg3 = reinterpret_cast< CvFileNode * >(argp3);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   {
     try {
-      (arg1)->read(arg2,arg3); 
+      result = (CvMat *)(arg1)->get_train_sample_idx(); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_get_test_sample_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvFileStorage *arg2 = (CvFileStorage *) 0 ;
-  char *arg3 = (char *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  int res3 ;
-  char *buf3 = 0 ;
-  int alloc3 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO:CvANN_MLP_write",&obj0,&obj1,&obj2)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_test_sample_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_write" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_test_sample_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvFileStorage, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvANN_MLP_write" "', argument " "2"" of type '" "CvFileStorage *""'"); 
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_test_sample_idx(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg2 = reinterpret_cast< CvFileStorage * >(argp2);
-  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CvANN_MLP_write" "', argument " "3"" of type '" "char const *""'");
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvMLData_mix_train_and_test_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_mix_train_and_test_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_mix_train_and_test_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg3 = reinterpret_cast< char * >(buf3);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   {
     try {
-      (arg1)->write(arg2,(char const *)arg3); 
+      (arg1)->mix_train_and_test_idx(); 
     } 
     catch (...) 
     {
@@ -35450,61 +48010,67 @@ SWIGINTERN PyObject *_wrap_CvANN_MLP_write(PyObject *SWIGUNUSEDPARM(self), PyObj
     } 
   }
   resultobj = SWIG_Py_Void();
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return resultobj;
 fail:
-  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_get_layer_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_set_train_test_split(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  int result;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  CvTrainTestSplit *arg2 = (CvTrainTestSplit *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_get_layer_count",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_set_train_test_split",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_layer_count" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_set_train_test_split" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvTrainTestSplit, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvMLData_set_train_test_split" "', argument " "2"" of type '" "CvTrainTestSplit const *""'"); 
+  }
+  arg2 = reinterpret_cast< CvTrainTestSplit * >(argp2);
   {
     try {
-      result = (int)(arg1)->get_layer_count(); 
+      (arg1)->set_train_test_split((CvTrainTestSplit const *)arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_From_int(static_cast< int >(result));
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_get_layer_sizes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_get_var_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
-  CvMat *result = 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:CvANN_MLP_get_layer_sizes",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_var_idx",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_layer_sizes" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_var_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   {
     try {
-      result = (CvMat *)(arg1)->get_layer_sizes(); 
+      result = (CvMat *)(arg1)->get_var_idx(); 
     } 
     catch (...) 
     {
@@ -35518,176 +48084,148 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_CvANN_MLP_get_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_chahge_var_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvANN_MLP *arg1 = (CvANN_MLP *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
   int arg2 ;
-  double *result = 0 ;
+  bool arg3 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
+  bool val3 ;
+  int ecode3 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:CvANN_MLP_get_weights",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvANN_MLP, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvMLData_chahge_var_idx",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvANN_MLP_get_weights" "', argument " "1"" of type '" "CvANN_MLP *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_chahge_var_idx" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvANN_MLP * >(argp1);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvANN_MLP_get_weights" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_chahge_var_idx" "', argument " "2"" of type '" "int""'");
   } 
   arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_bool(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvMLData_chahge_var_idx" "', argument " "3"" of type '" "bool""'");
+  } 
+  arg3 = static_cast< bool >(val3);
   {
     try {
-      result = (double *)(arg1)->get_weights(arg2); 
+      (arg1)->chahge_var_idx(arg2,arg3); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *CvANN_MLP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *obj;
-  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_CvANN_MLP, SWIG_NewClientData(obj));
-  return SWIG_Py_Void();
+SWIGINTERN PyObject *_wrap_CvMLData_get_var_types(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CvMat *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_var_types",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_var_types" "', argument " "1"" of type '" "CvMLData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (CvMat *)(arg1)->get_var_types(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
 }
 
-SWIGINTERN PyObject *_wrap_cvRandMVNormal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+
+SWIGINTERN PyObject *_wrap_CvMLData_get_var_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  CvMat *arg2 = (CvMat *) 0 ;
-  CvMat *arg3 = (CvMat *) 0 ;
-  CvRNG *arg4 = (CvRNG *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *vptr4 ;
-  CvRNG_Wrapper *wrapper4 ;
+  int val2 ;
+  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOO|O:cvRandMVNormal",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_get_var_type",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvRandMVNormal" "', argument " "1"" of type '" "CvMat *""'"); 
-  }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvRandMVNormal" "', argument " "2"" of type '" "CvMat *""'"); 
-  }
-  arg2 = reinterpret_cast< CvMat * >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvRandMVNormal" "', argument " "3"" of type '" "CvMat *""'"); 
-  }
-  arg3 = reinterpret_cast< CvMat * >(argp3);
-  if (obj3) {
-    {
-      if(SWIG_ConvertPtr(obj3, &vptr4, SWIGTYPE_p_CvRNG_Wrapper, 0)==-1){
-        SWIG_exception( SWIG_TypeError, "could not convert Python object to C value");
-        return NULL;
-      }
-      wrapper4 = (CvRNG_Wrapper *) vptr4;
-      arg4 = wrapper4->ptr();
-    }
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_var_type" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_get_var_type" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
   {
     try {
-      cvRandMVNormal(arg1,arg2,arg3,arg4); 
+      result = (int)(arg1)->get_var_type(arg2); 
     } 
     catch (...) 
     {
       SWIG_fail;
     } 
   }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_From_int(static_cast< int >(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_cvRandGaussMixture(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_set_var_types(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat **arg1 ;
-  CvMat **arg2 ;
-  float *arg3 ;
-  int arg4 ;
-  CvMat *arg5 = (CvMat *) 0 ;
-  CvMat *arg6 = (CvMat *) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  char *arg2 = (char *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  int val4 ;
-  int ecode4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  void *argp6 = 0 ;
-  int res6 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOO|O:cvRandGaussMixture",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_set_var_types",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvRandGaussMixture" "', argument " "1"" of type '" "CvMat *[]""'"); 
-  } 
-  arg1 = reinterpret_cast< CvMat ** >(argp1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvRandGaussMixture" "', argument " "2"" of type '" "CvMat *[]""'"); 
-  } 
-  arg2 = reinterpret_cast< CvMat ** >(argp2);
-  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
-  if (!SWIG_IsOK(res3)) {
-    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvRandGaussMixture" "', argument " "3"" of type '" "float []""'"); 
-  } 
-  arg3 = reinterpret_cast< float * >(argp3);
-  ecode4 = SWIG_AsVal_int(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvRandGaussMixture" "', argument " "4"" of type '" "int""'");
-  } 
-  arg4 = static_cast< int >(val4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "cvRandGaussMixture" "', argument " "5"" of type '" "CvMat *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_set_var_types" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg5 = reinterpret_cast< CvMat * >(argp5);
-  if (obj5) {
-    res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_CvMat, 0 |  0 );
-    if (!SWIG_IsOK(res6)) {
-      SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "cvRandGaussMixture" "', argument " "6"" of type '" "CvMat *""'"); 
-    }
-    arg6 = reinterpret_cast< CvMat * >(argp6);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvMLData_set_var_types" "', argument " "2"" of type '" "char const *""'");
   }
+  arg2 = reinterpret_cast< char * >(buf2);
   {
     try {
-      cvRandGaussMixture(arg1,arg2,arg3,arg4,arg5,arg6); 
+      (arg1)->set_var_types((char const *)arg2); 
     } 
     catch (...) 
     {
@@ -35695,74 +48233,86 @@ SWIGINTERN PyObject *_wrap_cvRandGaussMixture(PyObject *SWIGUNUSEDPARM(self), Py
     } 
   }
   resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
   return resultobj;
 fail:
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_cvCreateTestSet__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
+SWIGINTERN PyObject *_wrap_CvMLData_change_var_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  int arg1 ;
-  CvMat **arg2 = (CvMat **) 0 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  int arg2 ;
   int arg3 ;
-  int arg4 ;
-  CvMat **arg5 = (CvMat **) 0 ;
-  int arg6 ;
-  void *arg7 = 0 ;
-  int val1 ;
-  int ecode1 = 0 ;
-  void *argp2 = 0 ;
-  int res2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
   int val3 ;
   int ecode3 = 0 ;
-  int val4 ;
-  int ecode4 = 0 ;
-  void *argp5 = 0 ;
-  int res5 = 0 ;
-  int val6 ;
-  int ecode6 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
-  PyObject * obj3 = 0 ;
-  PyObject * obj4 = 0 ;
-  PyObject * obj5 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cvCreateTestSet",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
-  ecode1 = SWIG_AsVal_int(obj0, &val1);
-  if (!SWIG_IsOK(ecode1)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvCreateTestSet" "', argument " "1"" of type '" "int""'");
-  } 
-  arg1 = static_cast< int >(val1);
-  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvCreateTestSet" "', argument " "2"" of type '" "CvMat **""'"); 
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CvMLData_change_var_type",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_change_var_type" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg2 = reinterpret_cast< CvMat ** >(argp2);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_change_var_type" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
   ecode3 = SWIG_AsVal_int(obj2, &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvCreateTestSet" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvMLData_change_var_type" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
-  ecode4 = SWIG_AsVal_int(obj3, &val4);
-  if (!SWIG_IsOK(ecode4)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvCreateTestSet" "', argument " "4"" of type '" "int""'");
-  } 
-  arg4 = static_cast< int >(val4);
-  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_p_CvMat, 0 |  0 );
-  if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "cvCreateTestSet" "', argument " "5"" of type '" "CvMat **""'"); 
+  {
+    try {
+      (arg1)->change_var_type(arg2,arg3); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
   }
-  arg5 = reinterpret_cast< CvMat ** >(argp5);
-  ecode6 = SWIG_AsVal_int(obj5, &val6);
-  if (!SWIG_IsOK(ecode6)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "cvCreateTestSet" "', argument " "6"" of type '" "int""'");
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CvMLData_set_delimiter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  char arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  char val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_set_delimiter",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_set_delimiter" "', argument " "1"" of type '" "CvMLData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  ecode2 = SWIG_AsVal_char(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_set_delimiter" "', argument " "2"" of type '" "char""'");
   } 
-  arg6 = static_cast< int >(val6);
+  arg2 = static_cast< char >(val2);
   {
     try {
-      cvCreateTestSet(arg1,arg2,arg3,arg4,arg5,arg6,arg7); 
+      (arg1)->set_delimiter(arg2); 
     } 
     catch (...) 
     {
@@ -35776,45 +48326,61 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_cvCreateTestSet(PyObject *self, PyObject *args) {
-  PyObject *resultobj;
-  PyObject *varargs;
-  PyObject *newargs;
+SWIGINTERN PyObject *_wrap_CvMLData_get_delimiter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char result;
   
-  newargs = PyTuple_GetSlice(args,0,6);
-  varargs = PyTuple_GetSlice(args,6,PyTuple_Size(args)+1);
-  resultobj = _wrap_cvCreateTestSet__varargs__(self,newargs,varargs);
-  Py_XDECREF(newargs);
-  Py_XDECREF(varargs);
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_delimiter",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_delimiter" "', argument " "1"" of type '" "CvMLData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (char)(arg1)->get_delimiter(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_char(static_cast< char >(result));
   return resultobj;
+fail:
+  return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_cvCompleteSymm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_CvMLData_set_miss_ch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  CvMat *arg1 = (CvMat *) 0 ;
-  int arg2 ;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  char arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
+  char val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:cvCompleteSymm",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMat, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"OO:CvMLData_set_miss_ch",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvCompleteSymm" "', argument " "1"" of type '" "CvMat *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_set_miss_ch" "', argument " "1"" of type '" "CvMLData *""'"); 
   }
-  arg1 = reinterpret_cast< CvMat * >(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  ecode2 = SWIG_AsVal_char(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvCompleteSymm" "', argument " "2"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvMLData_set_miss_ch" "', argument " "2"" of type '" "char""'");
   } 
-  arg2 = static_cast< int >(val2);
+  arg2 = static_cast< char >(val2);
   {
     try {
-      cvCompleteSymm(arg1,arg2); 
+      (arg1)->set_miss_ch(arg2); 
     } 
     catch (...) 
     {
@@ -35828,7 +48394,45 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CvMLData_get_miss_ch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CvMLData *arg1 = (CvMLData *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CvMLData_get_miss_ch",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvMLData, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvMLData_get_miss_ch" "', argument " "1"" of type '" "CvMLData *""'"); 
+  }
+  arg1 = reinterpret_cast< CvMLData * >(argp1);
+  {
+    try {
+      result = (char)(arg1)->get_miss_ch(); 
+    } 
+    catch (...) 
+    {
+      SWIG_fail;
+    } 
+  }
+  resultobj = SWIG_From_char(static_cast< char >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CvMLData_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CvMLData, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
 static PyMethodDef SwigMethods[] = {
+        { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
         { (char *)"new_CvRNG_Wrapper", _wrap_new_CvRNG_Wrapper, METH_VARARGS, NULL},
         { (char *)"CvRNG_Wrapper_ptr", _wrap_CvRNG_Wrapper_ptr, METH_VARARGS, NULL},
         { (char *)"CvRNG_Wrapper_ref", _wrap_CvRNG_Wrapper_ref, METH_VARARGS, NULL},
@@ -36079,17 +48683,20 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvEM_get_means", _wrap_CvEM_get_means, METH_VARARGS, NULL},
         { (char *)"CvEM_get_weights", _wrap_CvEM_get_weights, METH_VARARGS, NULL},
         { (char *)"CvEM_get_probs", _wrap_CvEM_get_probs, METH_VARARGS, NULL},
+        { (char *)"CvEM_get_log_likelihood", _wrap_CvEM_get_log_likelihood, METH_VARARGS, NULL},
         { (char *)"CvEM_get_covs", _wrap_CvEM_get_covs, METH_VARARGS, NULL},
         { (char *)"CvEM_swigregister", CvEM_swigregister, METH_VARARGS, NULL},
-        { (char *)"CvPair32s32f_i_set", _wrap_CvPair32s32f_i_set, METH_VARARGS, NULL},
-        { (char *)"CvPair32s32f_i_get", _wrap_CvPair32s32f_i_get, METH_VARARGS, NULL},
-        { (char *)"CvPair32s32f_val_set", _wrap_CvPair32s32f_val_set, METH_VARARGS, NULL},
-        { (char *)"CvPair32s32f_val_get", _wrap_CvPair32s32f_val_get, METH_VARARGS, NULL},
-        { (char *)"new_CvPair32s32f", _wrap_new_CvPair32s32f, METH_VARARGS, NULL},
-        { (char *)"delete_CvPair32s32f", _wrap_delete_CvPair32s32f, METH_VARARGS, NULL},
-        { (char *)"CvPair32s32f_swigregister", CvPair32s32f_swigregister, METH_VARARGS, NULL},
+        { (char *)"CvPair16u32s_u_set", _wrap_CvPair16u32s_u_set, METH_VARARGS, NULL},
+        { (char *)"CvPair16u32s_u_get", _wrap_CvPair16u32s_u_get, METH_VARARGS, NULL},
+        { (char *)"CvPair16u32s_i_set", _wrap_CvPair16u32s_i_set, METH_VARARGS, NULL},
+        { (char *)"CvPair16u32s_i_get", _wrap_CvPair16u32s_i_get, METH_VARARGS, NULL},
+        { (char *)"new_CvPair16u32s", _wrap_new_CvPair16u32s, METH_VARARGS, NULL},
+        { (char *)"delete_CvPair16u32s", _wrap_delete_CvPair16u32s, METH_VARARGS, NULL},
+        { (char *)"CvPair16u32s_swigregister", CvPair16u32s_swigregister, METH_VARARGS, NULL},
         { (char *)"CvDTreeSplit_var_idx_set", _wrap_CvDTreeSplit_var_idx_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeSplit_var_idx_get", _wrap_CvDTreeSplit_var_idx_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeSplit_condensed_idx_set", _wrap_CvDTreeSplit_condensed_idx_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeSplit_condensed_idx_get", _wrap_CvDTreeSplit_condensed_idx_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeSplit_inversed_set", _wrap_CvDTreeSplit_inversed_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeSplit_inversed_get", _wrap_CvDTreeSplit_inversed_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeSplit_quality_set", _wrap_CvDTreeSplit_quality_set, METH_VARARGS, NULL},
@@ -36170,6 +48777,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"new_CvDTreeTrainData", _wrap_new_CvDTreeTrainData, METH_VARARGS, NULL},
         { (char *)"delete_CvDTreeTrainData", _wrap_delete_CvDTreeTrainData, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_set_data", _wrap_CvDTreeTrainData_set_data, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_do_responses_copy", _wrap_CvDTreeTrainData_do_responses_copy, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_vectors", _wrap_CvDTreeTrainData_get_vectors, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_subsample_data", _wrap_CvDTreeTrainData_subsample_data, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_write_params", _wrap_CvDTreeTrainData_write_params, METH_VARARGS, NULL},
@@ -36178,9 +48786,10 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvDTreeTrainData_get_num_classes", _wrap_CvDTreeTrainData_get_num_classes, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_var_type", _wrap_CvDTreeTrainData_get_var_type, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_work_var_count", _wrap_CvDTreeTrainData_get_work_var_count, METH_VARARGS, NULL},
-        { (char *)"CvDTreeTrainData_get_class_labels", _wrap_CvDTreeTrainData_get_class_labels, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_ord_responses", _wrap_CvDTreeTrainData_get_ord_responses, METH_VARARGS, NULL},
-        { (char *)"CvDTreeTrainData_get_labels", _wrap_CvDTreeTrainData_get_labels, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_class_labels", _wrap_CvDTreeTrainData_get_class_labels, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_cv_labels", _wrap_CvDTreeTrainData_get_cv_labels, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_sample_indices", _wrap_CvDTreeTrainData_get_sample_indices, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_cat_var_data", _wrap_CvDTreeTrainData_get_cat_var_data, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_ord_var_data", _wrap_CvDTreeTrainData_get_ord_var_data, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_get_child_buf_idx", _wrap_CvDTreeTrainData_get_child_buf_idx, METH_VARARGS, NULL},
@@ -36191,6 +48800,24 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvDTreeTrainData_free_node_data", _wrap_CvDTreeTrainData_free_node_data, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_free_train_data", _wrap_CvDTreeTrainData_free_train_data, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_free_node", _wrap_CvDTreeTrainData_free_node, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_pred_float_buf", _wrap_CvDTreeTrainData_get_pred_float_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_pred_int_buf", _wrap_CvDTreeTrainData_get_pred_int_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_resp_float_buf", _wrap_CvDTreeTrainData_get_resp_float_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_resp_int_buf", _wrap_CvDTreeTrainData_get_resp_int_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_cv_lables_buf", _wrap_CvDTreeTrainData_get_cv_lables_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_get_sample_idx_buf", _wrap_CvDTreeTrainData_get_sample_idx_buf, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_pred_float_buf_set", _wrap_CvDTreeTrainData_pred_float_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_pred_float_buf_get", _wrap_CvDTreeTrainData_pred_float_buf_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_pred_int_buf_set", _wrap_CvDTreeTrainData_pred_int_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_pred_int_buf_get", _wrap_CvDTreeTrainData_pred_int_buf_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_resp_float_buf_set", _wrap_CvDTreeTrainData_resp_float_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_resp_float_buf_get", _wrap_CvDTreeTrainData_resp_float_buf_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_resp_int_buf_set", _wrap_CvDTreeTrainData_resp_int_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_resp_int_buf_get", _wrap_CvDTreeTrainData_resp_int_buf_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_cv_lables_buf_set", _wrap_CvDTreeTrainData_cv_lables_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_cv_lables_buf_get", _wrap_CvDTreeTrainData_cv_lables_buf_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_sample_idx_buf_set", _wrap_CvDTreeTrainData_sample_idx_buf_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_sample_idx_buf_get", _wrap_CvDTreeTrainData_sample_idx_buf_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_sample_count_set", _wrap_CvDTreeTrainData_sample_count_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_sample_count_get", _wrap_CvDTreeTrainData_sample_count_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_var_all_set", _wrap_CvDTreeTrainData_var_all_set, METH_VARARGS, NULL},
@@ -36203,18 +48830,30 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvDTreeTrainData_ord_var_count_get", _wrap_CvDTreeTrainData_ord_var_count_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_cat_var_count_set", _wrap_CvDTreeTrainData_cat_var_count_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_cat_var_count_get", _wrap_CvDTreeTrainData_cat_var_count_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_work_var_count_set", _wrap_CvDTreeTrainData_work_var_count_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_work_var_count_get", _wrap_CvDTreeTrainData_work_var_count_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_have_labels_set", _wrap_CvDTreeTrainData_have_labels_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_have_labels_get", _wrap_CvDTreeTrainData_have_labels_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_have_priors_set", _wrap_CvDTreeTrainData_have_priors_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_have_priors_get", _wrap_CvDTreeTrainData_have_priors_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_is_classifier_set", _wrap_CvDTreeTrainData_is_classifier_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_is_classifier_get", _wrap_CvDTreeTrainData_is_classifier_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_tflag_set", _wrap_CvDTreeTrainData_tflag_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_tflag_get", _wrap_CvDTreeTrainData_tflag_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_train_data_set", _wrap_CvDTreeTrainData_train_data_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_train_data_get", _wrap_CvDTreeTrainData_train_data_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_responses_set", _wrap_CvDTreeTrainData_responses_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_responses_get", _wrap_CvDTreeTrainData_responses_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_responses_copy_set", _wrap_CvDTreeTrainData_responses_copy_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_responses_copy_get", _wrap_CvDTreeTrainData_responses_copy_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_buf_count_set", _wrap_CvDTreeTrainData_buf_count_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_buf_count_get", _wrap_CvDTreeTrainData_buf_count_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_buf_size_set", _wrap_CvDTreeTrainData_buf_size_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_buf_size_get", _wrap_CvDTreeTrainData_buf_size_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_shared_set", _wrap_CvDTreeTrainData_shared_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_shared_get", _wrap_CvDTreeTrainData_shared_get, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_is_buf_16u_set", _wrap_CvDTreeTrainData_is_buf_16u_set, METH_VARARGS, NULL},
+        { (char *)"CvDTreeTrainData_is_buf_16u_get", _wrap_CvDTreeTrainData_is_buf_16u_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_cat_count_set", _wrap_CvDTreeTrainData_cat_count_set, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_cat_count_get", _wrap_CvDTreeTrainData_cat_count_get, METH_VARARGS, NULL},
         { (char *)"CvDTreeTrainData_cat_ofs_set", _wrap_CvDTreeTrainData_cat_ofs_set, METH_VARARGS, NULL},
@@ -36258,6 +48897,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvDTreeTrainData_swigregister", CvDTreeTrainData_swigregister, METH_VARARGS, NULL},
         { (char *)"new_CvDTree", _wrap_new_CvDTree, METH_VARARGS, NULL},
         { (char *)"delete_CvDTree", _wrap_delete_CvDTree, METH_VARARGS, NULL},
+        { (char *)"CvDTree_calc_error", _wrap_CvDTree_calc_error, METH_VARARGS, NULL},
         { (char *)"CvDTree_train", _wrap_CvDTree_train, METH_VARARGS, NULL},
         { (char *)"CvDTree_predict", _wrap_CvDTree_predict, METH_VARARGS, NULL},
         { (char *)"CvDTree_get_var_importance", _wrap_CvDTree_get_var_importance, METH_VARARGS, NULL},
@@ -36267,6 +48907,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvDTree_get_root", _wrap_CvDTree_get_root, METH_VARARGS, NULL},
         { (char *)"CvDTree_get_pruned_tree_idx", _wrap_CvDTree_get_pruned_tree_idx, METH_VARARGS, NULL},
         { (char *)"CvDTree_get_data", _wrap_CvDTree_get_data, METH_VARARGS, NULL},
+        { (char *)"CvDTree_pruned_tree_idx_set", _wrap_CvDTree_pruned_tree_idx_set, METH_VARARGS, NULL},
+        { (char *)"CvDTree_pruned_tree_idx_get", _wrap_CvDTree_pruned_tree_idx_get, METH_VARARGS, NULL},
         { (char *)"CvDTree_swigregister", CvDTree_swigregister, METH_VARARGS, NULL},
         { (char *)"new_CvForestTree", _wrap_new_CvForestTree, METH_VARARGS, NULL},
         { (char *)"delete_CvForestTree", _wrap_delete_CvForestTree, METH_VARARGS, NULL},
@@ -36287,9 +48929,12 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"delete_CvRTrees", _wrap_delete_CvRTrees, METH_VARARGS, NULL},
         { (char *)"CvRTrees_train", _wrap_CvRTrees_train, METH_VARARGS, NULL},
         { (char *)"CvRTrees_predict", _wrap_CvRTrees_predict, METH_VARARGS, NULL},
+        { (char *)"CvRTrees_predict_prob", _wrap_CvRTrees_predict_prob, METH_VARARGS, NULL},
         { (char *)"CvRTrees_clear", _wrap_CvRTrees_clear, METH_VARARGS, NULL},
         { (char *)"CvRTrees_get_var_importance", _wrap_CvRTrees_get_var_importance, METH_VARARGS, NULL},
         { (char *)"CvRTrees_get_proximity", _wrap_CvRTrees_get_proximity, METH_VARARGS, NULL},
+        { (char *)"CvRTrees_calc_error", _wrap_CvRTrees_calc_error, METH_VARARGS, NULL},
+        { (char *)"CvRTrees_get_train_error", _wrap_CvRTrees_get_train_error, METH_VARARGS, NULL},
         { (char *)"CvRTrees_read", _wrap_CvRTrees_read, METH_VARARGS, NULL},
         { (char *)"CvRTrees_write", _wrap_CvRTrees_write, METH_VARARGS, NULL},
         { (char *)"CvRTrees_get_active_var_mask", _wrap_CvRTrees_get_active_var_mask, METH_VARARGS, NULL},
@@ -36297,6 +48942,25 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CvRTrees_get_tree_count", _wrap_CvRTrees_get_tree_count, METH_VARARGS, NULL},
         { (char *)"CvRTrees_get_tree", _wrap_CvRTrees_get_tree, METH_VARARGS, NULL},
         { (char *)"CvRTrees_swigregister", CvRTrees_swigregister, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_set_data", _wrap_CvERTreeTrainData_set_data, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_get_ord_var_data", _wrap_CvERTreeTrainData_get_ord_var_data, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_get_sample_indices", _wrap_CvERTreeTrainData_get_sample_indices, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_get_cv_labels", _wrap_CvERTreeTrainData_get_cv_labels, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_get_cat_var_data", _wrap_CvERTreeTrainData_get_cat_var_data, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_get_vectors", _wrap_CvERTreeTrainData_get_vectors, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_subsample_data", _wrap_CvERTreeTrainData_subsample_data, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_missing_mask_set", _wrap_CvERTreeTrainData_missing_mask_set, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_missing_mask_get", _wrap_CvERTreeTrainData_missing_mask_get, METH_VARARGS, NULL},
+        { (char *)"new_CvERTreeTrainData", _wrap_new_CvERTreeTrainData, METH_VARARGS, NULL},
+        { (char *)"delete_CvERTreeTrainData", _wrap_delete_CvERTreeTrainData, METH_VARARGS, NULL},
+        { (char *)"CvERTreeTrainData_swigregister", CvERTreeTrainData_swigregister, METH_VARARGS, NULL},
+        { (char *)"new_CvForestERTree", _wrap_new_CvForestERTree, METH_VARARGS, NULL},
+        { (char *)"delete_CvForestERTree", _wrap_delete_CvForestERTree, METH_VARARGS, NULL},
+        { (char *)"CvForestERTree_swigregister", CvForestERTree_swigregister, METH_VARARGS, NULL},
+        { (char *)"new_CvERTrees", _wrap_new_CvERTrees, METH_VARARGS, NULL},
+        { (char *)"delete_CvERTrees", _wrap_delete_CvERTrees, METH_VARARGS, NULL},
+        { (char *)"CvERTrees_train", _wrap_CvERTrees_train, METH_VARARGS, NULL},
+        { (char *)"CvERTrees_swigregister", CvERTrees_swigregister, METH_VARARGS, NULL},
         { (char *)"CvBoostParams_boost_type_set", _wrap_CvBoostParams_boost_type_set, METH_VARARGS, NULL},
         { (char *)"CvBoostParams_boost_type_get", _wrap_CvBoostParams_boost_type_get, METH_VARARGS, NULL},
         { (char *)"CvBoostParams_weak_count_set", _wrap_CvBoostParams_weak_count_set, METH_VARARGS, NULL},
@@ -36319,15 +48983,18 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"new_CvBoost", _wrap_new_CvBoost, METH_VARARGS, NULL},
         { (char *)"CvBoost_train", _wrap_CvBoost_train, METH_VARARGS, NULL},
         { (char *)"CvBoost_predict", _wrap_CvBoost_predict, METH_VARARGS, NULL},
+        { (char *)"CvBoost_calc_error", _wrap_CvBoost_calc_error, METH_VARARGS, NULL},
         { (char *)"CvBoost_prune", _wrap_CvBoost_prune, METH_VARARGS, NULL},
         { (char *)"CvBoost_clear", _wrap_CvBoost_clear, METH_VARARGS, NULL},
         { (char *)"CvBoost_write", _wrap_CvBoost_write, METH_VARARGS, NULL},
         { (char *)"CvBoost_read", _wrap_CvBoost_read, METH_VARARGS, NULL},
+        { (char *)"CvBoost_get_active_vars", _wrap_CvBoost_get_active_vars, METH_VARARGS, NULL},
         { (char *)"CvBoost_get_weak_predictors", _wrap_CvBoost_get_weak_predictors, METH_VARARGS, NULL},
         { (char *)"CvBoost_get_weights", _wrap_CvBoost_get_weights, METH_VARARGS, NULL},
         { (char *)"CvBoost_get_subtree_weights", _wrap_CvBoost_get_subtree_weights, METH_VARARGS, NULL},
         { (char *)"CvBoost_get_weak_response", _wrap_CvBoost_get_weak_response, METH_VARARGS, NULL},
         { (char *)"CvBoost_get_params", _wrap_CvBoost_get_params, METH_VARARGS, NULL},
+        { (char *)"CvBoost_get_data", _wrap_CvBoost_get_data, METH_VARARGS, NULL},
         { (char *)"CvBoost_swigregister", CvBoost_swigregister, METH_VARARGS, NULL},
         { (char *)"new_CvANN_MLP_TrainParams", _wrap_new_CvANN_MLP_TrainParams, METH_VARARGS, NULL},
         { (char *)"delete_CvANN_MLP_TrainParams", _wrap_delete_CvANN_MLP_TrainParams, METH_VARARGS, NULL},
@@ -36365,53 +49032,118 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"cvRandMVNormal", _wrap_cvRandMVNormal, METH_VARARGS, NULL},
         { (char *)"cvRandGaussMixture", _wrap_cvRandGaussMixture, METH_VARARGS, NULL},
         { (char *)"cvCreateTestSet", _wrap_cvCreateTestSet, METH_VARARGS, NULL},
-        { (char *)"cvCompleteSymm", _wrap_cvCompleteSymm, METH_VARARGS, NULL},
+        { (char *)"new_CvTrainTestSplit", _wrap_new_CvTrainTestSplit, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_mode_set", _wrap_CvTrainTestSplit_train_sample_part_mode_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_mode_get", _wrap_CvTrainTestSplit_train_sample_part_mode_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_mode_set", _wrap_CvTrainTestSplit_class_part_mode_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_mode_get", _wrap_CvTrainTestSplit_class_part_mode_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_mix_set", _wrap_CvTrainTestSplit_mix_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_mix_get", _wrap_CvTrainTestSplit_mix_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_get", _wrap_CvTrainTestSplit_class_part_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_get", _wrap_CvTrainTestSplit_train_sample_part_get, METH_VARARGS, NULL},
+        { (char *)"delete_CvTrainTestSplit", _wrap_delete_CvTrainTestSplit, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_swigregister", CvTrainTestSplit_swigregister, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_count_set", _wrap_CvTrainTestSplit_class_part_count_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_count_get", _wrap_CvTrainTestSplit_class_part_count_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_portion_set", _wrap_CvTrainTestSplit_class_part_portion_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_portion_get", _wrap_CvTrainTestSplit_class_part_portion_get, METH_VARARGS, NULL},
+        { (char *)"new_CvTrainTestSplit_class_part", _wrap_new_CvTrainTestSplit_class_part, METH_VARARGS, NULL},
+        { (char *)"delete_CvTrainTestSplit_class_part", _wrap_delete_CvTrainTestSplit_class_part, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_class_part_swigregister", CvTrainTestSplit_class_part_swigregister, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_count_set", _wrap_CvTrainTestSplit_train_sample_part_count_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_count_get", _wrap_CvTrainTestSplit_train_sample_part_count_get, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_portion_set", _wrap_CvTrainTestSplit_train_sample_part_portion_set, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_portion_get", _wrap_CvTrainTestSplit_train_sample_part_portion_get, METH_VARARGS, NULL},
+        { (char *)"new_CvTrainTestSplit_train_sample_part", _wrap_new_CvTrainTestSplit_train_sample_part, METH_VARARGS, NULL},
+        { (char *)"delete_CvTrainTestSplit_train_sample_part", _wrap_delete_CvTrainTestSplit_train_sample_part, METH_VARARGS, NULL},
+        { (char *)"CvTrainTestSplit_train_sample_part_swigregister", CvTrainTestSplit_train_sample_part_swigregister, METH_VARARGS, NULL},
+        { (char *)"new_CvMLData", _wrap_new_CvMLData, METH_VARARGS, NULL},
+        { (char *)"delete_CvMLData", _wrap_delete_CvMLData, METH_VARARGS, NULL},
+        { (char *)"CvMLData_read_csv", _wrap_CvMLData_read_csv, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_values", _wrap_CvMLData_get_values, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_responses", _wrap_CvMLData_get_responses, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_missing", _wrap_CvMLData_get_missing, METH_VARARGS, NULL},
+        { (char *)"CvMLData_set_response_idx", _wrap_CvMLData_set_response_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_response_idx", _wrap_CvMLData_get_response_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_train_sample_idx", _wrap_CvMLData_get_train_sample_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_test_sample_idx", _wrap_CvMLData_get_test_sample_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_mix_train_and_test_idx", _wrap_CvMLData_mix_train_and_test_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_set_train_test_split", _wrap_CvMLData_set_train_test_split, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_var_idx", _wrap_CvMLData_get_var_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_chahge_var_idx", _wrap_CvMLData_chahge_var_idx, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_var_types", _wrap_CvMLData_get_var_types, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_var_type", _wrap_CvMLData_get_var_type, METH_VARARGS, NULL},
+        { (char *)"CvMLData_set_var_types", _wrap_CvMLData_set_var_types, METH_VARARGS, NULL},
+        { (char *)"CvMLData_change_var_type", _wrap_CvMLData_change_var_type, METH_VARARGS, NULL},
+        { (char *)"CvMLData_set_delimiter", _wrap_CvMLData_set_delimiter, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_delimiter", _wrap_CvMLData_get_delimiter, METH_VARARGS, NULL},
+        { (char *)"CvMLData_set_miss_ch", _wrap_CvMLData_set_miss_ch, METH_VARARGS, NULL},
+        { (char *)"CvMLData_get_miss_ch", _wrap_CvMLData_get_miss_ch, METH_VARARGS, NULL},
+        { (char *)"CvMLData_swigregister", CvMLData_swigregister, METH_VARARGS, NULL},
         { NULL, NULL, 0, NULL }
 };
 
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static void *_p_CvNormalBayesClassifierTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvERTreesTo_p_CvRTrees(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvRTrees *)  ((CvERTrees *) x));
+}
+static void *_p_CvERTreeTrainDataTo_p_CvDTreeTrainData(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvDTreeTrainData *)  ((CvERTreeTrainData *) x));
+}
+static void *_p_CvForestERTreeTo_p_CvForestTree(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvForestTree *)  ((CvForestERTree *) x));
+}
+static void *_p_CvRTParamsTo_p_CvDTreeParams(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvDTreeParams *)  ((CvRTParams *) x));
+}
+static void *_p_CvBoostParamsTo_p_CvDTreeParams(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvDTreeParams *)  ((CvBoostParams *) x));
+}
+static void *_p_CvNormalBayesClassifierTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvNormalBayesClassifier *) x));
 }
-static void *_p_CvSVMTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvSVMTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvSVM *) x));
 }
-static void *_p_CvANN_MLPTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvForestERTreeTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvStatModel *) (CvDTree *)(CvForestTree *) ((CvForestERTree *) x));
+}
+static void *_p_CvANN_MLPTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvANN_MLP *) x));
 }
-static void *_p_CvKNearestTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvKNearestTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvKNearest *) x));
 }
-static void *_p_CvForestTreeTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvForestTreeTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *) (CvDTree *) ((CvForestTree *) x));
 }
-static void *_p_CvRTreesTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvRTreesTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvRTrees *) x));
 }
-static void *_p_CvBoostTreeTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvBoostTreeTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *) (CvDTree *) ((CvBoostTree *) x));
 }
-static void *_p_CvEMTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvERTreesTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvStatModel *) (CvRTrees *) ((CvERTrees *) x));
+}
+static void *_p_CvEMTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvEM *) x));
 }
-static void *_p_CvDTreeTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvDTreeTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvDTree *) x));
 }
-static void *_p_CvBoostTo_p_CvStatModel(void *x, int *newmemory) {
+static void *_p_CvBoostTo_p_CvStatModel(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvStatModel *)  ((CvBoost *) x));
 }
-static void *_p_CvRTParamsTo_p_CvDTreeParams(void *x, int *newmemory) {
-    return (void *)((CvDTreeParams *)  ((CvRTParams *) x));
-}
-static void *_p_CvBoostParamsTo_p_CvDTreeParams(void *x, int *newmemory) {
-    return (void *)((CvDTreeParams *)  ((CvBoostParams *) x));
+static void *_p_CvForestERTreeTo_p_CvDTree(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((CvDTree *) (CvForestTree *) ((CvForestERTree *) x));
 }
-static void *_p_CvForestTreeTo_p_CvDTree(void *x, int *newmemory) {
+static void *_p_CvForestTreeTo_p_CvDTree(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvDTree *)  ((CvForestTree *) x));
 }
-static void *_p_CvBoostTreeTo_p_CvDTree(void *x, int *newmemory) {
+static void *_p_CvBoostTreeTo_p_CvDTree(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CvDTree *)  ((CvBoostTree *) x));
 }
 static swig_type_info _swigt__m_CvSVMKernel__f_int_int_p_p_q_const__float_p_q_const__float_p_float__void = {"_m_CvSVMKernel__f_int_int_p_p_q_const__float_p_q_const__float_p_float__void", "void (CvSVMKernel::*)(int,int,float const **,float const *,float *)|CvSVMKernel::Calc", 0, 0, (void*)0, 0};
@@ -36422,13 +49154,13 @@ static swig_type_info _swigt__p_Calc = {"_p_Calc", "Calc *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CalcRho = {"_p_CalcRho", "CalcRho *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Cv32suf = {"_p_Cv32suf", "Cv32suf *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Cv64suf = {"_p_Cv64suf", "Cv64suf *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvANN_MLP = {"_p_CvANN_MLP", "CvANN_MLP *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvANN_MLP_TrainParams = {"_p_CvANN_MLP_TrainParams", "CvANN_MLP_TrainParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvANN_MLP = {"_p_CvANN_MLP", "CvANN_MLP *|cv::NeuralNet_MLP *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvANN_MLP_TrainParams = {"_p_CvANN_MLP_TrainParams", "CvANN_MLP_TrainParams *|cv::ANN_MLP_TrainParams *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvAttrList = {"_p_CvAttrList", "CvAttrList *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvAvgComp = {"_p_CvAvgComp", "CvAvgComp *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvBoost = {"_p_CvBoost", "CvBoost *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvBoostParams = {"_p_CvBoostParams", "CvBoostParams *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvBoostTree = {"_p_CvBoostTree", "CvBoostTree *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvBoost = {"_p_CvBoost", "CvBoost *|cv::Boost *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvBoostParams = {"_p_CvBoostParams", "CvBoostParams *|cv::BoostParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvBoostTree = {"_p_CvBoostTree", "CvBoostTree *|cv::BoostTree *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvBox2D = {"_p_CvBox2D", "CvBox2D *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvChain = {"_p_CvChain", "CvChain *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvChainPtReader = {"_p_CvChainPtReader", "CvChainPtReader *", 0, 0, (void*)0, 0};
@@ -36437,18 +49169,21 @@ static swig_type_info _swigt__p_CvConnectedComp = {"_p_CvConnectedComp", "CvConn
 static swig_type_info _swigt__p_CvContour = {"_p_CvContour", "CvPoint2DSeq *|CvContour *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvContourTree = {"_p_CvContourTree", "CvContourTree *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvConvexityDefect = {"_p_CvConvexityDefect", "CvConvexityDefect *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvDTree = {"_p_CvDTree", "CvDTree *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvDTree = {"_p_CvDTree", "CvDTree *|cv::DecisionTree *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvDTreeNode = {"_p_CvDTreeNode", "CvDTreeNode *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvDTreeParams = {"_p_CvDTreeParams", "CvDTreeParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvDTreeParams = {"_p_CvDTreeParams", "CvDTreeParams *|cv::DTreeParams *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvDTreeSplit = {"_p_CvDTreeSplit", "CvDTreeSplit *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvDTreeTrainData = {"_p_CvDTreeTrainData", "CvDTreeTrainData *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvEM = {"_p_CvEM", "CvEM *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvEMParams = {"_p_CvEMParams", "CvEMParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvEM = {"_p_CvEM", "cv::ExpectationMaximization *|CvEM *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvEMParams = {"_p_CvEMParams", "CvEMParams *|cv::EMParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvERTreeTrainData = {"_p_CvERTreeTrainData", "CvERTreeTrainData *|cv::ERTreeTRainData *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvERTrees = {"_p_CvERTrees", "CvERTrees *|cv::ERTrees *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvFileNode = {"_p_CvFileNode", "CvFileNode *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvFileStorage = {"_p_CvFileStorage", "CvFileStorage *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvFilter = {"_p_CvFilter", "enum CvFilter *|CvFilter *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvFont = {"_p_CvFont", "CvFont *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvForestTree = {"_p_CvForestTree", "CvForestTree *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvForestERTree = {"_p_CvForestERTree", "CvForestERTree *|cv::ERTree *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvForestTree = {"_p_CvForestTree", "CvForestTree *|cv::ForestTree *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvGenericHash = {"_p_CvGenericHash", "CvGenericHash *|CvFileNodeHash *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvGraph = {"_p_CvGraph", "CvGraph *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvGraphEdge = {"_p_CvGraphEdge", "CvGraphEdge *", 0, 0, (void*)0, 0};
@@ -36462,9 +49197,11 @@ static swig_type_info _swigt__p_CvHaarStageClassifier = {"_p_CvHaarStageClassifi
 static swig_type_info _swigt__p_CvHidHaarClassifierCascade = {"_p_CvHidHaarClassifierCascade", "CvHidHaarClassifierCascade *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvHistogram = {"_p_CvHistogram", "CvHistogram *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvHuMoments = {"_p_CvHuMoments", "CvHuMoments *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvKNearest = {"_p_CvKNearest", "CvKNearest *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvKNearest = {"_p_CvKNearest", "CvKNearest *|cv::KNearest *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvKalman = {"_p_CvKalman", "CvKalman *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvLineIterator = {"_p_CvLineIterator", "CvLineIterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvMLData = {"_p_CvMLData", "CvMLData *|cv::TrainData *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvMSERParams = {"_p_CvMSERParams", "CvMSERParams *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvMat = {"_p_CvMat", "CvMat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvMatND = {"_p_CvMatND", "CvMatND *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvMatrix3 = {"_p_CvMatrix3", "CvMatrix3 *", 0, 0, (void*)0, 0};
@@ -36475,10 +49212,10 @@ static swig_type_info _swigt__p_CvModuleInfo = {"_p_CvModuleInfo", "CvModuleInfo
 static swig_type_info _swigt__p_CvMoments = {"_p_CvMoments", "CvMoments *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvNArrayIterator = {"_p_CvNArrayIterator", "CvNArrayIterator *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvNextEdgeType = {"_p_CvNextEdgeType", "enum CvNextEdgeType *|CvNextEdgeType *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvNormalBayesClassifier = {"_p_CvNormalBayesClassifier", "CvNormalBayesClassifier *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvNormalBayesClassifier = {"_p_CvNormalBayesClassifier", "CvNormalBayesClassifier *|cv::NormalBayesClassifier *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvPOSITObject = {"_p_CvPOSITObject", "CvPOSITObject *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvPair32s32f = {"_p_CvPair32s32f", "CvPair32s32f *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvParamGrid = {"_p_CvParamGrid", "CvParamGrid *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvPair16u32s = {"_p_CvPair16u32s", "CvPair16u32s *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvParamGrid = {"_p_CvParamGrid", "CvParamGrid *|cv::ParamGrid *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvPluginFuncInfo = {"_p_CvPluginFuncInfo", "CvPluginFuncInfo *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvPoint = {"_p_CvPoint", "CvPoint *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvPoint2D32f = {"_p_CvPoint2D32f", "CvPoint2D32f *", 0, 0, (void*)0, 0};
@@ -36487,16 +49224,18 @@ static swig_type_info _swigt__p_CvPoint3D32f = {"_p_CvPoint3D32f", "CvPoint3D32f
 static swig_type_info _swigt__p_CvPoint3D64f = {"_p_CvPoint3D64f", "CvPoint3D64f *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvQuadEdge2D = {"_p_CvQuadEdge2D", "CvQuadEdge2D *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvRNG_Wrapper = {"_p_CvRNG_Wrapper", "CvRNG_Wrapper *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvRTParams = {"_p_CvRTParams", "CvRTParams *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvRTrees = {"_p_CvRTrees", "CvRTrees *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvRTParams = {"_p_CvRTParams", "CvRTParams *|cv::RandomTreeParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvRTrees = {"_p_CvRTrees", "CvRTrees *|cv::RandomTrees *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvRect = {"_p_CvRect", "CvRect *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvSVM = {"_p_CvSVM", "CvSVM *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSURFParams = {"_p_CvSURFParams", "CvSURFParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSURFPoint = {"_p_CvSURFPoint", "CvSURFPoint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSVM = {"_p_CvSVM", "CvSVM *|cv::SVM *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSVMDecisionFunc = {"_p_CvSVMDecisionFunc", "CvSVMDecisionFunc *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvSVMKernel = {"_p_CvSVMKernel", "CvSVMKernel *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSVMKernel = {"_p_CvSVMKernel", "CvSVMKernel *|cv::SVMKernel *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSVMKernelRow = {"_p_CvSVMKernelRow", "CvSVMKernelRow *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvSVMParams = {"_p_CvSVMParams", "CvSVMParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSVMParams = {"_p_CvSVMParams", "CvSVMParams *|cv::SVMParams *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSVMSolutionInfo = {"_p_CvSVMSolutionInfo", "CvSVMSolutionInfo *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvSVMSolver = {"_p_CvSVMSolver", "CvSVMSolver *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvSVMSolver = {"_p_CvSVMSolver", "CvSVMSolver *|cv::SVMSolver *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvScalar = {"_p_CvScalar", "CvScalar *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSeq = {"_p_CvSeq", "CvSeq *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSeqBlock = {"_p_CvSeqBlock", "CvSeqBlock *", 0, 0, (void*)0, 0};
@@ -36510,7 +49249,11 @@ static swig_type_info _swigt__p_CvSlice = {"_p_CvSlice", "CvSlice *", 0, 0, (voi
 static swig_type_info _swigt__p_CvSparseMat = {"_p_CvSparseMat", "CvSparseMat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSparseMatIterator = {"_p_CvSparseMatIterator", "CvSparseMatIterator *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSparseNode = {"_p_CvSparseNode", "CvSparseNode *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_CvStatModel = {"_p_CvStatModel", "CvStatModel *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvStarDetectorParams = {"_p_CvStarDetectorParams", "CvStarDetectorParams *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvStarKeypoint = {"_p_CvStarKeypoint", "CvStarKeypoint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvStatModel = {"_p_CvStatModel", "CvStatModel *|cv::StatModel *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvStereoBMState = {"_p_CvStereoBMState", "CvStereoBMState *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvStereoGCState = {"_p_CvStereoGCState", "CvStereoGCState *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvString = {"_p_CvString", "CvString *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvStringHashNode = {"_p_CvStringHashNode", "CvStringHashNode *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSubdiv2D = {"_p_CvSubdiv2D", "CvSubdiv2D *", 0, 0, (void*)0, 0};
@@ -36518,6 +49261,9 @@ static swig_type_info _swigt__p_CvSubdiv2DEdge_Wrapper = {"_p_CvSubdiv2DEdge_Wra
 static swig_type_info _swigt__p_CvSubdiv2DPoint = {"_p_CvSubdiv2DPoint", "CvSubdiv2DPoint *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvSubdiv2DPointLocation = {"_p_CvSubdiv2DPointLocation", "enum CvSubdiv2DPointLocation *|CvSubdiv2DPointLocation *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvTermCriteria = {"_p_CvTermCriteria", "CvTermCriteria *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvTrainTestSplit = {"_p_CvTrainTestSplit", "CvTrainTestSplit *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvTrainTestSplit_class_part = {"_p_CvTrainTestSplit_class_part", "CvTrainTestSplit_class_part *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CvTrainTestSplit_train_sample_part = {"_p_CvTrainTestSplit_train_sample_part", "CvTrainTestSplit_train_sample_part *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvTreeNodeIterator = {"_p_CvTreeNodeIterator", "CvTreeNodeIterator *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvTypeInfo = {"_p_CvTypeInfo", "CvTypeInfo *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_CvVectors = {"_p_CvVectors", "CvVectors *", 0, 0, (void*)0, 0};
@@ -36534,16 +49280,20 @@ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_int = {"_p_int", "CvHistType *|int *|CVStatus *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_long_long = {"_p_long_long", "int64 *|long long *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *|int64 *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_CvMat = {"_p_p_CvMat", "CvMat **", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_float = {"_p_p_float", "float **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_int = {"_p_p_int", "int **", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_unsigned_char = {"_p_p_unsigned_char", "unsigned char **|uchar **", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "schar *|signed char *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *|CvSubdiv2DEdge *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *|uint64 *|CvRNG *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "uchar *|unsigned char *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint64 *|unsigned long long *|CvRNG *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|ushort *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_vectorT_float_t = {"_p_vectorT_float_t", "vector< float > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_vectorT_vectorT_float_t_t = {"_p_vectorT_vectorT_float_t_t", "vector< vector< float > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_vectorT_vectorT_int_t_t = {"_p_vectorT_vectorT_int_t_t", "vector< vector< int > > *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_void = {"_p_void", "CvArr *|void *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
@@ -36577,10 +49327,13 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvDTreeTrainData,
   &_swigt__p_CvEM,
   &_swigt__p_CvEMParams,
+  &_swigt__p_CvERTreeTrainData,
+  &_swigt__p_CvERTrees,
   &_swigt__p_CvFileNode,
   &_swigt__p_CvFileStorage,
   &_swigt__p_CvFilter,
   &_swigt__p_CvFont,
+  &_swigt__p_CvForestERTree,
   &_swigt__p_CvForestTree,
   &_swigt__p_CvGenericHash,
   &_swigt__p_CvGraph,
@@ -36598,6 +49351,8 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvKNearest,
   &_swigt__p_CvKalman,
   &_swigt__p_CvLineIterator,
+  &_swigt__p_CvMLData,
+  &_swigt__p_CvMSERParams,
   &_swigt__p_CvMat,
   &_swigt__p_CvMatND,
   &_swigt__p_CvMatrix3,
@@ -36610,7 +49365,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvNextEdgeType,
   &_swigt__p_CvNormalBayesClassifier,
   &_swigt__p_CvPOSITObject,
-  &_swigt__p_CvPair32s32f,
+  &_swigt__p_CvPair16u32s,
   &_swigt__p_CvParamGrid,
   &_swigt__p_CvPluginFuncInfo,
   &_swigt__p_CvPoint,
@@ -36623,6 +49378,8 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvRTParams,
   &_swigt__p_CvRTrees,
   &_swigt__p_CvRect,
+  &_swigt__p_CvSURFParams,
+  &_swigt__p_CvSURFPoint,
   &_swigt__p_CvSVM,
   &_swigt__p_CvSVMDecisionFunc,
   &_swigt__p_CvSVMKernel,
@@ -36643,7 +49400,11 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvSparseMat,
   &_swigt__p_CvSparseMatIterator,
   &_swigt__p_CvSparseNode,
+  &_swigt__p_CvStarDetectorParams,
+  &_swigt__p_CvStarKeypoint,
   &_swigt__p_CvStatModel,
+  &_swigt__p_CvStereoBMState,
+  &_swigt__p_CvStereoGCState,
   &_swigt__p_CvString,
   &_swigt__p_CvStringHashNode,
   &_swigt__p_CvSubdiv2D,
@@ -36651,6 +49412,9 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_CvSubdiv2DPoint,
   &_swigt__p_CvSubdiv2DPointLocation,
   &_swigt__p_CvTermCriteria,
+  &_swigt__p_CvTrainTestSplit,
+  &_swigt__p_CvTrainTestSplit_class_part,
+  &_swigt__p_CvTrainTestSplit_train_sample_part,
   &_swigt__p_CvTreeNodeIterator,
   &_swigt__p_CvTypeInfo,
   &_swigt__p_CvVectors,
@@ -36667,16 +49431,20 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_double,
   &_swigt__p_float,
   &_swigt__p_int,
-  &_swigt__p_long_long,
+  &_swigt__p_int64_t,
   &_swigt__p_p_CvMat,
   &_swigt__p_p_double,
   &_swigt__p_p_float,
+  &_swigt__p_p_int,
   &_swigt__p_p_unsigned_char,
   &_swigt__p_signed_char,
   &_swigt__p_size_t,
+  &_swigt__p_uint64_t,
   &_swigt__p_unsigned_char,
-  &_swigt__p_unsigned_long_long,
   &_swigt__p_unsigned_short,
+  &_swigt__p_vectorT_float_t,
+  &_swigt__p_vectorT_vectorT_float_t_t,
+  &_swigt__p_vectorT_vectorT_int_t_t,
   &_swigt__p_void,
 };
 
@@ -36703,18 +49471,21 @@ static swig_cast_info _swigc__p_CvConnectedComp[] = {  {&_swigt__p_CvConnectedCo
 static swig_cast_info _swigc__p_CvContour[] = {  {&_swigt__p_CvContour, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvContourTree[] = {  {&_swigt__p_CvContourTree, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvConvexityDefect[] = {  {&_swigt__p_CvConvexityDefect, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvDTree[] = {  {&_swigt__p_CvForestTree, _p_CvForestTreeTo_p_CvDTree, 0, 0},  {&_swigt__p_CvBoostTree, _p_CvBoostTreeTo_p_CvDTree, 0, 0},  {&_swigt__p_CvDTree, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvDTree[] = {  {&_swigt__p_CvForestERTree, _p_CvForestERTreeTo_p_CvDTree, 0, 0},  {&_swigt__p_CvForestTree, _p_CvForestTreeTo_p_CvDTree, 0, 0},  {&_swigt__p_CvBoostTree, _p_CvBoostTreeTo_p_CvDTree, 0, 0},  {&_swigt__p_CvDTree, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvDTreeNode[] = {  {&_swigt__p_CvDTreeNode, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvDTreeParams[] = {  {&_swigt__p_CvRTParams, _p_CvRTParamsTo_p_CvDTreeParams, 0, 0},  {&_swigt__p_CvBoostParams, _p_CvBoostParamsTo_p_CvDTreeParams, 0, 0},  {&_swigt__p_CvDTreeParams, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvDTreeSplit[] = {  {&_swigt__p_CvDTreeSplit, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvDTreeTrainData[] = {  {&_swigt__p_CvDTreeTrainData, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvDTreeTrainData[] = {  {&_swigt__p_CvDTreeTrainData, 0, 0, 0},  {&_swigt__p_CvERTreeTrainData, _p_CvERTreeTrainDataTo_p_CvDTreeTrainData, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvEM[] = {  {&_swigt__p_CvEM, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvEMParams[] = {  {&_swigt__p_CvEMParams, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvERTreeTrainData[] = {  {&_swigt__p_CvERTreeTrainData, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvERTrees[] = {  {&_swigt__p_CvERTrees, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvFileNode[] = {  {&_swigt__p_CvFileNode, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvFileStorage[] = {  {&_swigt__p_CvFileStorage, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvFilter[] = {  {&_swigt__p_CvFilter, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvFont[] = {  {&_swigt__p_CvFont, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvForestTree[] = {  {&_swigt__p_CvForestTree, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvForestERTree[] = {  {&_swigt__p_CvForestERTree, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvForestTree[] = {  {&_swigt__p_CvForestERTree, _p_CvForestERTreeTo_p_CvForestTree, 0, 0},  {&_swigt__p_CvForestTree, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvGenericHash[] = {  {&_swigt__p_CvGenericHash, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvGraph[] = {  {&_swigt__p_CvGraph, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvGraphEdge[] = {  {&_swigt__p_CvGraphEdge, 0, 0, 0},{0, 0, 0, 0}};
@@ -36731,6 +49502,8 @@ static swig_cast_info _swigc__p_CvHuMoments[] = {  {&_swigt__p_CvHuMoments, 0, 0
 static swig_cast_info _swigc__p_CvKNearest[] = {  {&_swigt__p_CvKNearest, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvKalman[] = {  {&_swigt__p_CvKalman, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvLineIterator[] = {  {&_swigt__p_CvLineIterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvMLData[] = {  {&_swigt__p_CvMLData, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvMSERParams[] = {  {&_swigt__p_CvMSERParams, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvMat[] = {  {&_swigt__p_CvMat, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvMatND[] = {  {&_swigt__p_CvMatND, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvMatrix3[] = {  {&_swigt__p_CvMatrix3, 0, 0, 0},{0, 0, 0, 0}};
@@ -36743,7 +49516,7 @@ static swig_cast_info _swigc__p_CvNArrayIterator[] = {  {&_swigt__p_CvNArrayIter
 static swig_cast_info _swigc__p_CvNextEdgeType[] = {  {&_swigt__p_CvNextEdgeType, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvNormalBayesClassifier[] = {  {&_swigt__p_CvNormalBayesClassifier, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvPOSITObject[] = {  {&_swigt__p_CvPOSITObject, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvPair32s32f[] = {  {&_swigt__p_CvPair32s32f, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvPair16u32s[] = {  {&_swigt__p_CvPair16u32s, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvParamGrid[] = {  {&_swigt__p_CvParamGrid, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvPluginFuncInfo[] = {  {&_swigt__p_CvPluginFuncInfo, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvPoint[] = {  {&_swigt__p_CvPoint, 0, 0, 0},{0, 0, 0, 0}};
@@ -36754,8 +49527,10 @@ static swig_cast_info _swigc__p_CvPoint3D64f[] = {  {&_swigt__p_CvPoint3D64f, 0,
 static swig_cast_info _swigc__p_CvQuadEdge2D[] = {  {&_swigt__p_CvQuadEdge2D, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvRNG_Wrapper[] = {  {&_swigt__p_CvRNG_Wrapper, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvRTParams[] = {  {&_swigt__p_CvRTParams, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvRTrees[] = {  {&_swigt__p_CvRTrees, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvRTrees[] = {  {&_swigt__p_CvRTrees, 0, 0, 0},  {&_swigt__p_CvERTrees, _p_CvERTreesTo_p_CvRTrees, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvRect[] = {  {&_swigt__p_CvRect, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvSURFParams[] = {  {&_swigt__p_CvSURFParams, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvSURFPoint[] = {  {&_swigt__p_CvSURFPoint, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSVM[] = {  {&_swigt__p_CvSVM, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSVMDecisionFunc[] = {  {&_swigt__p_CvSVMDecisionFunc, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSVMKernel[] = {  {&_swigt__p_CvSVMKernel, 0, 0, 0},{0, 0, 0, 0}};
@@ -36776,7 +49551,11 @@ static swig_cast_info _swigc__p_CvSlice[] = {  {&_swigt__p_CvSlice, 0, 0, 0},{0,
 static swig_cast_info _swigc__p_CvSparseMat[] = {  {&_swigt__p_CvSparseMat, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSparseMatIterator[] = {  {&_swigt__p_CvSparseMatIterator, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSparseNode[] = {  {&_swigt__p_CvSparseNode, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CvStatModel[] = {  {&_swigt__p_CvNormalBayesClassifier, _p_CvNormalBayesClassifierTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvANN_MLP, _p_CvANN_MLPTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvStatModel, 0, 0, 0},  {&_swigt__p_CvKNearest, _p_CvKNearestTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvForestTree, _p_CvForestTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvRTrees, _p_CvRTreesTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvBoostTree, _p_CvBoostTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvEM, _p_CvEMTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvSVM, _p_CvSVMTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvDTree, _p_CvDTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvBoost, _p_CvBoostTo_p_CvStatModel, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvStarDetectorParams[] = {  {&_swigt__p_CvStarDetectorParams, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvStarKeypoint[] = {  {&_swigt__p_CvStarKeypoint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvStatModel[] = {  {&_swigt__p_CvNormalBayesClassifier, _p_CvNormalBayesClassifierTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvForestERTree, _p_CvForestERTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvANN_MLP, _p_CvANN_MLPTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvStatModel, 0, 0, 0},  {&_swigt__p_CvKNearest, _p_CvKNearestTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvForestTree, _p_CvForestTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvRTrees, _p_CvRTreesTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvBoostTree, _p_CvBoostTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvERTrees, _p_CvERTreesTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvEM, _p_CvEMTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvSVM, _p_CvSVMTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvDTree, _p_CvDTreeTo_p_CvStatModel, 0, 0},  {&_swigt__p_CvBoost, _p_CvBoostTo_p_CvStatModel, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvStereoBMState[] = {  {&_swigt__p_CvStereoBMState, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvStereoGCState[] = {  {&_swigt__p_CvStereoGCState, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvString[] = {  {&_swigt__p_CvString, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvStringHashNode[] = {  {&_swigt__p_CvStringHashNode, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSubdiv2D[] = {  {&_swigt__p_CvSubdiv2D, 0, 0, 0},{0, 0, 0, 0}};
@@ -36784,6 +49563,9 @@ static swig_cast_info _swigc__p_CvSubdiv2DEdge_Wrapper[] = {  {&_swigt__p_CvSubd
 static swig_cast_info _swigc__p_CvSubdiv2DPoint[] = {  {&_swigt__p_CvSubdiv2DPoint, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvSubdiv2DPointLocation[] = {  {&_swigt__p_CvSubdiv2DPointLocation, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvTermCriteria[] = {  {&_swigt__p_CvTermCriteria, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvTrainTestSplit[] = {  {&_swigt__p_CvTrainTestSplit, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvTrainTestSplit_class_part[] = {  {&_swigt__p_CvTrainTestSplit_class_part, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CvTrainTestSplit_train_sample_part[] = {  {&_swigt__p_CvTrainTestSplit_train_sample_part, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvTreeNodeIterator[] = {  {&_swigt__p_CvTreeNodeIterator, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvTypeInfo[] = {  {&_swigt__p_CvTypeInfo, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_CvVectors[] = {  {&_swigt__p_CvVectors, 0, 0, 0},{0, 0, 0, 0}};
@@ -36800,16 +49582,20 @@ static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0,
 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int64_t[] = {  {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_CvMat[] = {  {&_swigt__p_p_CvMat, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_float[] = {  {&_swigt__p_p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_int[] = {  {&_swigt__p_p_int, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_p_unsigned_char[] = {  {&_swigt__p_p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_uint64_t[] = {  {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_vectorT_float_t[] = {  {&_swigt__p_vectorT_float_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_vectorT_vectorT_float_t_t[] = {  {&_swigt__p_vectorT_vectorT_float_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_vectorT_vectorT_int_t_t[] = {  {&_swigt__p_vectorT_vectorT_int_t_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
@@ -36843,10 +49629,13 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvDTreeTrainData,
   _swigc__p_CvEM,
   _swigc__p_CvEMParams,
+  _swigc__p_CvERTreeTrainData,
+  _swigc__p_CvERTrees,
   _swigc__p_CvFileNode,
   _swigc__p_CvFileStorage,
   _swigc__p_CvFilter,
   _swigc__p_CvFont,
+  _swigc__p_CvForestERTree,
   _swigc__p_CvForestTree,
   _swigc__p_CvGenericHash,
   _swigc__p_CvGraph,
@@ -36864,6 +49653,8 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvKNearest,
   _swigc__p_CvKalman,
   _swigc__p_CvLineIterator,
+  _swigc__p_CvMLData,
+  _swigc__p_CvMSERParams,
   _swigc__p_CvMat,
   _swigc__p_CvMatND,
   _swigc__p_CvMatrix3,
@@ -36876,7 +49667,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvNextEdgeType,
   _swigc__p_CvNormalBayesClassifier,
   _swigc__p_CvPOSITObject,
-  _swigc__p_CvPair32s32f,
+  _swigc__p_CvPair16u32s,
   _swigc__p_CvParamGrid,
   _swigc__p_CvPluginFuncInfo,
   _swigc__p_CvPoint,
@@ -36889,6 +49680,8 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvRTParams,
   _swigc__p_CvRTrees,
   _swigc__p_CvRect,
+  _swigc__p_CvSURFParams,
+  _swigc__p_CvSURFPoint,
   _swigc__p_CvSVM,
   _swigc__p_CvSVMDecisionFunc,
   _swigc__p_CvSVMKernel,
@@ -36909,7 +49702,11 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvSparseMat,
   _swigc__p_CvSparseMatIterator,
   _swigc__p_CvSparseNode,
+  _swigc__p_CvStarDetectorParams,
+  _swigc__p_CvStarKeypoint,
   _swigc__p_CvStatModel,
+  _swigc__p_CvStereoBMState,
+  _swigc__p_CvStereoGCState,
   _swigc__p_CvString,
   _swigc__p_CvStringHashNode,
   _swigc__p_CvSubdiv2D,
@@ -36917,6 +49714,9 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_CvSubdiv2DPoint,
   _swigc__p_CvSubdiv2DPointLocation,
   _swigc__p_CvTermCriteria,
+  _swigc__p_CvTrainTestSplit,
+  _swigc__p_CvTrainTestSplit_class_part,
+  _swigc__p_CvTrainTestSplit_train_sample_part,
   _swigc__p_CvTreeNodeIterator,
   _swigc__p_CvTypeInfo,
   _swigc__p_CvVectors,
@@ -36933,16 +49733,20 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_double,
   _swigc__p_float,
   _swigc__p_int,
-  _swigc__p_long_long,
+  _swigc__p_int64_t,
   _swigc__p_p_CvMat,
   _swigc__p_p_double,
   _swigc__p_p_float,
+  _swigc__p_p_int,
   _swigc__p_p_unsigned_char,
   _swigc__p_signed_char,
   _swigc__p_size_t,
+  _swigc__p_uint64_t,
   _swigc__p_unsigned_char,
-  _swigc__p_unsigned_long_long,
   _swigc__p_unsigned_short,
+  _swigc__p_vectorT_float_t,
+  _swigc__p_vectorT_vectorT_float_t_t,
+  _swigc__p_vectorT_vectorT_int_t_t,
   _swigc__p_void,
 };
 
@@ -37221,26 +50025,58 @@ extern "C" {
   
   SWIGINTERN PyObject *
   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+    return PyUnicode_InternFromString("<Swig global variables>");
+#else
     return PyString_FromString("<Swig global variables>");
+#endif
   }
   
   SWIGINTERN PyObject *
   swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *str = PyUnicode_InternFromString("(");
+    PyObject *tail;
+    PyObject *joined;
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      tail = PyUnicode_FromString(var->name);
+      joined = PyUnicode_Concat(str, tail);
+      Py_DecRef(str);
+      Py_DecRef(tail);
+      str = joined;
+      if (var->next) {
+        tail = PyUnicode_InternFromString(", ");
+        joined = PyUnicode_Concat(str, tail);
+        Py_DecRef(str);
+        Py_DecRef(tail);
+        str = joined;
+      }
+    }
+    tail = PyUnicode_InternFromString(")");
+    joined = PyUnicode_Concat(str, tail);
+    Py_DecRef(str);
+    Py_DecRef(tail);
+    str = joined;
+#else
     PyObject *str = PyString_FromString("(");
-    swig_globalvar  *var;
+    swig_globalvar *var;
     for (var = v->vars; var; var=var->next) {
       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
     }
     PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
     return str;
   }
   
   SWIGINTERN int
   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    char *tmp;
     PyObject *str = swig_varlink_str(v);
     fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", PyString_AsString(str));
+    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(str);
     return 0;
   }
@@ -37298,12 +50134,17 @@ extern "C" {
     if (!type_init) {
       const PyTypeObject tmp
       = {
+        /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+        PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
         PyObject_HEAD_INIT(NULL)
         0,                                  /* Number of items in variable part (ob_size) */
+#endif
         (char *)"swigvarlink",              /* Type name (tp_name) */
         sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
         0,                                  /* Itemsize (tp_itemsize) */
-        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
+        (destructor) swig_varlink_dealloc,  /* Deallocator (tp_dealloc) */ 
         (printfunc) swig_varlink_print,     /* Print (tp_print) */
         (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
         (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
@@ -37314,7 +50155,7 @@ extern "C" {
         0,                                  /* tp_as_mapping */
         0,                                  /* tp_hash */
         0,                                  /* tp_call */
-        (reprfunc)swig_varlink_str,        /* tp_str */
+        (reprfunc) swig_varlink_str,        /* tp_str */
         0,                                  /* tp_getattro */
         0,                                  /* tp_setattro */
         0,                                  /* tp_as_buffer */
@@ -37335,7 +50176,10 @@ extern "C" {
 #endif
       };
       varlink_type = tmp;
+      /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
       varlink_type.ob_type = &PyType_Type;
+#endif
       type_init = 1;
     }
     return &varlink_type;
@@ -37460,13 +50304,37 @@ extern "C" {
 #ifdef __cplusplus
 extern "C"
 #endif
-SWIGEXPORT void SWIG_init(void) {
-  PyObject *m, *d;
+
+SWIGEXPORT 
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+  PyObject *m, *d;  
+#if PY_VERSION_HEX >= 0x03000000
+  static struct PyModuleDef SWIG_module = {
+    PyModuleDef_HEAD_INIT,
+    (char *) SWIG_name,
+    NULL,
+    -1,
+    SwigMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  };
+#endif
   
   /* Fix SwigMethods to carry the callback ptrs when needed */
   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
   
+#if PY_VERSION_HEX >= 0x03000000
+  m = PyModule_Create(&SWIG_module);
+#else
   m = Py_InitModule((char *) SWIG_name, SwigMethods);
+#endif
   d = PyModule_GetDict(m);
   
   SWIG_InitializeModule(0);
@@ -37488,6 +50356,8 @@ SWIGEXPORT void SWIG_init(void) {
   SWIG_Python_SetConstant(d, "CV_TYPE_NAME_ML_ANN_MLP",SWIG_FromCharPtr("opencv-ml-ann-mlp"));
   SWIG_Python_SetConstant(d, "CV_TYPE_NAME_ML_CNN",SWIG_FromCharPtr("opencv-ml-cnn"));
   SWIG_Python_SetConstant(d, "CV_TYPE_NAME_ML_RTREES",SWIG_FromCharPtr("opencv-ml-random-trees"));
+  SWIG_Python_SetConstant(d, "CV_TRAIN_ERROR",SWIG_From_int(static_cast< int >(0)));
+  SWIG_Python_SetConstant(d, "CV_TEST_ERROR",SWIG_From_int(static_cast< int >(1)));
   SWIG_Python_SetConstant(d, "CvParamGrid_SVM_C",SWIG_From_int(static_cast< int >(CvParamGrid::SVM_C)));
   SWIG_Python_SetConstant(d, "CvParamGrid_SVM_GAMMA",SWIG_From_int(static_cast< int >(CvParamGrid::SVM_GAMMA)));
   SWIG_Python_SetConstant(d, "CvParamGrid_SVM_P",SWIG_From_int(static_cast< int >(CvParamGrid::SVM_P)));
@@ -37532,5 +50402,12 @@ SWIGEXPORT void SWIG_init(void) {
   SWIG_Python_SetConstant(d, "CvANN_MLP_NO_INPUT_SCALE",SWIG_From_int(static_cast< int >(CvANN_MLP::NO_INPUT_SCALE)));
   SWIG_Python_SetConstant(d, "CvANN_MLP_NO_OUTPUT_SCALE",SWIG_From_int(static_cast< int >(CvANN_MLP::NO_OUTPUT_SCALE)));
   SWIG_Python_SetConstant(d, "CV_TS_CONCENTRIC_SPHERES",SWIG_From_int(static_cast< int >(0)));
+  SWIG_Python_SetConstant(d, "CV_COUNT",SWIG_From_int(static_cast< int >(0)));
+  SWIG_Python_SetConstant(d, "CV_PORTION",SWIG_From_int(static_cast< int >(1)));
+#if PY_VERSION_HEX >= 0x03000000
+  return m;
+#else
+  return;
+#endif
 }