diff --git a/scikits/image/graph/spath.c b/scikits/image/graph/spath.c deleted file mode 100644 index 48ac8a0e..00000000 --- a/scikits/image/graph/spath.c +++ /dev/null @@ -1,5621 +0,0 @@ -/* Generated by Cython 0.11.3 on Tue Nov 3 08:57:50 2009 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - #define PyBytes_CheckExact PyString_CheckExact - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyUnicode_Type - #define PyString_CheckExact PyUnicode_CheckExact - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__scikits__image__analysis__spath -#include "stdlib.h" -#include "stdio.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#include "math.h" - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - - -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - #else - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - #endif -#else - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - #else - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - #endif -#else - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< long double > __pyx_t_long_double_complex; - #else - typedef long double _Complex __pyx_t_long_double_complex; - #endif -#else - typedef struct { long double real, imag; } __pyx_t_long_double_complex; -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double); - #else - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double); - #endif -#else - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double); -#endif - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef __pyx_t_float_complex __pyx_t_5numpy_complex64_t; - -typedef __pyx_t_double_complex __pyx_t_5numpy_complex128_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":9 - * double fabs(double f) - * - * cpdef shortest_path(np.ndarray arr, int reach=1): # <<<<<<<<<<<<<< - * """Find the shortest left-to-right path through an array. - * - */ - -struct __pyx_opt_args_7scikits_5image_8analysis_5spath_shortest_path { - int __pyx_n; - int reach; -}; - -#ifdef CYTHON_REFNANNY -typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*NewContext)(const char*, int, const char*); - void (*FinishContext)(void**); -} __Pyx_RefnannyAPIStruct; -static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; -#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI") -#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__) -#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk) -#else -#define __Pyx_INCREF(r) Py_INCREF(r) -#define __Pyx_DECREF(r) Py_DECREF(r) -#define __Pyx_GOTREF(r) -#define __Pyx_GIVEREF(r) -#define __Pyx_XDECREF(r) Py_XDECREF(r) -#define __Pyx_SetupRefcountContext(name) -#define __Pyx_FinishRefcountContext() -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -/* Run-time type information about structs used with buffers */ -struct __Pyx_StructField_; - -typedef struct { - const char* name; /* for error messages only */ - struct __Pyx_StructField_* fields; - size_t size; /* sizeof(type) */ - char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */ -} __Pyx_TypeInfo; - -typedef struct __Pyx_StructField_ { - __Pyx_TypeInfo* type; - const char* name; - size_t offset; -} __Pyx_StructField; - -typedef struct { - __Pyx_StructField* field; - size_t parent_offset; -} __Pyx_BufFmt_StackElem; - - -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); -static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ -#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) -#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static INLINE void __Pyx_RaiseTooManyValuesError(void); - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static INLINE void __Pyx_RaiseNoneNotIterableError(void); - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); -static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else -#define __Pyx_GetBuffer PyObject_GetBuffer -#define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - -Py_ssize_t __Pyx_zeros[] = {0, 0}; -Py_ssize_t __Pyx_minusones[] = {-1, -1}; - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_Print(PyObject *, int); /*proto*/ -#if PY_MAJOR_VERSION >= 3 -static PyObject* __pyx_print = 0; -static PyObject* __pyx_print_kwargs = 0; -#endif - -static int __Pyx_PrintOne(PyObject *o); /*proto*/ - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif - -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==0.0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - /*#define __Pyx_c_absf(z) (::std::abs(z))*/ - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - /*#define __Pyx_c_absf(z) (cabsf(z))*/ - #endif -#else - static INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - /*static INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/ -#endif - -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==0.0) - #define __Pyx_c_conj(z) (::std::conj(z)) - /*#define __Pyx_c_abs(z) (::std::abs(z))*/ - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - /*#define __Pyx_c_abs(z) (cabs(z))*/ - #endif -#else - static INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - /*static INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/ -#endif - -#if CYTHON_CCOMPLEX - #define __Pyx_c_eql(a, b) ((a)==(b)) - #define __Pyx_c_suml(a, b) ((a)+(b)) - #define __Pyx_c_diffl(a, b) ((a)-(b)) - #define __Pyx_c_prodl(a, b) ((a)*(b)) - #define __Pyx_c_quotl(a, b) ((a)/(b)) - #define __Pyx_c_negl(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerol(z) ((z)==0.0) - #define __Pyx_c_conjl(z) (::std::conj(z)) - /*#define __Pyx_c_absl(z) (::std::abs(z))*/ - #else - #define __Pyx_c_is_zerol(z) ((z)==0) - #define __Pyx_c_conjl(z) (conjl(z)) - /*#define __Pyx_c_absl(z) (cabsl(z))*/ - #endif -#else - static INLINE int __Pyx_c_eql(__pyx_t_long_double_complex, __pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_suml(__pyx_t_long_double_complex, __pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_diffl(__pyx_t_long_double_complex, __pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_prodl(__pyx_t_long_double_complex, __pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_quotl(__pyx_t_long_double_complex, __pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_negl(__pyx_t_long_double_complex); - static INLINE int __Pyx_c_is_zerol(__pyx_t_long_double_complex); - static INLINE __pyx_t_long_double_complex __Pyx_c_conjl(__pyx_t_long_double_complex); - /*static INLINE long double __Pyx_c_absl(__pyx_t_long_double_complex);*/ -#endif - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_buffer */ - -/* Module declarations from python_object */ - -/* Module declarations from stdlib */ - -/* Module declarations from stdio */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/ -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/ -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/ -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ -/* Module declarations from scikits.image.analysis.spath */ - -static PyObject *__pyx_f_7scikits_5image_8analysis_5spath_shortest_path(PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7scikits_5image_8analysis_5spath_shortest_path *__pyx_optional_args); /*proto*/ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "numpy.double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "numpy.int_t", NULL, sizeof(__pyx_t_5numpy_int_t), 'I' }; -#define __Pyx_MODULE_NAME "scikits.image.analysis.spath" -int __pyx_module_is_main_scikits__image__analysis__spath = 0; - -/* Implementation of scikits.image.analysis.spath */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_1[] = "Expected 2-D array as input"; -static char __pyx_k_2[] = "ndarray is not C contiguous"; -static char __pyx_k_3[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_4[] = ">"; -static char __pyx_k_5[] = "<"; -static char __pyx_k_6[] = "Non-native byte order not supported"; -static char __pyx_k_7[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_8[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_9[] = "Format string allocated too short."; -static char __pyx_k_10[] = "shortest_path (line 9)"; -static char __pyx_k__B[] = "B"; -static char __pyx_k__H[] = "H"; -static char __pyx_k__I[] = "I"; -static char __pyx_k__L[] = "L"; -static char __pyx_k__O[] = "O"; -static char __pyx_k__Q[] = "Q"; -static char __pyx_k__b[] = "b"; -static char __pyx_k__d[] = "d"; -static char __pyx_k__f[] = "f"; -static char __pyx_k__g[] = "g"; -static char __pyx_k__h[] = "h"; -static char __pyx_k__i[] = "i"; -static char __pyx_k__l[] = "l"; -static char __pyx_k__q[] = "q"; -static char __pyx_k__Zd[] = "Zd"; -static char __pyx_k__Zf[] = "Zf"; -static char __pyx_k__Zg[] = "Zg"; -static char __pyx_k__np[] = "np"; -static char __pyx_k__arr[] = "arr"; -static char __pyx_k__buf[] = "buf"; -static char __pyx_k__obj[] = "obj"; -static char __pyx_k__ndim[] = "ndim"; -static char __pyx_k__descr[] = "descr"; -static char __pyx_k__dtype[] = "dtype"; -static char __pyx_k__empty[] = "empty"; -static char __pyx_k__names[] = "names"; -static char __pyx_k__numpy[] = "numpy"; -static char __pyx_k__range[] = "range"; -static char __pyx_k__reach[] = "reach"; -static char __pyx_k__shape[] = "shape"; -static char __pyx_k__argmin[] = "argmin"; -static char __pyx_k__double[] = "double"; -static char __pyx_k__fields[] = "fields"; -static char __pyx_k__format[] = "format"; -static char __pyx_k__strides[] = "strides"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__itemsize[] = "itemsize"; -static char __pyx_k__readonly[] = "readonly"; -static char __pyx_k__type_num[] = "type_num"; -static char __pyx_k__byteorder[] = "byteorder"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__suboffsets[] = "suboffsets"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k__shortest_path[] = "shortest_path"; -static char __pyx_k__ascontiguousarray[] = "ascontiguousarray"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_u_10; -static PyObject *__pyx_kp_u_2; -static PyObject *__pyx_kp_u_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_u_6; -static PyObject *__pyx_kp_u_7; -static PyObject *__pyx_kp_u_8; -static PyObject *__pyx_kp_u_9; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s__argmin; -static PyObject *__pyx_n_s__arr; -static PyObject *__pyx_n_s__ascontiguousarray; -static PyObject *__pyx_n_s__buf; -static PyObject *__pyx_n_s__byteorder; -static PyObject *__pyx_n_s__descr; -static PyObject *__pyx_n_s__double; -static PyObject *__pyx_n_s__dtype; -static PyObject *__pyx_n_s__empty; -static PyObject *__pyx_n_s__fields; -static PyObject *__pyx_n_s__format; -static PyObject *__pyx_n_s__itemsize; -static PyObject *__pyx_n_s__names; -static PyObject *__pyx_n_s__ndim; -static PyObject *__pyx_n_s__np; -static PyObject *__pyx_n_s__numpy; -static PyObject *__pyx_n_s__obj; -static PyObject *__pyx_n_s__range; -static PyObject *__pyx_n_s__reach; -static PyObject *__pyx_n_s__readonly; -static PyObject *__pyx_n_s__shape; -static PyObject *__pyx_n_s__shortest_path; -static PyObject *__pyx_n_s__strides; -static PyObject *__pyx_n_s__suboffsets; -static PyObject *__pyx_n_s__type_num; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_int_15; - -/* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":9 - * double fabs(double f) - * - * cpdef shortest_path(np.ndarray arr, int reach=1): # <<<<<<<<<<<<<< - * """Find the shortest left-to-right path through an array. - * - */ - -static PyObject *__pyx_pf_7scikits_5image_8analysis_5spath_shortest_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_7scikits_5image_8analysis_5spath_shortest_path(PyArrayObject *__pyx_v_arr, int __pyx_skip_dispatch, struct __pyx_opt_args_7scikits_5image_8analysis_5spath_shortest_path *__pyx_optional_args) { - int __pyx_v_reach = ((int)1); - PyArrayObject *__pyx_v_data = 0; - int __pyx_v_M; - int __pyx_v_N; - PyArrayObject *__pyx_v_node = 0; - PyArrayObject *__pyx_v_cost = 0; - PyArrayObject *__pyx_v_out = 0; - int __pyx_v_c; - int __pyx_v_r; - int __pyx_v_rb; - int __pyx_v_r_min_node; - int __pyx_v_r_bracket_min; - int __pyx_v_r_bracket_max; - double __pyx_v_delta0; - double __pyx_v_delta1; - Py_buffer __pyx_bstruct_node; - Py_ssize_t __pyx_bstride_0_node = 0; - Py_ssize_t __pyx_bstride_1_node = 0; - Py_ssize_t __pyx_bshape_0_node = 0; - Py_ssize_t __pyx_bshape_1_node = 0; - Py_buffer __pyx_bstruct_cost; - Py_ssize_t __pyx_bstride_0_cost = 0; - Py_ssize_t __pyx_bstride_1_cost = 0; - Py_ssize_t __pyx_bshape_0_cost = 0; - Py_ssize_t __pyx_bshape_1_cost = 0; - Py_buffer __pyx_bstruct_data; - Py_ssize_t __pyx_bstride_0_data = 0; - Py_ssize_t __pyx_bstride_1_data = 0; - Py_ssize_t __pyx_bshape_0_data = 0; - Py_ssize_t __pyx_bshape_1_data = 0; - Py_buffer __pyx_bstruct_out; - Py_ssize_t __pyx_bstride_0_out = 0; - Py_ssize_t __pyx_bshape_0_out = 0; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyArrayObject *__pyx_t_7 = NULL; - PyArrayObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - PyArrayObject *__pyx_t_10 = NULL; - int __pyx_t_11; - int __pyx_t_12; - int __pyx_t_13; - int __pyx_t_14; - int __pyx_t_15; - int __pyx_t_16; - int __pyx_t_17; - long __pyx_t_18; - int __pyx_t_19; - int __pyx_t_20; - int __pyx_t_21; - long __pyx_t_22; - int __pyx_t_23; - int __pyx_t_24; - int __pyx_t_25; - int __pyx_t_26; - int __pyx_t_27; - __pyx_t_5numpy_int_t __pyx_t_28; - long __pyx_t_29; - int __pyx_t_30; - int __pyx_t_31; - int __pyx_t_32; - __pyx_t_5numpy_int_t __pyx_t_33; - int __pyx_t_34; - int __pyx_t_35; - int __pyx_t_36; - int __pyx_t_37; - __pyx_t_5numpy_int_t __pyx_t_38; - long __pyx_t_39; - int __pyx_t_40; - int __pyx_t_41; - long __pyx_t_42; - __pyx_t_5numpy_int_t __pyx_t_43; - long __pyx_t_44; - long __pyx_t_45; - __Pyx_SetupRefcountContext("shortest_path"); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_reach = __pyx_optional_args->reach; - } - } - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __pyx_bstruct_data.buf = NULL; - __pyx_bstruct_node.buf = NULL; - __pyx_bstruct_cost.buf = NULL; - __pyx_bstruct_out.buf = NULL; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":31 - * - * """ - * if arr.ndim != 2: # <<<<<<<<<<<<<< - * raise ValueError("Expected 2-D array as input") - * - */ - __pyx_t_1 = (__pyx_v_arr->nd != 2); - if (__pyx_t_1) { - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":32 - * """ - * if arr.ndim != 2: - * raise ValueError("Expected 2-D array as input") # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.double_t, ndim=2] data = \ - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":35 - * - * cdef np.ndarray[np.double_t, ndim=2] data = \ - * np.ascontiguousarray(arr, dtype=np.double) # <<<<<<<<<<<<<< - * - * cdef int M = arr.shape[0] - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_arr)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_arr)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_arr)); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (!(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_data, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_data.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } else {__pyx_bstride_0_data = __pyx_bstruct_data.strides[0]; __pyx_bstride_1_data = __pyx_bstruct_data.strides[1]; - __pyx_bshape_0_data = __pyx_bstruct_data.shape[0]; __pyx_bshape_1_data = __pyx_bstruct_data.shape[1]; - } - } - __pyx_t_7 = 0; - __pyx_v_data = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":37 - * np.ascontiguousarray(arr, dtype=np.double) - * - * cdef int M = arr.shape[0] # <<<<<<<<<<<<<< - * cdef int N = arr.shape[1] - * - */ - __pyx_v_M = (__pyx_v_arr->dimensions[0]); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":38 - * - * cdef int M = arr.shape[0] - * cdef int N = arr.shape[1] # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.int_t, ndim=2] node = \ - */ - __pyx_v_N = (__pyx_v_arr->dimensions[1]); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":41 - * - * cdef np.ndarray[np.int_t, ndim=2] node = \ - * np.empty((M, N), dtype=int) # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.double_t, ndim=2] cost = \ - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_M); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = ((PyArrayObject *)__pyx_t_6); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_node, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - __pyx_v_node = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_node.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } else {__pyx_bstride_0_node = __pyx_bstruct_node.strides[0]; __pyx_bstride_1_node = __pyx_bstruct_node.strides[1]; - __pyx_bshape_0_node = __pyx_bstruct_node.shape[0]; __pyx_bshape_1_node = __pyx_bstruct_node.shape[1]; - } - } - __pyx_t_8 = 0; - __pyx_v_node = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":44 - * - * cdef np.ndarray[np.double_t, ndim=2] cost = \ - * np.empty((M, N), dtype=np.double) # <<<<<<<<<<<<<< - * - * cdef np.ndarray[np.int_t] out = np.empty((N,), dtype=int) - */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_M); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_cost, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { - __pyx_v_cost = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_cost.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } else {__pyx_bstride_0_cost = __pyx_bstruct_cost.strides[0]; __pyx_bstride_1_cost = __pyx_bstruct_cost.strides[1]; - __pyx_bshape_0_cost = __pyx_bstruct_cost.shape[0]; __pyx_bshape_1_cost = __pyx_bstruct_cost.shape[1]; - } - } - __pyx_t_9 = 0; - __pyx_v_cost = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":46 - * np.empty((M, N), dtype=np.double) - * - * cdef np.ndarray[np.int_t] out = np.empty((N,), dtype=int) # <<<<<<<<<<<<<< - * - * cdef int c, r, rb, r_min_node - */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = ((PyArrayObject *)__pyx_t_2); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_out.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } else {__pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; - __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; - } - } - __pyx_t_10 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":49 - * - * cdef int c, r, rb, r_min_node - * cdef int r_bracket_min = 0, r_bracket_max = 0 # <<<<<<<<<<<<<< - * cdef double delta0 = 0, delta1 = 0 - * - */ - __pyx_v_r_bracket_min = 0; - __pyx_v_r_bracket_max = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":50 - * cdef int c, r, rb, r_min_node - * cdef int r_bracket_min = 0, r_bracket_max = 0 - * cdef double delta0 = 0, delta1 = 0 # <<<<<<<<<<<<<< - * - * cost[:, 0] = 0 - */ - __pyx_v_delta0 = 0; - __pyx_v_delta1 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":52 - * cdef double delta0 = 0, delta1 = 0 - * - * cost[:, 0] = 0 # <<<<<<<<<<<<<< - * - * for c in range(1, N): - */ - __pyx_t_2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = 0; - if (PyObject_SetItem(((PyObject *)__pyx_v_cost), __pyx_t_3, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":54 - * cost[:, 0] = 0 - * - * for c in range(1, N): # <<<<<<<<<<<<<< - * for r in range(M): - * r_bracket_min = r - reach - */ - __pyx_t_11 = __pyx_v_N; - for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { - __pyx_v_c = __pyx_t_12; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":55 - * - * for c in range(1, N): - * for r in range(M): # <<<<<<<<<<<<<< - * r_bracket_min = r - reach - * r_bracket_max = r + reach - */ - __pyx_t_13 = __pyx_v_M; - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_r = __pyx_t_14; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":56 - * for c in range(1, N): - * for r in range(M): - * r_bracket_min = r - reach # <<<<<<<<<<<<<< - * r_bracket_max = r + reach - * - */ - __pyx_v_r_bracket_min = (__pyx_v_r - __pyx_v_reach); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":57 - * for r in range(M): - * r_bracket_min = r - reach - * r_bracket_max = r + reach # <<<<<<<<<<<<<< - * - * if r_bracket_min < 0: - */ - __pyx_v_r_bracket_max = (__pyx_v_r + __pyx_v_reach); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":59 - * r_bracket_max = r + reach - * - * if r_bracket_min < 0: # <<<<<<<<<<<<<< - * r_bracket_min = 0 - * if r_bracket_max > M - 1: - */ - __pyx_t_1 = (__pyx_v_r_bracket_min < 0); - if (__pyx_t_1) { - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":60 - * - * if r_bracket_min < 0: - * r_bracket_min = 0 # <<<<<<<<<<<<<< - * if r_bracket_max > M - 1: - * r_bracket_max = M - 1 - */ - __pyx_v_r_bracket_min = 0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":61 - * if r_bracket_min < 0: - * r_bracket_min = 0 - * if r_bracket_max > M - 1: # <<<<<<<<<<<<<< - * r_bracket_max = M - 1 - * - */ - __pyx_t_1 = (__pyx_v_r_bracket_max > (__pyx_v_M - 1)); - if (__pyx_t_1) { - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":62 - * r_bracket_min = 0 - * if r_bracket_max > M - 1: - * r_bracket_max = M - 1 # <<<<<<<<<<<<<< - * - * node[r, c] = r_bracket_min - */ - __pyx_v_r_bracket_max = (__pyx_v_M - 1); - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":64 - * r_bracket_max = M - 1 - * - * node[r, c] = r_bracket_min # <<<<<<<<<<<<<< - * for rb in range(r_bracket_min, r_bracket_max + 1): - * delta0 = fabs(data[r, c] - data[rb, c - 1]) - */ - __pyx_t_15 = __pyx_v_r; - __pyx_t_16 = __pyx_v_c; - __pyx_t_17 = -1; - if (__pyx_t_15 < 0) { - __pyx_t_15 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0; - } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_node)) __pyx_t_17 = 0; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1; - } else if (unlikely(__pyx_t_16 >= __pyx_bshape_1_node)) __pyx_t_17 = 1; - if (unlikely(__pyx_t_17 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_15, __pyx_bstride_0_node, __pyx_t_16, __pyx_bstride_1_node) = __pyx_v_r_bracket_min; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":65 - * - * node[r, c] = r_bracket_min - * for rb in range(r_bracket_min, r_bracket_max + 1): # <<<<<<<<<<<<<< - * delta0 = fabs(data[r, c] - data[rb, c - 1]) - * delta1 = fabs(data[r, c] - data[node[r, c], c - 1]) - */ - __pyx_t_18 = (__pyx_v_r_bracket_max + 1); - for (__pyx_t_17 = __pyx_v_r_bracket_min; __pyx_t_17 < __pyx_t_18; __pyx_t_17+=1) { - __pyx_v_rb = __pyx_t_17; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":66 - * node[r, c] = r_bracket_min - * for rb in range(r_bracket_min, r_bracket_max + 1): - * delta0 = fabs(data[r, c] - data[rb, c - 1]) # <<<<<<<<<<<<<< - * delta1 = fabs(data[r, c] - data[node[r, c], c - 1]) - * if delta0 < delta1: - */ - __pyx_t_19 = __pyx_v_r; - __pyx_t_20 = __pyx_v_c; - __pyx_t_21 = -1; - if (__pyx_t_19 < 0) { - __pyx_t_19 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_19 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_data)) __pyx_t_21 = 0; - if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 1; - } else if (unlikely(__pyx_t_20 >= __pyx_bshape_1_data)) __pyx_t_21 = 1; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_21 = __pyx_v_rb; - __pyx_t_22 = (__pyx_v_c - 1); - __pyx_t_23 = -1; - if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_21 < 0)) __pyx_t_23 = 0; - } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_data)) __pyx_t_23 = 0; - if (__pyx_t_22 < 0) { - __pyx_t_22 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 1; - } else if (unlikely(__pyx_t_22 >= __pyx_bshape_1_data)) __pyx_t_23 = 1; - if (unlikely(__pyx_t_23 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_23); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_delta0 = fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_19, __pyx_bstride_0_data, __pyx_t_20, __pyx_bstride_1_data)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_21, __pyx_bstride_0_data, __pyx_t_22, __pyx_bstride_1_data)))); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":67 - * for rb in range(r_bracket_min, r_bracket_max + 1): - * delta0 = fabs(data[r, c] - data[rb, c - 1]) - * delta1 = fabs(data[r, c] - data[node[r, c], c - 1]) # <<<<<<<<<<<<<< - * if delta0 < delta1: - * node[r, c] = rb - */ - __pyx_t_23 = __pyx_v_r; - __pyx_t_24 = __pyx_v_c; - __pyx_t_25 = -1; - if (__pyx_t_23 < 0) { - __pyx_t_23 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 0; - } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_data)) __pyx_t_25 = 0; - if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 1; - } else if (unlikely(__pyx_t_24 >= __pyx_bshape_1_data)) __pyx_t_25 = 1; - if (unlikely(__pyx_t_25 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_25); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_25 = __pyx_v_r; - __pyx_t_26 = __pyx_v_c; - __pyx_t_27 = -1; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_27 = 0; - } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_node)) __pyx_t_27 = 0; - if (__pyx_t_26 < 0) { - __pyx_t_26 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 1; - } else if (unlikely(__pyx_t_26 >= __pyx_bshape_1_node)) __pyx_t_27 = 1; - if (unlikely(__pyx_t_27 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_27); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_28 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_25, __pyx_bstride_0_node, __pyx_t_26, __pyx_bstride_1_node)); - __pyx_t_29 = (__pyx_v_c - 1); - __pyx_t_27 = -1; - if (__pyx_t_28 < 0) { - __pyx_t_28 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0; - } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_data)) __pyx_t_27 = 0; - if (__pyx_t_29 < 0) { - __pyx_t_29 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 1; - } else if (unlikely(__pyx_t_29 >= __pyx_bshape_1_data)) __pyx_t_27 = 1; - if (unlikely(__pyx_t_27 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_27); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_delta1 = fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_23, __pyx_bstride_0_data, __pyx_t_24, __pyx_bstride_1_data)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_28, __pyx_bstride_0_data, __pyx_t_29, __pyx_bstride_1_data)))); - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":68 - * delta0 = fabs(data[r, c] - data[rb, c - 1]) - * delta1 = fabs(data[r, c] - data[node[r, c], c - 1]) - * if delta0 < delta1: # <<<<<<<<<<<<<< - * node[r, c] = rb - * - */ - __pyx_t_1 = (__pyx_v_delta0 < __pyx_v_delta1); - if (__pyx_t_1) { - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":69 - * delta1 = fabs(data[r, c] - data[node[r, c], c - 1]) - * if delta0 < delta1: - * node[r, c] = rb # <<<<<<<<<<<<<< - * - * cost[r, c] = cost[node[r, c], c - 1] + \ - */ - __pyx_t_27 = __pyx_v_r; - __pyx_t_30 = __pyx_v_c; - __pyx_t_31 = -1; - if (__pyx_t_27 < 0) { - __pyx_t_27 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_27 < 0)) __pyx_t_31 = 0; - } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_node)) __pyx_t_31 = 0; - if (__pyx_t_30 < 0) { - __pyx_t_30 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_30 < 0)) __pyx_t_31 = 1; - } else if (unlikely(__pyx_t_30 >= __pyx_bshape_1_node)) __pyx_t_31 = 1; - if (unlikely(__pyx_t_31 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_31); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_27, __pyx_bstride_0_node, __pyx_t_30, __pyx_bstride_1_node) = __pyx_v_rb; - goto __pyx_L12; - } - __pyx_L12:; - } - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":71 - * node[r, c] = rb - * - * cost[r, c] = cost[node[r, c], c - 1] + \ # <<<<<<<<<<<<<< - * fabs(data[r, c] - data[node[r, c], c - 1]) - * - */ - __pyx_t_17 = __pyx_v_r; - __pyx_t_31 = __pyx_v_c; - __pyx_t_32 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_32 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_node)) __pyx_t_32 = 0; - if (__pyx_t_31 < 0) { - __pyx_t_31 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_31 < 0)) __pyx_t_32 = 1; - } else if (unlikely(__pyx_t_31 >= __pyx_bshape_1_node)) __pyx_t_32 = 1; - if (unlikely(__pyx_t_32 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_32); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_17, __pyx_bstride_0_node, __pyx_t_31, __pyx_bstride_1_node)); - __pyx_t_18 = (__pyx_v_c - 1); - __pyx_t_32 = -1; - if (__pyx_t_33 < 0) { - __pyx_t_33 += __pyx_bshape_0_cost; - if (unlikely(__pyx_t_33 < 0)) __pyx_t_32 = 0; - } else if (unlikely(__pyx_t_33 >= __pyx_bshape_0_cost)) __pyx_t_32 = 0; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_bshape_1_cost; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_32 = 1; - } else if (unlikely(__pyx_t_18 >= __pyx_bshape_1_cost)) __pyx_t_32 = 1; - if (unlikely(__pyx_t_32 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_32); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":72 - * - * cost[r, c] = cost[node[r, c], c - 1] + \ - * fabs(data[r, c] - data[node[r, c], c - 1]) # <<<<<<<<<<<<<< - * - * # Find minimum cost path - */ - __pyx_t_32 = __pyx_v_r; - __pyx_t_34 = __pyx_v_c; - __pyx_t_35 = -1; - if (__pyx_t_32 < 0) { - __pyx_t_32 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_32 < 0)) __pyx_t_35 = 0; - } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_data)) __pyx_t_35 = 0; - if (__pyx_t_34 < 0) { - __pyx_t_34 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_34 < 0)) __pyx_t_35 = 1; - } else if (unlikely(__pyx_t_34 >= __pyx_bshape_1_data)) __pyx_t_35 = 1; - if (unlikely(__pyx_t_35 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_35); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_35 = __pyx_v_r; - __pyx_t_36 = __pyx_v_c; - __pyx_t_37 = -1; - if (__pyx_t_35 < 0) { - __pyx_t_35 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_35 < 0)) __pyx_t_37 = 0; - } else if (unlikely(__pyx_t_35 >= __pyx_bshape_0_node)) __pyx_t_37 = 0; - if (__pyx_t_36 < 0) { - __pyx_t_36 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_36 < 0)) __pyx_t_37 = 1; - } else if (unlikely(__pyx_t_36 >= __pyx_bshape_1_node)) __pyx_t_37 = 1; - if (unlikely(__pyx_t_37 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_37); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_38 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_35, __pyx_bstride_0_node, __pyx_t_36, __pyx_bstride_1_node)); - __pyx_t_39 = (__pyx_v_c - 1); - __pyx_t_37 = -1; - if (__pyx_t_38 < 0) { - __pyx_t_38 += __pyx_bshape_0_data; - if (unlikely(__pyx_t_38 < 0)) __pyx_t_37 = 0; - } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_data)) __pyx_t_37 = 0; - if (__pyx_t_39 < 0) { - __pyx_t_39 += __pyx_bshape_1_data; - if (unlikely(__pyx_t_39 < 0)) __pyx_t_37 = 1; - } else if (unlikely(__pyx_t_39 >= __pyx_bshape_1_data)) __pyx_t_37 = 1; - if (unlikely(__pyx_t_37 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_37); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":71 - * node[r, c] = rb - * - * cost[r, c] = cost[node[r, c], c - 1] + \ # <<<<<<<<<<<<<< - * fabs(data[r, c] - data[node[r, c], c - 1]) - * - */ - __pyx_t_37 = __pyx_v_r; - __pyx_t_40 = __pyx_v_c; - __pyx_t_41 = -1; - if (__pyx_t_37 < 0) { - __pyx_t_37 += __pyx_bshape_0_cost; - if (unlikely(__pyx_t_37 < 0)) __pyx_t_41 = 0; - } else if (unlikely(__pyx_t_37 >= __pyx_bshape_0_cost)) __pyx_t_41 = 0; - if (__pyx_t_40 < 0) { - __pyx_t_40 += __pyx_bshape_1_cost; - if (unlikely(__pyx_t_40 < 0)) __pyx_t_41 = 1; - } else if (unlikely(__pyx_t_40 >= __pyx_bshape_1_cost)) __pyx_t_41 = 1; - if (unlikely(__pyx_t_41 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_41); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_cost.buf, __pyx_t_37, __pyx_bstride_0_cost, __pyx_t_40, __pyx_bstride_1_cost) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_cost.buf, __pyx_t_33, __pyx_bstride_0_cost, __pyx_t_18, __pyx_bstride_1_cost)) + fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_32, __pyx_bstride_0_data, __pyx_t_34, __pyx_bstride_1_data)) - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_data.buf, __pyx_t_38, __pyx_bstride_0_data, __pyx_t_39, __pyx_bstride_1_data))))); - } - } - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":75 - * - * # Find minimum cost path - * print arr # <<<<<<<<<<<<<< - * print cost - * print node - */ - if (__Pyx_PrintOne(((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":76 - * # Find minimum cost path - * print arr - * print cost # <<<<<<<<<<<<<< - * print node - * r_min_node = cost[:,-1].argmin() - */ - if (__Pyx_PrintOne(((PyObject *)__pyx_v_cost)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":77 - * print arr - * print cost - * print node # <<<<<<<<<<<<<< - * r_min_node = cost[:,-1].argmin() - * - */ - if (__Pyx_PrintOne(((PyObject *)__pyx_v_node)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":78 - * print cost - * print node - * r_min_node = cost[:,-1].argmin() # <<<<<<<<<<<<<< - * - * # Backtrack - */ - __pyx_t_3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_cost), __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__argmin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_r_min_node = __pyx_t_11; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":81 - * - * # Backtrack - * out[N - 1] = r_min_node # <<<<<<<<<<<<<< - * for c in range(N - 1, 0, -1): - * out[c - 1] = node[out[c], c] - */ - __pyx_t_42 = (__pyx_v_N - 1); - __pyx_t_11 = -1; - if (__pyx_t_42 < 0) { - __pyx_t_42 += __pyx_bshape_0_out; - if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0; - } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_out)) __pyx_t_11 = 0; - if (unlikely(__pyx_t_11 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_11); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out.buf, __pyx_t_42, __pyx_bstride_0_out) = __pyx_v_r_min_node; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":82 - * # Backtrack - * out[N - 1] = r_min_node - * for c in range(N - 1, 0, -1): # <<<<<<<<<<<<<< - * out[c - 1] = node[out[c], c] - * - */ - for (__pyx_t_11 = (__pyx_v_N - 1); __pyx_t_11 > 0; __pyx_t_11-=1) { - __pyx_v_c = __pyx_t_11; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":83 - * out[N - 1] = r_min_node - * for c in range(N - 1, 0, -1): - * out[c - 1] = node[out[c], c] # <<<<<<<<<<<<<< - * - * return out, cost[r_min_node, N - 1] - */ - __pyx_t_12 = __pyx_v_c; - __pyx_t_13 = -1; - if (__pyx_t_12 < 0) { - __pyx_t_12 += __pyx_bshape_0_out; - if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0; - } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_out)) __pyx_t_13 = 0; - if (unlikely(__pyx_t_13 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_13); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_43 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out.buf, __pyx_t_12, __pyx_bstride_0_out)); - __pyx_t_13 = __pyx_v_c; - __pyx_t_14 = -1; - if (__pyx_t_43 < 0) { - __pyx_t_43 += __pyx_bshape_0_node; - if (unlikely(__pyx_t_43 < 0)) __pyx_t_14 = 0; - } else if (unlikely(__pyx_t_43 >= __pyx_bshape_0_node)) __pyx_t_14 = 0; - if (__pyx_t_13 < 0) { - __pyx_t_13 += __pyx_bshape_1_node; - if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1; - } else if (unlikely(__pyx_t_13 >= __pyx_bshape_1_node)) __pyx_t_14 = 1; - if (unlikely(__pyx_t_14 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_14); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_44 = (__pyx_v_c - 1); - __pyx_t_14 = -1; - if (__pyx_t_44 < 0) { - __pyx_t_44 += __pyx_bshape_0_out; - if (unlikely(__pyx_t_44 < 0)) __pyx_t_14 = 0; - } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_out)) __pyx_t_14 = 0; - if (unlikely(__pyx_t_14 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_14); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out.buf, __pyx_t_44, __pyx_bstride_0_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_node.buf, __pyx_t_43, __pyx_bstride_0_node, __pyx_t_13, __pyx_bstride_1_node)); - } - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":85 - * out[c - 1] = node[out[c], c] - * - * return out, cost[r_min_node, N - 1] # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __pyx_v_r_min_node; - __pyx_t_45 = (__pyx_v_N - 1); - __pyx_t_14 = -1; - if (__pyx_t_11 < 0) { - __pyx_t_11 += __pyx_bshape_0_cost; - if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 0; - } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_cost)) __pyx_t_14 = 0; - if (__pyx_t_45 < 0) { - __pyx_t_45 += __pyx_bshape_1_cost; - if (unlikely(__pyx_t_45 < 0)) __pyx_t_14 = 1; - } else if (unlikely(__pyx_t_45 >= __pyx_bshape_1_cost)) __pyx_t_14 = 1; - if (unlikely(__pyx_t_14 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_14); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_cost.buf, __pyx_t_11, __pyx_bstride_0_cost, __pyx_t_45, __pyx_bstride_1_cost))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_node); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_cost); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_data); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.image.analysis.spath.shortest_path"); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_node); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_cost); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_data); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_data); - __Pyx_XDECREF((PyObject *)__pyx_v_node); - __Pyx_XDECREF((PyObject *)__pyx_v_cost); - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":9 - * double fabs(double f) - * - * cpdef shortest_path(np.ndarray arr, int reach=1): # <<<<<<<<<<<<<< - * """Find the shortest left-to-right path through an array. - * - */ - -static PyObject *__pyx_pf_7scikits_5image_8analysis_5spath_shortest_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7scikits_5image_8analysis_5spath_shortest_path[] = "Find the shortest left-to-right path through an array.\n\n Parameters\n ----------\n arr : (M, N) ndarray of float64\n reach : int, optional\n By default (``reach = 1``), the shortest path can only move\n one row up or down for every column it moves forward (i.e.,\n the path gradient is limited to 1). `reach` defines the\n number of rows that can be skipped at each step.\n\n Returns\n -------\n p : ndarray of int\n For each column, give the row-coordinate of the\n shortest path.\n cost : float\n Cost of path. This is the absolute sum of all the\n differences along the path.\n\n "; -static PyObject *__pyx_pf_7scikits_5image_8analysis_5spath_shortest_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_arr = 0; - int __pyx_v_reach; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - struct __pyx_opt_args_7scikits_5image_8analysis_5spath_shortest_path __pyx_t_2; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__reach,0}; - __Pyx_SetupRefcountContext("shortest_path"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reach); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "shortest_path") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_arr = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_reach = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_reach == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_reach = ((int)1); - } - } else { - __pyx_v_reach = ((int)1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_reach = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_reach == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_arr = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("shortest_path", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.analysis.spath.shortest_path"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.reach = __pyx_v_reach; - __pyx_t_1 = __pyx_f_7scikits_5image_8analysis_5spath_shortest_path(__pyx_v_arr, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.image.analysis.spath.shortest_path"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":158 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - char *__pyx_t_9; - __Pyx_SetupRefcountContext("__getbuffer__"); - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":164 - * # of flags - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":165 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":167 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":169 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":170 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":172 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":174 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":175 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":176 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_u_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_2)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":178 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":179 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":180 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":182 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":183 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":184 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - __pyx_t_4 = __pyx_v_copy_shape; - if (__pyx_t_4) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":187 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":188 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":189 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":190 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":191 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":193 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":194 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":195 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":196 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":197 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":200 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":201 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * cdef int offset - */ - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":205 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":207 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - if ((!__pyx_v_hasfields)) { - __pyx_t_1 = (!__pyx_v_copy_shape); - } else { - __pyx_t_1 = (!__pyx_v_hasfields); - } - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":209 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":212 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":214 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":215 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":216 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_descr->byteorder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_4), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - __pyx_t_6 = __pyx_v_little_endian; - __pyx_t_7 = __pyx_t_6; - } else { - __pyx_t_7 = __pyx_t_1; - } - if (!__pyx_t_7) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":217 - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_descr->byteorder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_5), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { - __pyx_t_6 = (!__pyx_v_little_endian); - __pyx_t_8 = __pyx_t_6; - } else { - __pyx_t_8 = __pyx_t_1; - } - __pyx_t_1 = __pyx_t_8; - } else { - __pyx_t_1 = __pyx_t_7; - } - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":218 - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_u_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":219 - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - __pyx_t_1 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__b; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":220 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__B; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":221 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_t_1 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__h; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":222 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_t_1 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__H; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":223 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_t_1 = (__pyx_v_t == NPY_INT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__i; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":224 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_t_1 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__I; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":225 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_t_1 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__l; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":226 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__L; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":227 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__q; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":228 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__Q; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":229 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__f; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":230 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__d; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":231 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__g; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":232 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__Zf; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":233 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__Zd; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":234 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__Zg; - goto __pyx_L14; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":235 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_1) { - __pyx_v_f = __pyx_k__O; - goto __pyx_L14; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":237 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_7), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L14:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":238 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":239 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":241 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":242 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":243 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":246 - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - * &offset) # <<<<<<<<<<<<<< - * f[0] = 0 # Terminate format string - * - */ - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_9; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":247 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = 0; - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":249 - * f[0] = 0 # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; - __Pyx_SetupRefcountContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":250 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":251 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":252 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":253 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_FinishRefcountContext(); -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":704 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("PyArray_MultiIterNew1"); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":705 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":707 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("PyArray_MultiIterNew2"); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":708 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":710 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("PyArray_MultiIterNew3"); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":711 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":713 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("PyArray_MultiIterNew4"); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":714 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":716 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("PyArray_MultiIterNew5"); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":717 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":719 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields; - PyObject *__pyx_v_childname; - PyObject *__pyx_v_new_offset; - PyObject *__pyx_v_t; - char *__pyx_r; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - char *__pyx_t_10; - __Pyx_SetupRefcountContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); - __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":726 - * cdef int delta_offset - * cdef tuple i - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":727 - * cdef tuple i - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":730 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - __Pyx_DECREF(__pyx_v_childname); - __pyx_v_childname = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":731 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3)) || (__pyx_t_3) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":732 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { - PyObject* tuple = ((PyObject *)__pyx_v_fields); - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_new_offset); - __pyx_v_new_offset = __pyx_t_4; - __pyx_t_4 = 0; - } else { - __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":734 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":735 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == '>' and little_endian) or - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_8)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":737 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == '<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->byteorder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_4), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - __pyx_t_7 = __pyx_v_little_endian; - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (!__pyx_t_8) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":738 - * - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_child->byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_kp_s_5), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - __pyx_t_7 = (!__pyx_v_little_endian); - __pyx_t_9 = __pyx_t_7; - } else { - __pyx_t_9 = __pyx_t_6; - } - __pyx_t_6 = __pyx_t_9; - } else { - __pyx_t_6 = __pyx_t_8; - } - if (__pyx_t_6) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":739 - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":749 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_6) break; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":750 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 120; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":751 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f += 1; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":752 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - (__pyx_v_offset[0]) += 1; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":754 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":756 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); - if (__pyx_t_6) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":757 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_t); - __pyx_v_t = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":758 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); - if (__pyx_t_6) { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":759 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_9)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_9)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":762 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":763 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":764 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 104; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":765 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":766 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 105; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":767 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":768 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 108; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":769 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":770 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 113; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":771 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":772 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 102; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":773 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 100; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":774 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 103; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":775 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":776 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":777 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":778 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L11; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":780 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_7), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L11:; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":781 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f += 1; - goto __pyx_L9; - } - /*else*/ { - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":785 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_10; - } - __pyx_L9:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":786 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("numpy._util_dtypestring"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_fields); - __Pyx_DECREF(__pyx_v_childname); - __Pyx_DECREF(__pyx_v_new_offset); - __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -static struct PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("shortest_path"), (PyCFunction)__pyx_pf_7scikits_5image_8analysis_5spath_shortest_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5image_8analysis_5spath_shortest_path)}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("spath"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_u_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 1, 0, 0}, - {&__pyx_kp_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 0}, - {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0}, - {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0}, - {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0}, - {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s__argmin, __pyx_k__argmin, sizeof(__pyx_k__argmin), 0, 0, 1, 1}, - {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1}, - {&__pyx_n_s__ascontiguousarray, __pyx_k__ascontiguousarray, sizeof(__pyx_k__ascontiguousarray), 0, 0, 1, 1}, - {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1}, - {&__pyx_n_s__byteorder, __pyx_k__byteorder, sizeof(__pyx_k__byteorder), 0, 0, 1, 1}, - {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1}, - {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1}, - {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1}, - {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1}, - {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1}, - {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1}, - {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1}, - {&__pyx_n_s__names, __pyx_k__names, sizeof(__pyx_k__names), 0, 0, 1, 1}, - {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1}, - {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1}, - {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1}, - {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, - {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1}, - {&__pyx_n_s__reach, __pyx_k__reach, sizeof(__pyx_k__reach), 0, 0, 1, 1}, - {&__pyx_n_s__readonly, __pyx_k__readonly, sizeof(__pyx_k__readonly), 0, 0, 1, 1}, - {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1}, - {&__pyx_n_s__shortest_path, __pyx_k__shortest_path, sizeof(__pyx_k__shortest_path), 0, 0, 1, 1}, - {&__pyx_n_s__strides, __pyx_k__strides, sizeof(__pyx_k__strides), 0, 0, 1, 1}, - {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 0, 0, 1, 1}, - {&__pyx_n_s__type_num, __pyx_k__type_num, sizeof(__pyx_k__type_num), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initspath(void); /*proto*/ -PyMODINIT_FUNC initspath(void) -#else -PyMODINIT_FUNC PyInit_spath(void); /*proto*/ -PyMODINIT_FUNC PyInit_spath(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_init_filenames(); - #ifdef CYTHON_REFNANNY - void* __pyx_refchk = NULL; - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); - if (!__Pyx_Refnanny) { - PyErr_Clear(); - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); - if (!__Pyx_Refnanny) - Py_FatalError("failed to import refnanny module"); - } - __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_spath(void)", __LINE__, __FILE__); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("spath"), __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_scikits__image__analysis__spath) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject)); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":3 - * # -*- python -*- - * - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/stefan/src/scikits.image/scikits/image/analysis/spath.pyx":1 - * # -*- python -*- # <<<<<<<<<<<<<< - * - * import numpy as np - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__shortest_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_10), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/stdlib.pxd":2 - * - * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< - * void free(void *ptr) - * void *malloc(size_t size) - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - if (__pyx_m) { - __Pyx_AddTraceback("init scikits.image.analysis.spath"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.image.analysis.spath"); - } - __pyx_L0:; - __Pyx_FinishRefcountContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -static const char *__pyx_filenames[] = { - "spath.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static INLINE int __Pyx_IsLittleEndian(void) { - unsigned int n = 1; - return *(unsigned char*)(&n) != 0; -} - -typedef struct { - __Pyx_StructField root; - __Pyx_BufFmt_StackElem* head; - size_t fmt_offset; - int new_count, enc_count; - int is_complex; - char enc_type; - char packmode; -} __Pyx_BufFmt_Context; - -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} - -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t < '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} - -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - char msg[] = {ch, 0}; - PyErr_Format(PyExc_ValueError, "Unexpected format string character: '%s'", msg); -} - -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case 'b': return "'char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 0: return "end"; - default: return "unparseable format string"; - } -} - -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; - } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} - -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case 'c': case 'b': case 'B': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} - -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_s_long_long; -#endif - -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_s_long_long) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } -} - -static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': case 'b': case 'h': case 'i': case 'l': case 'q': return 'I'; - case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U'; - case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R'); - case 'O': return 'O'; - case 'P': return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; - } - } -} - -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; - } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} - -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset; - if (ctx->enc_type == 0) return 0; - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - - if (ctx->packmode == '@' || ctx->packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); - } - if (ctx->packmode == '@') { - int align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - int align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - } - - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - /* special case -- treat as struct rather than complex number */ - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d " - "but %"PY_FORMAT_SIZE_T"d expected", ctx->fmt_offset, offset); - return -1; - } - - ctx->fmt_offset += size; - - --ctx->enc_count; /* Consume from buffer string */ - - /* Done checking, move to next field, pushing or popping struct stack if needed */ - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } - break; /* breaks both loops as ctx->enc_count == 0 */ - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; /* empty struct */ - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } - } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; -} - -static int __Pyx_BufFmt_FirstPack(__Pyx_BufFmt_Context* ctx) { - if (ctx->enc_type != 0 || ctx->packmode != '@') { - PyErr_SetString(PyExc_ValueError, "Buffer packing mode currently only allowed at beginning of format string (this is a defect)"); - return -1; - } - return 0; -} - -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case 10: - case 13: - ++ts; - break; - case '<': - if (!__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - if (__Pyx_BufFmt_FirstPack(ctx) == -1) return NULL; - ctx->packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_IsLittleEndian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; - } - if (__Pyx_BufFmt_FirstPack(ctx) == -1) return NULL; - ctx->packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - if (__Pyx_BufFmt_FirstPack(ctx) == -1) return NULL; - ctx->packmode = *ts++; - break; - case 'T': /* substruct */ - { - int i; - const char* ts_after_sub; - int struct_count = ctx->new_count; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - } - break; - case '}': /* end of substruct; either repeat or move on */ - ++ts; - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; - } /* fall through */ - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex) { - /* Continue pooling same type */ - ctx->enc_count += ctx->new_count; - } else { - /* New type */ - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - } - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - default: - { - ctx->new_count = __Pyx_BufFmt_ParseNumber(&ts); - if (ctx->new_count == -1) { /* First char was not a digit */ - char msg[2] = { *ts, 0 }; - PyErr_Format(PyExc_ValueError, - "Does not understand character buffer dtype format string ('%s')", msg); - return NULL; - } - } - - } - } -} - -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} - -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - nd, buf->ndim); - goto fail; - } - if (!cast) { - __Pyx_BufFmt_Context ctx; - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned)buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)", - buf->itemsize, (buf->itemsize > 1) ? "s" : "", - dtype->name, - dtype->size, (dtype->size > 1) ? "s" : ""); - goto fail; - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} - -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} -static void __Pyx_RaiseBufferIndexError(int axis) { - PyErr_Format(PyExc_IndexError, - "Out of bounds on buffer access (axis %d)", axis); -} - - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - -#if PY_MAJOR_VERSION >= 3 - /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */ - if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) { - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - PyErr_NormalizeException(&type, &value, &tb); - PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb); - tstate->exc_type = 0; - tstate->exc_value = 0; - tstate->exc_traceback = 0; - PyException_SetContext(value, tmp_value); - Py_DECREF(tmp_type); - Py_XDECREF(tmp_tb); - } -#endif - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); -} - -static INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(); - } -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - #if PY_VERSION_HEX >= 0x02060000 - if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER) - return PyObject_GetBuffer(obj, view, flags); - #endif - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags); - else { - PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; - } -} - -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject* obj = view->obj; - if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); - Py_DECREF(obj); - view->obj = NULL; - } -} - -#endif - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunctionObjArgs(__import__, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#if PY_MAJOR_VERSION < 3 -static PyObject *__Pyx_GetStdout(void) { - PyObject *f = PySys_GetObject((char *)"stdout"); - if (!f) { - PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); - } - return f; -} - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; - PyObject* v; - int i; - - if (!(f = __Pyx_GetStdout())) - return -1; - for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { - if (PyFile_SoftSpace(f, 1)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - v = PyTuple_GET_ITEM(arg_tuple, i); - if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) - return -1; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); - Py_ssize_t len = PyString_Size(v); - if (len > 0 && - isspace(Py_CHARMASK(s[len-1])) && - s[len-1] != ' ') - PyFile_SoftSpace(f, 0); - } - } - if (newline) { - if (PyFile_WriteString("\n", f) < 0) - return -1; - PyFile_SoftSpace(f, 0); - } - return 0; -} - -#else /* Python 3 has a print function */ - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject* kwargs = 0; - PyObject* result = 0; - PyObject* end_string; - if (!__pyx_print) { - __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); - if (!__pyx_print) - return -1; - } - if (!newline) { - if (!__pyx_print_kwargs) { - __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) - return -1; - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) - return -1; - if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { - Py_DECREF(end_string); - return -1; - } - Py_DECREF(end_string); - } - kwargs = __pyx_print_kwargs; - } - result = PyObject_Call(__pyx_print, arg_tuple, kwargs); - if (!result) - return -1; - Py_DECREF(result); - return 0; -} - -#endif - -#if PY_MAJOR_VERSION < 3 - -static int __Pyx_PrintOne(PyObject *o) { - PyObject *f; - if (!(f = __Pyx_GetStdout())) - return -1; - if (PyFile_SoftSpace(f, 0)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) - return -1; - if (PyFile_WriteString("\n", f) < 0) - return -1; - return 0; - /* the line below is just to avoid compiler - * compiler warnings about unused functions */ - return __Pyx_Print(NULL, 0); -} - -#else /* Python 3 has a print function */ - -static int __Pyx_PrintOne(PyObject *o) { - int res; - PyObject* arg_tuple = PyTuple_New(1); - if (unlikely(!arg_tuple)) - return -1; - Py_INCREF(o); - PyTuple_SET_ITEM(arg_tuple, 0, o); - res = __Pyx_Print(arg_tuple, 1); - Py_DECREF(arg_tuple); - return res; -} - -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -#if CYTHON_CCOMPLEX -#else - static INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } -/* - static INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { -#if HAVE_HYPOT - return hypotf(z.real, z.imag); -#else - return sqrtf(z.real*z.real + z.imag*z.imag); -#endif - } -*/ -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -#if CYTHON_CCOMPLEX -#else - static INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } -/* - static INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { -#if HAVE_HYPOT - return hypot(z.real, z.imag); -#else - return sqrt(z.real*z.real + z.imag*z.imag); -#endif - } -*/ -#endif - -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { - return ::std::complex< long double >(x, y); - } - #else - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { - return x + y*(__pyx_t_long_double_complex)_Complex_I; - } - #endif -#else - static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) { - __pyx_t_long_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -#if CYTHON_CCOMPLEX -#else - static INLINE int __Pyx_c_eql(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static INLINE __pyx_t_long_double_complex __Pyx_c_suml(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { - __pyx_t_long_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static INLINE __pyx_t_long_double_complex __Pyx_c_diffl(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { - __pyx_t_long_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static INLINE __pyx_t_long_double_complex __Pyx_c_prodl(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { - __pyx_t_long_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static INLINE __pyx_t_long_double_complex __Pyx_c_quotl(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) { - __pyx_t_long_double_complex z; - long double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static INLINE __pyx_t_long_double_complex __Pyx_c_negl(__pyx_t_long_double_complex a) { - __pyx_t_long_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static INLINE int __Pyx_c_is_zerol(__pyx_t_long_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static INLINE __pyx_t_long_double_complex __Pyx_c_conjl(__pyx_t_long_double_complex a) { - __pyx_t_long_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } -/* - static INLINE long double __Pyx_c_absl(__pyx_t_long_double_complex z) { -#if HAVE_HYPOT - return hypotl(z.real, z.imag); -#else - return sqrtl(z.real*z.real + z.imag*z.imag); -#endif - } -*/ -#endif - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((char)-1) > ((char)0) && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((short)-1) > ((short)0) && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((int)-1) > ((int)0) && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (((unsigned long)-1) < ((unsigned long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((long)-1) > ((long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (((long)-1) < ((long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (((signed long)-1) < ((signed long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/scikits/image/opencv/opencv_backend.c b/scikits/image/opencv/opencv_backend.c deleted file mode 100644 index a7a13d63..00000000 --- a/scikits/image/opencv/opencv_backend.c +++ /dev/null @@ -1,6377 +0,0 @@ -/* Generated by Cython 0.11.3 on Mon Nov 2 16:14:52 2009 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyString_CheckExact PyBytes_CheckExact - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__scikits__image__opencv__opencv_backend -#include "stdlib.h" -#include "stdio.h" -#include "numpy/arrayobject.h" -#define __PYX_USE_C99_COMPLEX defined(_Complex_I) - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - - -#ifdef CYTHON_REFNANNY -typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*NewContext)(const char*, int, const char*); - void (*FinishContext)(void**); -} __Pyx_RefnannyAPIStruct; -static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; -#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI") -#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r) -#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__) -#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk) -#else -#define __Pyx_INCREF(r) Py_INCREF(r) -#define __Pyx_DECREF(r) Py_DECREF(r) -#define __Pyx_GOTREF(r) -#define __Pyx_GIVEREF(r) -#define __Pyx_XDECREF(r) Py_XDECREF(r) -#define __Pyx_SetupRefcountContext(name) -#define __Pyx_FinishRefcountContext() -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r) -#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r) - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - - -static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); - } - return r; -} - -static INLINE void __Pyx_RaiseNoneNotIterableError(void); - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static INLINE void __Pyx_RaiseTooManyValuesError(void); - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -#if __PYX_USE_C99_COMPLEX - #define __Pyx_REAL_PART(z) __real__(z) - #define __Pyx_IMAG_PART(z) __imag__(z) -#else - #define __Pyx_REAL_PART(z) ((z).real) - #define __Pyx_IMAG_PART(z) ((z).imag) -#endif - -#define __pyx_PyObject_from_complex(z) PyComplex_FromDoubles((double)__Pyx_REAL_PART(z), (double)__Pyx_IMAG_PART(z)) - -#if __PYX_USE_C99_COMPLEX - - typedef float _Complex __pyx_t_float_complex; - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - - #define __pyx_t_float_complex_is_zero(a) ((a) == 0) - #define __pyx_t_float_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_float_complex_add(a, b) ((a)+(b)) - #define __pyx_t_float_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_float_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_float_complex_div(a, b) ((a)/(b)) - #define __pyx_t_float_complex_neg(a) (-(a)) - -#else - - typedef struct { float real, imag; } __pyx_t_float_complex; - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_float_complex_is_zero(__pyx_t_float_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_float_complex_eq(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_add(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_sub(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_mul(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_div(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_neg(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -#if __PYX_USE_C99_COMPLEX - - typedef double _Complex __pyx_t_double_complex; - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - - #define __pyx_t_double_complex_is_zero(a) ((a) == 0) - #define __pyx_t_double_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_double_complex_add(a, b) ((a)+(b)) - #define __pyx_t_double_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_double_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_double_complex_div(a, b) ((a)/(b)) - #define __pyx_t_double_complex_neg(a) (-(a)) - -#else - - typedef struct { double real, imag; } __pyx_t_double_complex; - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_double_complex_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_double_complex_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_add(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_sub(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_mul(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_div(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -#if __PYX_USE_C99_COMPLEX - - typedef long double _Complex __pyx_t_long__double_complex; - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) { - return x + y*(__pyx_t_long__double_complex)_Complex_I; - } - - #define __pyx_t_long__double_complex_is_zero(a) ((a) == 0) - #define __pyx_t_long__double_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_long__double_complex_add(a, b) ((a)+(b)) - #define __pyx_t_long__double_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_long__double_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_long__double_complex_div(a, b) ((a)/(b)) - #define __pyx_t_long__double_complex_neg(a) (-(a)) - -#else - - typedef struct { long double real, imag; } __pyx_t_long__double_complex; - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) { - __pyx_t_long__double_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_long__double_complex_is_zero(__pyx_t_long__double_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_long__double_complex_eq(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_add(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_sub(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_mul(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_div(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - long double denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_neg(__pyx_t_long__double_complex a) { - __pyx_t_long__double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - -static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/ - -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef __pyx_t_float_complex __pyx_t_5numpy_complex64_t; - -typedef __pyx_t_double_complex __pyx_t_5numpy_complex128_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":5 - * # available at build time. - * - * cdef struct _IplImage: # <<<<<<<<<<<<<< - * int nSize # sizeof(_IplImage) - * int ID # must be 0 - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplImage { - int nSize; - int ID; - int nChannels; - int alphaChannel; - int depth; - char colorModel[4]; - char channelSeq[4]; - int dataOrder; - int origin; - int align; - int width; - int height; - void *roi; - void *maskROI; - void *imageId; - void *tileInfo; - int imageSize; - char *imageData; - int widthStep; - int BorderMode[4]; - int BorderConst[4]; - char *imageDataOrigin; -}; - -typedef struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplImage __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":38 - * - * # you will never directly populate a CvMat. - * cdef union CvMat_uProxy: # <<<<<<<<<<<<<< - * unsigned char* ptr - * short* s - */ - -union __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat_uProxy { - unsigned char *ptr; - short *s; - int *i; - float *fl; - double *db; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":45 - * double* db - * - * cdef struct CvMat: # <<<<<<<<<<<<<< - * int type - * int step - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat { - int type; - int step; - int *refcount; - int hdr_refcount; - union __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat_uProxy data; - int rows; - int cols; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":54 - * int cols - * - * cdef struct CvPoint: # <<<<<<<<<<<<<< - * int x - * int y - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint { - int x; - int y; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":58 - * int y - * - * cdef struct CvPoint2D32f: # <<<<<<<<<<<<<< - * float x - * float y - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f { - float x; - float y; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":62 - * float y - * - * cdef struct CvSize: # <<<<<<<<<<<<<< - * int width - * int height - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize { - int width; - int height; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":66 - * int height - * - * cdef struct CvTermCriteria: # <<<<<<<<<<<<<< - * int type - * int max_iter - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria { - int type; - int max_iter; - double epsilon; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":71 - * double epsilon - * - * cdef struct CvScalar: # <<<<<<<<<<<<<< - * double val[4] - * - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar { - double val[4]; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":74 - * double val[4] - * - * cdef struct _IplConvKernel: # <<<<<<<<<<<<<< - * int nCols - * int nRows - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplConvKernel { - int nCols; - int nRows; - int anchorX; - int anchorY; - int *values; - int nShiftR; -}; - -typedef struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplConvKernel __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel; - -typedef __pyx_t_5numpy_uint8_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_UINT8_t; - -typedef __pyx_t_5numpy_int8_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT8_t; - -typedef __pyx_t_5numpy_int16_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT16_t; - -typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT32_t; - -typedef __pyx_t_5numpy_float32_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_FLOAT32_t; - -typedef __pyx_t_5numpy_float64_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_FLOAT64_t; - -typedef struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *(*__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvGetMatPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, int *, int); - -typedef __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *(*__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvCreateStructuringElementExPtr)(int, int, int, int, int, int *); - -typedef void (*__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvReleaseStructuringElementPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel **); -/* Module declarations from python_buffer */ - -/* Module declarations from stdlib */ - -/* Module declarations from stdio */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ -/* Module declarations from scikits.image.opencv.opencv_type */ - -/* Module declarations from python_version */ - -/* Module declarations from python_ref */ - -/* Module declarations from python_exc */ - -/* Module declarations from python_module */ - -/* Module declarations from python_mem */ - -/* Module declarations from python_tuple */ - -/* Module declarations from python_list */ - -/* Module declarations from python_object */ - -/* Module declarations from python_sequence */ - -/* Module declarations from python_mapping */ - -/* Module declarations from python_iterator */ - -/* Module declarations from python_type */ - -/* Module declarations from python_number */ - -/* Module declarations from python_int */ - -/* Module declarations from python_bool */ - -/* Module declarations from python_long */ - -/* Module declarations from python_float */ - -/* Module declarations from python_complex */ - -/* Module declarations from python_string */ - -/* Module declarations from python_unicode */ - -/* Module declarations from python_dict */ - -/* Module declarations from python_instance */ - -/* Module declarations from python_function */ - -/* Module declarations from python_method */ - -/* Module declarations from python_set */ - -/* Module declarations from python */ - -/* Module declarations from scikits.image.opencv.opencv_backend */ - -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8U; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8S; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16U; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16S; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32S; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32F; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_64F; -static int __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPLIMAGE_SIZE; -static __pyx_t_7scikits_5image_6opencv_14opencv_backend_cvGetMatPtr __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvGetMat; -static __pyx_t_7scikits_5image_6opencv_14opencv_backend_cvCreateStructuringElementExPtr __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvCreateStructuringElementEx; -static __pyx_t_7scikits_5image_6opencv_14opencv_backend_cvReleaseStructuringElementPtr __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvReleaseStructuringElement; -static void __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(PyArrayObject *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(PyArrayObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(PyArrayObject *, PyObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(PyArrayObject *, PyObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(PyArrayObject *, PyObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype(PyArrayObject *, PyArrayObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape(PyArrayObject *, PyArrayObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_width_and_height(PyArrayObject *, PyArrayObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_like(PyArrayObject *, PyArrayObject *); /*proto*/ -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_not_sharing_data(PyArrayObject *, PyArrayObject *); /*proto*/ -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(int, npy_intp *, PyObject *); /*proto*/ -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(PyArrayObject *); /*proto*/ -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(PyArrayObject *, PyObject *); /*proto*/ -static npy_intp __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_array_nbytes(PyArrayObject *); /*proto*/ -static npy_intp *__pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(PyArrayObject *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(PyArrayObject *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria(int, double); /*proto*/ -static __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array(PyArrayObject *, PyObject *); /*proto*/ -static void __pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *); /*proto*/ -#define __Pyx_MODULE_NAME "scikits.image.opencv.opencv_backend" -int __pyx_module_is_main_scikits__image__opencv__opencv_backend = 0; - -/* Implementation of scikits.image.opencv.opencv_backend */ -static char __pyx_k_32[] = "Could not load libcv"; -static char __pyx_k_33[] = "Could not load libcxcore"; -static PyObject *__pyx_int_2; -static char __pyx_k___main__[] = "__main__"; -static PyObject *__pyx_kp___main__; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k_ctypes[] = "ctypes"; -static PyObject *__pyx_kp_ctypes; -static char __pyx_k_opencv_constants[] = "opencv_constants"; -static PyObject *__pyx_kp_opencv_constants; -static char __pyx_k_31[] = "*"; -static PyObject *__pyx_kp_31; -static char __pyx_k__libimport[] = "_libimport"; -static PyObject *__pyx_kp__libimport; -static char __pyx_k_cv[] = "cv"; -static PyObject *__pyx_kp_cv; -static char __pyx_k_cxcore[] = "cxcore"; -static PyObject *__pyx_kp_cxcore; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static PyObject *__pyx_kp_RuntimeError; -static char __pyx_k_34[] = "uint8"; -static PyObject *__pyx_kp_34; -static char __pyx_k_35[] = "UINT8"; -static PyObject *__pyx_kp_35; -static char __pyx_k_36[] = "int8"; -static PyObject *__pyx_kp_36; -static char __pyx_k_37[] = "INT8"; -static PyObject *__pyx_kp_37; -static char __pyx_k_38[] = "uint16"; -static PyObject *__pyx_kp_38; -static char __pyx_k_39[] = "UINT16"; -static PyObject *__pyx_kp_39; -static char __pyx_k_40[] = "int16"; -static PyObject *__pyx_kp_40; -static char __pyx_k_41[] = "INT16"; -static PyObject *__pyx_kp_41; -static char __pyx_k_42[] = "int32"; -static PyObject *__pyx_kp_42; -static char __pyx_k_43[] = "INT32"; -static PyObject *__pyx_kp_43; -static char __pyx_k_44[] = "float32"; -static PyObject *__pyx_kp_44; -static char __pyx_k_45[] = "FLOAT32"; -static PyObject *__pyx_kp_45; -static char __pyx_k_46[] = "float64"; -static PyObject *__pyx_kp_46; -static char __pyx_k_47[] = "FLOAT64"; -static PyObject *__pyx_kp_47; -static char __pyx_k__ipltypes[] = "_ipltypes"; -static PyObject *__pyx_kp__ipltypes; -static char __pyx_k_addressof[] = "addressof"; -static PyObject *__pyx_kp_addressof; -static char __pyx_k_cvGetMat[] = "cvGetMat"; -static PyObject *__pyx_kp_cvGetMat; -static char __pyx_k_48[] = "cvCreateStructuringElementEx"; -static PyObject *__pyx_kp_48; -static char __pyx_k_49[] = "cvReleaseStructuringElement"; -static PyObject *__pyx_kp_49; -static char __pyx_k_dtype[] = "dtype"; -static PyObject *__pyx_kp_dtype; -static char __pyx_k_nbytes[] = "nbytes"; -static PyObject *__pyx_kp_nbytes; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_range[] = "range"; -static PyObject *__pyx_kp_range; -static char __pyx_k_CV_TERMCRIT_ITER[] = "CV_TERMCRIT_ITER"; -static PyObject *__pyx_kp_CV_TERMCRIT_ITER; -static char __pyx_k_CV_TERMCRIT_EPS[] = "CV_TERMCRIT_EPS"; -static PyObject *__pyx_kp_CV_TERMCRIT_EPS; -static char __pyx_k_CV_SHAPE_CUSTOM[] = "CV_SHAPE_CUSTOM"; -static PyObject *__pyx_kp_CV_SHAPE_CUSTOM; -static PyObject *__pyx_kp_32; -static PyObject *__pyx_kp_33; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_kp_50; -static PyObject *__pyx_kp_51; -static PyObject *__pyx_kp_52; -static char __pyx_k_50[] = "Arrays must have either 2 or 3 dimensions"; -static char __pyx_k_51[] = "A 3D array must have 4 or less channels"; -static char __pyx_k_52[] = "Arrays must have one of the following dtypes: uint8, int8, int16, int32, float32, float64"; -static PyObject *__pyx_kp_53; -static char __pyx_k_53[] = "Unsupported dtype for this operation. Supported dtypes are %s"; -static PyObject *__pyx_kp_54; -static char __pyx_k_54[] = "Incorrect number of dimensions"; -static PyObject *__pyx_kp_55; -static char __pyx_k_55[] = "Incorrect number of channels"; -static PyObject *__pyx_kp_56; -static char __pyx_k_56[] = "dtypes not same"; -static PyObject *__pyx_kp_57; -static char __pyx_k_57[] = "arrays not same shape"; -static PyObject *__pyx_kp_58; -static char __pyx_k_58[] = "Arrays must have same width and height"; -static PyObject *__pyx_kp_59; -static char __pyx_k_59[] = "In place operation not supported. Make sure the out array is not just a view of src array"; -static PyObject *__pyx_kp_60; -static PyObject *__pyx_kp_61; -static char __pyx_k_60[] = "anchor must be (x, y) tuple"; -static char __pyx_k_61[] = "anchor point must be inside kernel"; -static PyObject *__pyx_int_15; -static char __pyx_k___getbuffer__[] = "__getbuffer__"; -static PyObject *__pyx_kp___getbuffer__; -static char __pyx_k___releasebuffer__[] = "__releasebuffer__"; -static PyObject *__pyx_kp___releasebuffer__; -static char __pyx_k_info[] = "info"; -static PyObject *__pyx_kp_info; -static char __pyx_k_flags[] = "flags"; -static PyObject *__pyx_kp_flags; -static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_5; -static PyObject *__pyx_kp_23; -static char __pyx_k_1[] = "ndarray is not C contiguous"; -static char __pyx_k_2[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_3[] = ">"; -static char __pyx_k_4[] = "<"; -static char __pyx_k_5[] = "Non-native byte order not supported"; -static char __pyx_k_6[] = "b"; -static char __pyx_k_7[] = "B"; -static char __pyx_k_8[] = "h"; -static char __pyx_k_9[] = "H"; -static char __pyx_k_10[] = "i"; -static char __pyx_k_11[] = "I"; -static char __pyx_k_12[] = "l"; -static char __pyx_k_13[] = "L"; -static char __pyx_k_14[] = "q"; -static char __pyx_k_15[] = "Q"; -static char __pyx_k_16[] = "f"; -static char __pyx_k_17[] = "d"; -static char __pyx_k_18[] = "g"; -static char __pyx_k_19[] = "Zf"; -static char __pyx_k_20[] = "Zd"; -static char __pyx_k_21[] = "Zg"; -static char __pyx_k_22[] = "O"; -static char __pyx_k_23[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_24[] = "^"; -static PyObject *__pyx_kp_25; -static PyObject *__pyx_kp_28; -static PyObject *__pyx_kp_29; -static PyObject *__pyx_kp_30; -static char __pyx_k_25[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_26[] = ">"; -static char __pyx_k_27[] = "<"; -static char __pyx_k_28[] = "Non-native byte order not supported"; -static char __pyx_k_29[] = "Format string allocated too short."; -static char __pyx_k_30[] = "unknown dtype code in numpy.pxd (%d)"; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":64 - * c_cvGetMat = (ctypes.addressof(cxcore.cvGetMat))[0] - * - * cdef void populate_iplimage(np.ndarray arr, IplImage* img): # <<<<<<<<<<<<<< - * # The numpy array should be validated with the validate_array - * # function before using this function. - */ - -static void __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(PyArrayObject *__pyx_v_arr, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_img) { - int __pyx_v_ndim; - npy_intp *__pyx_v_shape; - npy_intp *__pyx_v_strides; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_SetupRefcountContext("populate_iplimage"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":71 - * - * # everything that will never change - * img.nSize = IPLIMAGE_SIZE # <<<<<<<<<<<<<< - * img.ID = 0 - * img.dataOrder = 0 - */ - __pyx_v_img->nSize = __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPLIMAGE_SIZE; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":72 - * # everything that will never change - * img.nSize = IPLIMAGE_SIZE - * img.ID = 0 # <<<<<<<<<<<<<< - * img.dataOrder = 0 - * img.origin = 0 - */ - __pyx_v_img->ID = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":73 - * img.nSize = IPLIMAGE_SIZE - * img.ID = 0 - * img.dataOrder = 0 # <<<<<<<<<<<<<< - * img.origin = 0 - * img.roi = NULL - */ - __pyx_v_img->dataOrder = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":74 - * img.ID = 0 - * img.dataOrder = 0 - * img.origin = 0 # <<<<<<<<<<<<<< - * img.roi = NULL - * img.maskROI = NULL - */ - __pyx_v_img->origin = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":75 - * img.dataOrder = 0 - * img.origin = 0 - * img.roi = NULL # <<<<<<<<<<<<<< - * img.maskROI = NULL - * img.imageId = NULL - */ - __pyx_v_img->roi = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":76 - * img.origin = 0 - * img.roi = NULL - * img.maskROI = NULL # <<<<<<<<<<<<<< - * img.imageId = NULL - * img.tileInfo = NULL - */ - __pyx_v_img->maskROI = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":77 - * img.roi = NULL - * img.maskROI = NULL - * img.imageId = NULL # <<<<<<<<<<<<<< - * img.tileInfo = NULL - * - */ - __pyx_v_img->imageId = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":78 - * img.maskROI = NULL - * img.imageId = NULL - * img.tileInfo = NULL # <<<<<<<<<<<<<< - * - * cdef int ndim = arr.ndim - */ - __pyx_v_img->tileInfo = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":80 - * img.tileInfo = NULL - * - * cdef int ndim = arr.ndim # <<<<<<<<<<<<<< - * cdef np.npy_intp* shape = arr.shape - * cdef np.npy_intp* strides = arr.strides - */ - __pyx_v_ndim = __pyx_v_arr->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":81 - * - * cdef int ndim = arr.ndim - * cdef np.npy_intp* shape = arr.shape # <<<<<<<<<<<<<< - * cdef np.npy_intp* strides = arr.strides - * - */ - __pyx_v_shape = __pyx_v_arr->dimensions; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":82 - * cdef int ndim = arr.ndim - * cdef np.npy_intp* shape = arr.shape - * cdef np.npy_intp* strides = arr.strides # <<<<<<<<<<<<<< - * - * # nChannels is essentially the value of np.shape[2] of a 3D numpy array - */ - __pyx_v_strides = __pyx_v_arr->strides; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":86 - * # nChannels is essentially the value of np.shape[2] of a 3D numpy array - * # for a 2D array, nChannels is 1 - * if ndim == 1: # <<<<<<<<<<<<<< - * # Might happen for a 1D vector - * img.nChannels = 1 - */ - __pyx_t_1 = (__pyx_v_ndim == 1); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":88 - * if ndim == 1: - * # Might happen for a 1D vector - * img.nChannels = 1 # <<<<<<<<<<<<<< - * img.width = 1 - * else: - */ - __pyx_v_img->nChannels = 1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":89 - * # Might happen for a 1D vector - * img.nChannels = 1 - * img.width = 1 # <<<<<<<<<<<<<< - * else: - * if ndim == 2: - */ - __pyx_v_img->width = 1; - goto __pyx_L3; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":91 - * img.width = 1 - * else: - * if ndim == 2: # <<<<<<<<<<<<<< - * img.nChannels = 1 - * else: - */ - __pyx_t_1 = (__pyx_v_ndim == 2); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":92 - * else: - * if ndim == 2: - * img.nChannels = 1 # <<<<<<<<<<<<<< - * else: - * img.nChannels = shape[2] - */ - __pyx_v_img->nChannels = 1; - goto __pyx_L4; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":94 - * img.nChannels = 1 - * else: - * img.nChannels = shape[2] # <<<<<<<<<<<<<< - * img.width = shape[1] - * - */ - __pyx_v_img->nChannels = (__pyx_v_shape[2]); - } - __pyx_L4:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":95 - * else: - * img.nChannels = shape[2] - * img.width = shape[1] # <<<<<<<<<<<<<< - * - * img.height = shape[0] - */ - __pyx_v_img->width = (__pyx_v_shape[1]); - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":97 - * img.width = shape[1] - * - * img.height = shape[0] # <<<<<<<<<<<<<< - * img.widthStep = strides[0] - * img.depth = _ipltypes[arr.dtype] - */ - __pyx_v_img->height = (__pyx_v_shape[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":98 - * - * img.height = shape[0] - * img.widthStep = strides[0] # <<<<<<<<<<<<<< - * img.depth = _ipltypes[arr.dtype] - * img.imageSize = arr.nbytes - */ - __pyx_v_img->widthStep = (__pyx_v_strides[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":99 - * img.height = shape[0] - * img.widthStep = strides[0] - * img.depth = _ipltypes[arr.dtype] # <<<<<<<<<<<<<< - * img.imageSize = arr.nbytes - * img.imageData = arr.data - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__ipltypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_t_2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_img->depth = __pyx_t_3; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":100 - * img.widthStep = strides[0] - * img.depth = _ipltypes[arr.dtype] - * img.imageSize = arr.nbytes # <<<<<<<<<<<<<< - * img.imageData = arr.data - * - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_nbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_img->imageSize = __pyx_t_3; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":101 - * img.depth = _ipltypes[arr.dtype] - * img.imageSize = arr.nbytes - * img.imageData = arr.data # <<<<<<<<<<<<<< - * - * # really doesn't matter what this is set to, because opencv only uses it to - */ - __pyx_v_img->imageData = ((char *)__pyx_v_arr->data); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":106 - * # deallocate images, but it will never attempt to deallocate images we - * # create ourselves. - * img.imageDataOrigin = NULL # <<<<<<<<<<<<<< - * - * cdef CvMat* cvmat_ptr_from_iplimage(IplImage* arr): - */ - __pyx_v_img->imageDataOrigin = ((char *)NULL); - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("scikits.image.opencv.opencv_backend.populate_iplimage"); - __pyx_L0:; - __Pyx_FinishRefcountContext(); -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":108 - * img.imageDataOrigin = NULL - * - * cdef CvMat* cvmat_ptr_from_iplimage(IplImage* arr): # <<<<<<<<<<<<<< - * # this functions takes an IplImage* and returns a CvMat* - * # it is designed so that we dont need a separate populate_cvmat - */ - -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_arr) { - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_mat_hdr; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_r; - __Pyx_SetupRefcountContext("cvmat_ptr_from_iplimage"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":115 - * # This means that you have to call PyMem_Free on the CvMat* when you're - * # done with it. - * cdef CvMat* mat_hdr = PyMem_Malloc(sizeof(CvMat)) # <<<<<<<<<<<<<< - * mat_hdr = c_cvGetMat(arr, mat_hdr, NULL, 0) - * return mat_hdr - */ - __pyx_v_mat_hdr = ((struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *)PyMem_Malloc((sizeof(struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat)))); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":116 - * # done with it. - * cdef CvMat* mat_hdr = PyMem_Malloc(sizeof(CvMat)) - * mat_hdr = c_cvGetMat(arr, mat_hdr, NULL, 0) # <<<<<<<<<<<<<< - * return mat_hdr - * - */ - __pyx_v_mat_hdr = __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvGetMat(__pyx_v_arr, __pyx_v_mat_hdr, NULL, 0); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":117 - * cdef CvMat* mat_hdr = PyMem_Malloc(sizeof(CvMat)) - * mat_hdr = c_cvGetMat(arr, mat_hdr, NULL, 0) - * return mat_hdr # <<<<<<<<<<<<<< - * - * cdef int validate_array(np.ndarray arr) except -1: - */ - __pyx_r = __pyx_v_mat_hdr; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":119 - * return mat_hdr - * - * cdef int validate_array(np.ndarray arr) except -1: # <<<<<<<<<<<<<< - * - * # this assertion prevents the use of slices, so - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(PyArrayObject *__pyx_v_arr) { - int __pyx_r; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("validate_array"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":127 - * - * - * if arr.ndim != 2 and arr.ndim != 3: # <<<<<<<<<<<<<< - * raise ValueError('Arrays must have either 2 or 3 dimensions') - * if arr.ndim == 3: - */ - if ((__pyx_v_arr->nd != 2)) { - __pyx_t_1 = (__pyx_v_arr->nd != 3); - } else { - __pyx_t_1 = (__pyx_v_arr->nd != 2); - } - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":128 - * - * if arr.ndim != 2 and arr.ndim != 3: - * raise ValueError('Arrays must have either 2 or 3 dimensions') # <<<<<<<<<<<<<< - * if arr.ndim == 3: - * if arr.shape[2] > 4: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_50); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_50); - __Pyx_GIVEREF(__pyx_kp_50); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":129 - * if arr.ndim != 2 and arr.ndim != 3: - * raise ValueError('Arrays must have either 2 or 3 dimensions') - * if arr.ndim == 3: # <<<<<<<<<<<<<< - * if arr.shape[2] > 4: - * raise ValueError('A 3D array must have 4 or less channels') - */ - __pyx_t_1 = (__pyx_v_arr->nd == 3); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":130 - * raise ValueError('Arrays must have either 2 or 3 dimensions') - * if arr.ndim == 3: - * if arr.shape[2] > 4: # <<<<<<<<<<<<<< - * raise ValueError('A 3D array must have 4 or less channels') - * if arr.dtype not in _ipltypes: - */ - __pyx_t_1 = ((__pyx_v_arr->dimensions[2]) > 4); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":131 - * if arr.ndim == 3: - * if arr.shape[2] > 4: - * raise ValueError('A 3D array must have 4 or less channels') # <<<<<<<<<<<<<< - * if arr.dtype not in _ipltypes: - * raise ValueError('Arrays must have one of the following dtypes: ' - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_51); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_51); - __Pyx_GIVEREF(__pyx_kp_51); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - goto __pyx_L4; - } - __pyx_L4:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":132 - * if arr.shape[2] > 4: - * raise ValueError('A 3D array must have 4 or less channels') - * if arr.dtype not in _ipltypes: # <<<<<<<<<<<<<< - * raise ValueError('Arrays must have one of the following dtypes: ' - * 'uint8, int8, int16, int32, float32, float64') - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__ipltypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = (!PySequence_Contains(__pyx_1, __pyx_t_2)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":133 - * raise ValueError('A 3D array must have 4 or less channels') - * if arr.dtype not in _ipltypes: - * raise ValueError('Arrays must have one of the following dtypes: ' # <<<<<<<<<<<<<< - * 'uint8, int8, int16, int32, float32, float64') - * return 1 - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_52); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_52); - __Pyx_GIVEREF(__pyx_kp_52); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":135 - * raise ValueError('Arrays must have one of the following dtypes: ' - * 'uint8, int8, int16, int32, float32, float64') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_dtype(np.ndarray arr, dtypes) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.validate_array"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":137 - * return 1 - * - * cdef int assert_dtype(np.ndarray arr, dtypes) except -1: # <<<<<<<<<<<<<< - * if arr.dtype not in dtypes: - * raise ValueError('Unsupported dtype for this operation. \ - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_dtypes) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_dtype"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":138 - * - * cdef int assert_dtype(np.ndarray arr, dtypes) except -1: - * if arr.dtype not in dtypes: # <<<<<<<<<<<<<< - * raise ValueError('Unsupported dtype for this operation. \ - * Supported dtypes are %s' % str(dtypes)) - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (!PySequence_Contains(__pyx_v_dtypes, __pyx_t_1)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":140 - * if arr.dtype not in dtypes: - * raise ValueError('Unsupported dtype for this operation. \ - * Supported dtypes are %s' % str(dtypes)) # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_dtypes); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtypes); - __Pyx_GIVEREF(__pyx_v_dtypes); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_53, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":141 - * raise ValueError('Unsupported dtype for this operation. \ - * Supported dtypes are %s' % str(dtypes)) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_ndims(np.ndarray arr, dims) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_dtype"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":143 - * return 1 - * - * cdef int assert_ndims(np.ndarray arr, dims) except -1: # <<<<<<<<<<<<<< - * if arr.ndim not in dims: - * raise ValueError('Incorrect number of dimensions') - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_dims) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_ndims"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":144 - * - * cdef int assert_ndims(np.ndarray arr, dims) except -1: - * if arr.ndim not in dims: # <<<<<<<<<<<<<< - * raise ValueError('Incorrect number of dimensions') - * return 1 - */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_arr->nd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (!PySequence_Contains(__pyx_v_dims, __pyx_t_1)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":145 - * cdef int assert_ndims(np.ndarray arr, dims) except -1: - * if arr.ndim not in dims: - * raise ValueError('Incorrect number of dimensions') # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_54); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_54); - __Pyx_GIVEREF(__pyx_kp_54); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":146 - * if arr.ndim not in dims: - * raise ValueError('Incorrect number of dimensions') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_nchannels(np.ndarray arr, channels) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_ndims"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":148 - * return 1 - * - * cdef int assert_nchannels(np.ndarray arr, channels) except -1: # <<<<<<<<<<<<<< - * cdef int nchannels - * if arr.ndim == 2: - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_channels) { - int __pyx_v_nchannels; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_nchannels"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":150 - * cdef int assert_nchannels(np.ndarray arr, channels) except -1: - * cdef int nchannels - * if arr.ndim == 2: # <<<<<<<<<<<<<< - * nchannels = 1 - * else: - */ - __pyx_t_1 = (__pyx_v_arr->nd == 2); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":151 - * cdef int nchannels - * if arr.ndim == 2: - * nchannels = 1 # <<<<<<<<<<<<<< - * else: - * nchannels = arr.shape[2] - */ - __pyx_v_nchannels = 1; - goto __pyx_L3; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":153 - * nchannels = 1 - * else: - * nchannels = arr.shape[2] # <<<<<<<<<<<<<< - * if nchannels not in channels: - * raise ValueError('Incorrect number of channels') - */ - __pyx_v_nchannels = (__pyx_v_arr->dimensions[2]); - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":154 - * else: - * nchannels = arr.shape[2] - * if nchannels not in channels: # <<<<<<<<<<<<<< - * raise ValueError('Incorrect number of channels') - * return 1 - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_nchannels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = (!PySequence_Contains(__pyx_v_channels, __pyx_t_2)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":155 - * nchannels = arr.shape[2] - * if nchannels not in channels: - * raise ValueError('Incorrect number of channels') # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_55); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_55); - __Pyx_GIVEREF(__pyx_kp_55); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":156 - * if nchannels not in channels: - * raise ValueError('Incorrect number of channels') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_same_dtype(np.ndarray arr1, np.ndarray arr2) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_nchannels"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":158 - * return 1 - * - * cdef int assert_same_dtype(np.ndarray arr1, np.ndarray arr2) except -1: # <<<<<<<<<<<<<< - * if arr1.dtype != arr2.dtype: - * raise ValueError('dtypes not same') - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) { - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_SetupRefcountContext("assert_same_dtype"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":159 - * - * cdef int assert_same_dtype(np.ndarray arr1, np.ndarray arr2) except -1: - * if arr1.dtype != arr2.dtype: # <<<<<<<<<<<<<< - * raise ValueError('dtypes not same') - * return 1 - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr1), __pyx_kp_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_arr2), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":160 - * cdef int assert_same_dtype(np.ndarray arr1, np.ndarray arr2) except -1: - * if arr1.dtype != arr2.dtype: - * raise ValueError('dtypes not same') # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_56); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_56); - __Pyx_GIVEREF(__pyx_kp_56); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":161 - * if arr1.dtype != arr2.dtype: - * raise ValueError('dtypes not same') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_same_shape(np.ndarray arr1, np.ndarray arr2) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_same_dtype"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":163 - * return 1 - * - * cdef int assert_same_shape(np.ndarray arr1, np.ndarray arr2) except -1: # <<<<<<<<<<<<<< - * if not np.PyArray_SAMESHAPE(arr1, arr2): - * raise ValueError('arrays not same shape') - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_same_shape"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":164 - * - * cdef int assert_same_shape(np.ndarray arr1, np.ndarray arr2) except -1: - * if not np.PyArray_SAMESHAPE(arr1, arr2): # <<<<<<<<<<<<<< - * raise ValueError('arrays not same shape') - * return 1 - */ - __pyx_t_1 = (!PyArray_SAMESHAPE(__pyx_v_arr1, __pyx_v_arr2)); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":165 - * cdef int assert_same_shape(np.ndarray arr1, np.ndarray arr2) except -1: - * if not np.PyArray_SAMESHAPE(arr1, arr2): - * raise ValueError('arrays not same shape') # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_57); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_57); - __Pyx_GIVEREF(__pyx_kp_57); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":166 - * if not np.PyArray_SAMESHAPE(arr1, arr2): - * raise ValueError('arrays not same shape') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_same_width_and_height(np.ndarray arr1, np.ndarray arr2) \ - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_same_shape"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":168 - * return 1 - * - * cdef int assert_same_width_and_height(np.ndarray arr1, np.ndarray arr2) \ # <<<<<<<<<<<<<< - * except -1: - * cdef np.npy_intp* shape1 = arr1.shape - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_width_and_height(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) { - npy_intp *__pyx_v_shape1; - npy_intp *__pyx_v_shape2; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_same_width_and_height"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":170 - * cdef int assert_same_width_and_height(np.ndarray arr1, np.ndarray arr2) \ - * except -1: - * cdef np.npy_intp* shape1 = arr1.shape # <<<<<<<<<<<<<< - * cdef np.npy_intp* shape2 = arr2.shape - * if (shape1[0] != shape2[0]) or (shape1[1] != shape2[1]): - */ - __pyx_v_shape1 = __pyx_v_arr1->dimensions; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":171 - * except -1: - * cdef np.npy_intp* shape1 = arr1.shape - * cdef np.npy_intp* shape2 = arr2.shape # <<<<<<<<<<<<<< - * if (shape1[0] != shape2[0]) or (shape1[1] != shape2[1]): - * raise ValueError('Arrays must have same width and height') - */ - __pyx_v_shape2 = __pyx_v_arr2->dimensions; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":172 - * cdef np.npy_intp* shape1 = arr1.shape - * cdef np.npy_intp* shape2 = arr2.shape - * if (shape1[0] != shape2[0]) or (shape1[1] != shape2[1]): # <<<<<<<<<<<<<< - * raise ValueError('Arrays must have same width and height') - * return 1 - */ - if (!((__pyx_v_shape1[0]) != (__pyx_v_shape2[0]))) { - __pyx_t_1 = ((__pyx_v_shape1[1]) != (__pyx_v_shape2[1])); - } else { - __pyx_t_1 = ((__pyx_v_shape1[0]) != (__pyx_v_shape2[0])); - } - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":173 - * cdef np.npy_intp* shape2 = arr2.shape - * if (shape1[0] != shape2[0]) or (shape1[1] != shape2[1]): - * raise ValueError('Arrays must have same width and height') # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_58); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_58); - __Pyx_GIVEREF(__pyx_kp_58); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":174 - * if (shape1[0] != shape2[0]) or (shape1[1] != shape2[1]): - * raise ValueError('Arrays must have same width and height') - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_like(np.ndarray arr1, np.ndarray arr2) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_same_width_and_height"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":176 - * return 1 - * - * cdef int assert_like(np.ndarray arr1, np.ndarray arr2) except -1: # <<<<<<<<<<<<<< - * assert_same_dtype(arr1, arr2) - * assert_same_shape(arr1, arr2) - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_like(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) { - int __pyx_r; - int __pyx_t_1; - __Pyx_SetupRefcountContext("assert_like"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":177 - * - * cdef int assert_like(np.ndarray arr1, np.ndarray arr2) except -1: - * assert_same_dtype(arr1, arr2) # <<<<<<<<<<<<<< - * assert_same_shape(arr1, arr2) - * return 1 - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype(__pyx_v_arr1, __pyx_v_arr2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":178 - * cdef int assert_like(np.ndarray arr1, np.ndarray arr2) except -1: - * assert_same_dtype(arr1, arr2) - * assert_same_shape(arr1, arr2) # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape(__pyx_v_arr1, __pyx_v_arr2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":179 - * assert_same_dtype(arr1, arr2) - * assert_same_shape(arr1, arr2) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int assert_not_sharing_data(np.ndarray arr1, np.ndarray arr2) except -1: - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_like"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":181 - * return 1 - * - * cdef int assert_not_sharing_data(np.ndarray arr1, np.ndarray arr2) except -1: # <<<<<<<<<<<<<< - * if arr1.data == arr2.data: - * raise ValueError('In place operation not supported. Make sure \ - */ - -static int __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_not_sharing_data(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) { - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("assert_not_sharing_data"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":182 - * - * cdef int assert_not_sharing_data(np.ndarray arr1, np.ndarray arr2) except -1: - * if arr1.data == arr2.data: # <<<<<<<<<<<<<< - * raise ValueError('In place operation not supported. Make sure \ - * the out array is not just a view of src array') - */ - __pyx_t_1 = (__pyx_v_arr1->data == __pyx_v_arr2->data); - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":183 - * cdef int assert_not_sharing_data(np.ndarray arr1, np.ndarray arr2) except -1: - * if arr1.data == arr2.data: - * raise ValueError('In place operation not supported. Make sure \ # <<<<<<<<<<<<<< - * the out array is not just a view of src array') - * return 1 - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_59); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_59); - __Pyx_GIVEREF(__pyx_kp_59); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":185 - * raise ValueError('In place operation not supported. Make sure \ - * the out array is not just a view of src array') - * return 1 # <<<<<<<<<<<<<< - * - * #----------------------------------------------------------------------------- - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.assert_not_sharing_data"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":190 - * # NumPy array convienences - * #----------------------------------------------------------------------------- - * cdef np.ndarray new_array(int ndim, np.npy_intp* shape, dtype): # <<<<<<<<<<<<<< - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) - */ - -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(int __pyx_v_ndim, npy_intp *__pyx_v_shape, PyObject *__pyx_v_dtype) { - PyArrayObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("new_array"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":192 - * cdef np.ndarray new_array(int ndim, np.npy_intp* shape, dtype): - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) # <<<<<<<<<<<<<< - * return PyArray_Empty(ndim, shape, dtype, 0) - * - */ - Py_INCREF(__pyx_v_dtype); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":193 - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) - * return PyArray_Empty(ndim, shape, dtype, 0) # <<<<<<<<<<<<<< - * - * cdef np.ndarray new_array_like(np.ndarray arr): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyArray_Empty(__pyx_v_ndim, __pyx_v_shape, __pyx_v_dtype, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.new_array"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":195 - * return PyArray_Empty(ndim, shape, dtype, 0) - * - * cdef np.ndarray new_array_like(np.ndarray arr): # <<<<<<<<<<<<<< - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(arr.dtype) - */ - -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(PyArrayObject *__pyx_v_arr) { - PyArrayObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_SetupRefcountContext("new_array_like"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":197 - * cdef np.ndarray new_array_like(np.ndarray arr): - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(arr.dtype) # <<<<<<<<<<<<<< - * return PyArray_Empty(arr.ndim, arr.shape, arr.dtype, 0) - * - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - Py_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":198 - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(arr.dtype) - * return PyArray_Empty(arr.ndim, arr.shape, arr.dtype, 0) # <<<<<<<<<<<<<< - * - * cdef np.ndarray new_array_like_diff_dtype(np.ndarray arr, dtype): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_kp_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyArray_Empty(__pyx_v_arr->nd, __pyx_v_arr->dimensions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.new_array_like"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":200 - * return PyArray_Empty(arr.ndim, arr.shape, arr.dtype, 0) - * - * cdef np.ndarray new_array_like_diff_dtype(np.ndarray arr, dtype): # <<<<<<<<<<<<<< - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) - */ - -static PyArrayObject *__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_dtype) { - PyArrayObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("new_array_like_diff_dtype"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":202 - * cdef np.ndarray new_array_like_diff_dtype(np.ndarray arr, dtype): - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) # <<<<<<<<<<<<<< - * return PyArray_Empty(arr.ndim, arr.shape, dtype, 0) - * - */ - Py_INCREF(__pyx_v_dtype); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":203 - * # need to incref because numpy will apprently steal a dtype reference - * Py_INCREF(dtype) - * return PyArray_Empty(arr.ndim, arr.shape, dtype, 0) # <<<<<<<<<<<<<< - * - * cdef np.npy_intp* clone_array_shape(np.ndarray arr): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyArray_Empty(__pyx_v_arr->nd, __pyx_v_arr->dimensions, __pyx_v_dtype, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.new_array_like_diff_dtype"); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":205 - * return PyArray_Empty(arr.ndim, arr.shape, dtype, 0) - * - * cdef np.npy_intp* clone_array_shape(np.ndarray arr): # <<<<<<<<<<<<<< - * # make sure you call PyMem_Free after you're done with the shape - * cdef int ndim = arr.ndim - */ - -static npy_intp *__pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(PyArrayObject *__pyx_v_arr) { - int __pyx_v_ndim; - npy_intp *__pyx_v_shape; - int __pyx_v_i; - npy_intp *__pyx_r; - int __pyx_t_1; - __Pyx_SetupRefcountContext("clone_array_shape"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":207 - * cdef np.npy_intp* clone_array_shape(np.ndarray arr): - * # make sure you call PyMem_Free after you're done with the shape - * cdef int ndim = arr.ndim # <<<<<<<<<<<<<< - * cdef np.npy_intp* shape = PyMem_Malloc( - * ndim * sizeof(np.npy_intp)) - */ - __pyx_v_ndim = __pyx_v_arr->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":209 - * cdef int ndim = arr.ndim - * cdef np.npy_intp* shape = PyMem_Malloc( - * ndim * sizeof(np.npy_intp)) # <<<<<<<<<<<<<< - * cdef int i - * for i in range(ndim): - */ - __pyx_v_shape = ((npy_intp *)PyMem_Malloc((__pyx_v_ndim * (sizeof(npy_intp))))); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":211 - * ndim * sizeof(np.npy_intp)) - * cdef int i - * for i in range(ndim): # <<<<<<<<<<<<<< - * shape[i] = arr.shape[i] - * return shape - */ - for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_v_ndim; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":212 - * cdef int i - * for i in range(ndim): - * shape[i] = arr.shape[i] # <<<<<<<<<<<<<< - * return shape - * - */ - (__pyx_v_shape[__pyx_v_i]) = (__pyx_v_arr->dimensions[__pyx_v_i]); - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":213 - * for i in range(ndim): - * shape[i] = arr.shape[i] - * return shape # <<<<<<<<<<<<<< - * - * cdef np.npy_intp get_array_nbytes(np.ndarray arr): - */ - __pyx_r = __pyx_v_shape; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":215 - * return shape - * - * cdef np.npy_intp get_array_nbytes(np.ndarray arr): # <<<<<<<<<<<<<< - * cdef np.npy_intp nbytes = np.PyArray_NBYTES(arr) - * return nbytes - */ - -static npy_intp __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_array_nbytes(PyArrayObject *__pyx_v_arr) { - npy_intp __pyx_v_nbytes; - npy_intp __pyx_r; - __Pyx_SetupRefcountContext("get_array_nbytes"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":216 - * - * cdef np.npy_intp get_array_nbytes(np.ndarray arr): - * cdef np.npy_intp nbytes = np.PyArray_NBYTES(arr) # <<<<<<<<<<<<<< - * return nbytes - * - */ - __pyx_v_nbytes = PyArray_NBYTES(__pyx_v_arr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":217 - * cdef np.npy_intp get_array_nbytes(np.ndarray arr): - * cdef np.npy_intp nbytes = np.PyArray_NBYTES(arr) - * return nbytes # <<<<<<<<<<<<<< - * - * #------------------------------------------------------------------------------- - */ - __pyx_r = __pyx_v_nbytes; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":222 - * # OpenCV convienences - * #------------------------------------------------------------------------------- - * cdef CvPoint2D32f* array_as_cvPoint2D32f_ptr(np.ndarray arr): # <<<<<<<<<<<<<< - * cdef CvPoint2D32f* point2Darr - * point2Darr = arr.data - */ - -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(PyArrayObject *__pyx_v_arr) { - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_v_point2Darr; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_r; - __Pyx_SetupRefcountContext("array_as_cvPoint2D32f_ptr"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":224 - * cdef CvPoint2D32f* array_as_cvPoint2D32f_ptr(np.ndarray arr): - * cdef CvPoint2D32f* point2Darr - * point2Darr = arr.data # <<<<<<<<<<<<<< - * return point2Darr - * - */ - __pyx_v_point2Darr = ((struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *)__pyx_v_arr->data); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":225 - * cdef CvPoint2D32f* point2Darr - * point2Darr = arr.data - * return point2Darr # <<<<<<<<<<<<<< - * - * cdef CvTermCriteria get_cvTermCriteria(int iterations, double epsilon): - */ - __pyx_r = __pyx_v_point2Darr; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":227 - * return point2Darr - * - * cdef CvTermCriteria get_cvTermCriteria(int iterations, double epsilon): # <<<<<<<<<<<<<< - * cdef CvTermCriteria crit - * if iterations and epsilon: - */ - -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria(int __pyx_v_iterations, double __pyx_v_epsilon) { - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria __pyx_v_crit; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria __pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_SetupRefcountContext("get_cvTermCriteria"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":229 - * cdef CvTermCriteria get_cvTermCriteria(int iterations, double epsilon): - * cdef CvTermCriteria crit - * if iterations and epsilon: # <<<<<<<<<<<<<< - * crit.type = (CV_TERMCRIT_ITER | CV_TERMCRIT_EPS) - * crit.max_iter = iterations - */ - if (__pyx_v_iterations) { - __pyx_t_1 = (__pyx_v_epsilon != 0); - } else { - __pyx_t_1 = __pyx_v_iterations; - } - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":230 - * cdef CvTermCriteria crit - * if iterations and epsilon: - * crit.type = (CV_TERMCRIT_ITER | CV_TERMCRIT_EPS) # <<<<<<<<<<<<<< - * crit.max_iter = iterations - * crit.epsilon = epsilon - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_TERMCRIT_ITER); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_TERMCRIT_EPS); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyNumber_Or(__pyx_1, __pyx_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_crit.type = ((int)__pyx_t_3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":231 - * if iterations and epsilon: - * crit.type = (CV_TERMCRIT_ITER | CV_TERMCRIT_EPS) - * crit.max_iter = iterations # <<<<<<<<<<<<<< - * crit.epsilon = epsilon - * elif iterations and not epsilon: - */ - __pyx_v_crit.max_iter = __pyx_v_iterations; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":232 - * crit.type = (CV_TERMCRIT_ITER | CV_TERMCRIT_EPS) - * crit.max_iter = iterations - * crit.epsilon = epsilon # <<<<<<<<<<<<<< - * elif iterations and not epsilon: - * crit.type = CV_TERMCRIT_ITER - */ - __pyx_v_crit.epsilon = __pyx_v_epsilon; - goto __pyx_L3; - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":233 - * crit.max_iter = iterations - * crit.epsilon = epsilon - * elif iterations and not epsilon: # <<<<<<<<<<<<<< - * crit.type = CV_TERMCRIT_ITER - * crit.max_iter = iterations - */ - if (__pyx_v_iterations) { - __pyx_t_1 = (!(__pyx_v_epsilon != 0)); - } else { - __pyx_t_1 = __pyx_v_iterations; - } - if (__pyx_t_1) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":234 - * crit.epsilon = epsilon - * elif iterations and not epsilon: - * crit.type = CV_TERMCRIT_ITER # <<<<<<<<<<<<<< - * crit.max_iter = iterations - * crit.epsilon = 0. - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_TERMCRIT_ITER); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_crit.type = ((int)__pyx_t_3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":235 - * elif iterations and not epsilon: - * crit.type = CV_TERMCRIT_ITER - * crit.max_iter = iterations # <<<<<<<<<<<<<< - * crit.epsilon = 0. - * else: - */ - __pyx_v_crit.max_iter = __pyx_v_iterations; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":236 - * crit.type = CV_TERMCRIT_ITER - * crit.max_iter = iterations - * crit.epsilon = 0. # <<<<<<<<<<<<<< - * else: - * crit.type = CV_TERMCRIT_EPS - */ - __pyx_v_crit.epsilon = 0.0; - goto __pyx_L3; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":238 - * crit.epsilon = 0. - * else: - * crit.type = CV_TERMCRIT_EPS # <<<<<<<<<<<<<< - * crit.max_iter = 0 - * crit.epsilon = epsilon - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_TERMCRIT_EPS); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_crit.type = ((int)__pyx_t_3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":239 - * else: - * crit.type = CV_TERMCRIT_EPS - * crit.max_iter = 0 # <<<<<<<<<<<<<< - * crit.epsilon = epsilon - * return crit - */ - __pyx_v_crit.max_iter = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":240 - * crit.type = CV_TERMCRIT_EPS - * crit.max_iter = 0 - * crit.epsilon = epsilon # <<<<<<<<<<<<<< - * return crit - * - */ - __pyx_v_crit.epsilon = __pyx_v_epsilon; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":241 - * crit.max_iter = 0 - * crit.epsilon = epsilon - * return crit # <<<<<<<<<<<<<< - * - * ctypedef IplConvKernel* (*cvCreateStructuringElementExPtr)(int, int, int, int, - */ - __pyx_r = __pyx_v_crit; - goto __pyx_L0; - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("scikits.image.opencv.opencv_backend.get_cvTermCriteria"); - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":254 - * ctypes.addressof(cv.cvReleaseStructuringElement))[0] - * - * cdef IplConvKernel* get_IplConvKernel_ptr_from_array(np.ndarray arr, anchor) \ # <<<<<<<<<<<<<< - * except NULL: - * # make sure you call free_IplConvKernel you're done with the kernel - */ - -static __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_anchor) { - int __pyx_v_rows; - int __pyx_v_cols; - int __pyx_v_anchorx; - int __pyx_v_anchory; - int *__pyx_v_values; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_v_iplkernel; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_r; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - __Pyx_SetupRefcountContext("get_IplConvKernel_ptr_from_array"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":257 - * except NULL: - * # make sure you call free_IplConvKernel you're done with the kernel - * validate_array(arr) # <<<<<<<<<<<<<< - * assert_ndims(arr, [2]) - * assert_dtype(arr, [INT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":258 - * # make sure you call free_IplConvKernel you're done with the kernel - * validate_array(arr) - * assert_ndims(arr, [2]) # <<<<<<<<<<<<<< - * assert_dtype(arr, [INT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_arr, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":259 - * validate_array(arr) - * assert_ndims(arr, [2]) - * assert_dtype(arr, [INT32]) # <<<<<<<<<<<<<< - * - * cdef int rows - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_43); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_arr, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":265 - * cdef int anchorx - * cdef int anchory - * if anchor is not None: # <<<<<<<<<<<<<< - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * anchorx = anchor[0] - */ - __pyx_t_3 = (__pyx_v_anchor != Py_None); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":266 - * cdef int anchory - * if anchor is not None: - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' # <<<<<<<<<<<<<< - * anchorx = anchor[0] - * anchory = anchor[1] - */ - #ifndef PYREX_WITHOUT_ASSERTIONS - __pyx_t_4 = PyObject_Length(__pyx_v_anchor); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!(__pyx_t_4 == 2))) { - PyErr_SetObject(PyExc_AssertionError, __pyx_kp_60); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":267 - * if anchor is not None: - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * anchorx = anchor[0] # <<<<<<<<<<<<<< - * anchory = anchor[1] - * assert (anchorx < arr.shape[1]) and (anchorx >= 0) \ - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_anchor, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_anchorx = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":268 - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * anchorx = anchor[0] - * anchory = anchor[1] # <<<<<<<<<<<<<< - * assert (anchorx < arr.shape[1]) and (anchorx >= 0) \ - * and (anchory < arr.shape[0]) and (anchory >= 0), \ - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_anchor, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_anchory = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":269 - * anchorx = anchor[0] - * anchory = anchor[1] - * assert (anchorx < arr.shape[1]) and (anchorx >= 0) \ # <<<<<<<<<<<<<< - * and (anchory < arr.shape[0]) and (anchory >= 0), \ - * 'anchor point must be inside kernel' - */ - #ifndef PYREX_WITHOUT_ASSERTIONS - if ((__pyx_v_anchorx < (__pyx_v_arr->dimensions[1]))) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":270 - * anchory = anchor[1] - * assert (anchorx < arr.shape[1]) and (anchorx >= 0) \ - * and (anchory < arr.shape[0]) and (anchory >= 0), \ # <<<<<<<<<<<<<< - * 'anchor point must be inside kernel' - * else: - */ - if ((__pyx_v_anchorx >= 0)) { - if ((__pyx_v_anchory < (__pyx_v_arr->dimensions[0]))) { - __pyx_t_3 = (__pyx_v_anchory >= 0); - } else { - __pyx_t_3 = (__pyx_v_anchory < (__pyx_v_arr->dimensions[0])); - } - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = (__pyx_v_anchorx >= 0); - } - __pyx_t_3 = __pyx_t_5; - } else { - __pyx_t_3 = (__pyx_v_anchorx < (__pyx_v_arr->dimensions[1])); - } - if (unlikely(!__pyx_t_3)) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":271 - * assert (anchorx < arr.shape[1]) and (anchorx >= 0) \ - * and (anchory < arr.shape[0]) and (anchory >= 0), \ - * 'anchor point must be inside kernel' # <<<<<<<<<<<<<< - * else: - * anchorx = (arr.shape[1] / 2.) - */ - PyErr_SetObject(PyExc_AssertionError, __pyx_kp_61); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - goto __pyx_L3; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":273 - * 'anchor point must be inside kernel' - * else: - * anchorx = (arr.shape[1] / 2.) # <<<<<<<<<<<<<< - * anchory = (arr.shape[0] / 2.) - * - */ - __pyx_v_anchorx = ((int)((__pyx_v_arr->dimensions[1]) / 2.0)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":274 - * else: - * anchorx = (arr.shape[1] / 2.) - * anchory = (arr.shape[0] / 2.) # <<<<<<<<<<<<<< - * - * rows = arr.shape[0] - */ - __pyx_v_anchory = ((int)((__pyx_v_arr->dimensions[0]) / 2.0)); - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":276 - * anchory = (arr.shape[0] / 2.) - * - * rows = arr.shape[0] # <<<<<<<<<<<<<< - * cols = arr.shape[1] - * - */ - __pyx_v_rows = (__pyx_v_arr->dimensions[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":277 - * - * rows = arr.shape[0] - * cols = arr.shape[1] # <<<<<<<<<<<<<< - * - * cdef int* values = arr.data - */ - __pyx_v_cols = (__pyx_v_arr->dimensions[1]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":279 - * cols = arr.shape[1] - * - * cdef int* values = arr.data # <<<<<<<<<<<<<< - * - * # this function copies the data from the array into (i'm guessing) - */ - __pyx_v_values = ((int *)__pyx_v_arr->data); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":286 - * cdef IplConvKernel* iplkernel = \ - * c_cvCreateStructuringElementEx(cols, rows, anchorx, anchory, - * CV_SHAPE_CUSTOM, values) # <<<<<<<<<<<<<< - * - * return iplkernel - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_SHAPE_CUSTOM); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_iplkernel = __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvCreateStructuringElementEx(__pyx_v_cols, __pyx_v_rows, __pyx_v_anchorx, __pyx_v_anchory, __pyx_t_1, __pyx_v_values); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":288 - * CV_SHAPE_CUSTOM, values) - * - * return iplkernel # <<<<<<<<<<<<<< - * - * cdef void free_IplConvKernel(IplConvKernel* iplkernel): - */ - __pyx_r = __pyx_v_iplkernel; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend.get_IplConvKernel_ptr_from_array"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":290 - * return iplkernel - * - * cdef void free_IplConvKernel(IplConvKernel* iplkernel): # <<<<<<<<<<<<<< - * c_cvReleaseStructuringElement(&iplkernel) - * - */ - -static void __pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_v_iplkernel) { - __Pyx_SetupRefcountContext("free_IplConvKernel"); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":291 - * - * cdef void free_IplConvKernel(IplConvKernel* iplkernel): - * c_cvReleaseStructuringElement(&iplkernel) # <<<<<<<<<<<<<< - * - * #------------------------------------------------------------------------------- - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvReleaseStructuringElement((&__pyx_v_iplkernel)); - - __Pyx_FinishRefcountContext(); -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":152 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - char *__pyx_t_7; - __Pyx_SetupRefcountContext("__getbuffer__"); - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":158 - * # of flags - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":159 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":161 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":163 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":164 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":166 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":168 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") - */ - if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":169 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not C contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":170 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_1); - __Pyx_GIVEREF(__pyx_kp_1); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":172 - * raise ValueError("ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") - */ - if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":173 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not Fortran contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":174 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_2); - __Pyx_GIVEREF(__pyx_kp_2); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":176 - * raise ValueError("ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":177 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":178 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - __pyx_t_4 = __pyx_v_copy_shape; - if (__pyx_t_4) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":181 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":182 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":183 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_v_ndim; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":184 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":185 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":187 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":189 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":190 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":191 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * cdef int offset - */ - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":201 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - if ((!__pyx_v_hasfields)) { - __pyx_t_1 = (!__pyx_v_copy_shape); - } else { - __pyx_t_1 = (!__pyx_v_hasfields); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":203 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - */ - if ((__pyx_v_descr->byteorder == '>')) { - __pyx_t_1 = __pyx_v_little_endian; - } else { - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - } - if (!__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":211 - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - if ((__pyx_v_descr->byteorder == '<')) { - __pyx_t_5 = (!__pyx_v_little_endian); - } else { - __pyx_t_5 = (__pyx_v_descr->byteorder == '<'); - } - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_1; - } - if (__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_5); - __Pyx_GIVEREF(__pyx_kp_5); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - __pyx_t_6 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_6; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_t_6 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_7; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":215 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_t_6 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_8; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":216 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_t_6 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_9; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_t_6 = (__pyx_v_t == NPY_INT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_10; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_t_6 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_11; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_12; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_t_6 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_13; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_14; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":222 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_t_6 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_15; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_t_6 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_16; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_t_6 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_17; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_18; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_t_6 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_19; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_t_6 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_20; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":228 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_t_6 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_21; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":229 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_6 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_22; - goto __pyx_L14; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_23, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L14:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":232 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":233 - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":236 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":240 - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - * &offset) # <<<<<<<<<<<<<< - * f[0] = 0 # Terminate format string - * - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_7; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":241 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = 0; - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":243 - * f[0] = 0 # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; - __Pyx_SetupRefcountContext("__releasebuffer__"); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - - __Pyx_FinishRefcountContext(); -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":690 - * ctypedef npy_cdouble complex_t - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields; - PyObject *__pyx_v_childname; - PyObject *__pyx_v_new_offset; - PyObject *__pyx_v_t; - char *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - char *__pyx_t_9; - __Pyx_SetupRefcountContext("_util_dtypestring"); - __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":697 - * cdef int delta_offset - * cdef tuple i - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":698 - * cdef tuple i - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":701 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - __Pyx_DECREF(__pyx_v_childname); - __pyx_v_childname = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":702 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - __pyx_1 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (!(likely(PyTuple_CheckExact(__pyx_1)) || (__pyx_1) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_1)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_1); - __pyx_1 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":703 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { - PyObject* tuple = ((PyObject *)__pyx_v_fields); - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((PyArray_Descr *)__pyx_2); - __pyx_2 = 0; - __Pyx_DECREF(__pyx_v_new_offset); - __pyx_v_new_offset = __pyx_3; - __pyx_3 = 0; - } else { - __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":705 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_3 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":706 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == '>' and little_endian) or - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_25); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_25); - __Pyx_GIVEREF(__pyx_kp_25); - __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":708 - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - */ - if ((__pyx_v_child->byteorder == '>')) { - __pyx_t_6 = __pyx_v_little_endian; - } else { - __pyx_t_6 = (__pyx_v_child->byteorder == '>'); - } - if (!__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":709 - * - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError("Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - if ((__pyx_v_child->byteorder == '<')) { - __pyx_t_7 = (!__pyx_v_little_endian); - } else { - __pyx_t_7 = (__pyx_v_child->byteorder == '<'); - } - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":710 - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_28); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_28); - __Pyx_GIVEREF(__pyx_kp_28); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":720 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_8) break; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":721 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 120; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":722 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f += 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":723 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - (__pyx_v_offset[0]) += 1; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":725 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":727 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_8 = (!PyDataType_HASFIELDS(__pyx_v_child)); - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":728 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError("Format string allocated too short.") - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_t); - __pyx_v_t = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":729 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short.") - * - */ - __pyx_t_8 = ((__pyx_v_end - __pyx_v_f) < 5); - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":730 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_29); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_29); - __Pyx_GIVEREF(__pyx_kp_29); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":733 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 98; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":734 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_4 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 66; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":735 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 104; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":736 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_4 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 72; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":737 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 105; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":738 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_4 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 73; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":739 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 108; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":740 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_4 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 76; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":741 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 113; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":742 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_4 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 81; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":743 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 102; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":744 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_4 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 100; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":745 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 103; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":746 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_4 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":747 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":748 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_4 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":749 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 79; - goto __pyx_L11; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":751 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - __pyx_t_4 = PyNumber_Remainder(__pyx_kp_30, __pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L11:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":752 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f += 1; - goto __pyx_L9; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_9; - } - __pyx_L9:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("numpy._util_dtypestring"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_fields); - __Pyx_DECREF(__pyx_v_childname); - __Pyx_DECREF(__pyx_v_new_offset); - __Pyx_DECREF(__pyx_v_t); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -static struct PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -char* __pyx_import_star_type_names[] = { - "IplImage", - "va_list", - "FLOAT64_t", - "cvCreateStructuringElementExPtr", - "Py_complex", - "_IplImage", - "cvReleaseStructuringElementPtr", - "FILE", - "CvMat", - "_inittab", - "_IplConvKernel", - "UINT8_t", - "cvGetMatPtr", - "CvScalar", - "INT16_t", - "CvMat_uProxy", - "FLOAT32_t", - "IplConvKernel", - "INT32_t", - "PyTypeObject", - "CvTermCriteria", - "PyObject", - "INT8_t", - "CvPoint2D32f", - "CvSize", - "PY_LONG_LONG", - "CvPoint", - "Py_UNICODE", - 0 -}; - -static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { - char** type_name = __pyx_import_star_type_names; - while (*type_name) { - if (__Pyx_StrEq(name, *type_name)) { - PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name); - goto bad; - } - type_name++; - } - if (0); - else if (__Pyx_StrEq(name, "IPL_DEPTH_8U")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8U = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8U == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_SIGN")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_32S")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32S = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32S == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_32F")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32F = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32F == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "c_cvGetMat")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvGetMat to scikits.image.opencv.opencv_backend.cvGetMatPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_8S")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8S = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8S == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "c_cvReleaseStructuringElement")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvReleaseStructuringElement to scikits.image.opencv.opencv_backend.cvReleaseStructuringElementPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_64F")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_64F = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_64F == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "c_cvCreateStructuringElementEx")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCreateStructuringElementEx to scikits.image.opencv.opencv_backend.cvCreateStructuringElementExPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_16U")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16U = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16U == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "IPL_DEPTH_16S")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16S = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16S == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else if (__Pyx_StrEq(name, "IPLIMAGE_SIZE")) { - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPLIMAGE_SIZE = __Pyx_PyInt_AsInt(o); if ((__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPLIMAGE_SIZE == (int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; - Py_DECREF(o); - } - else { - if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad; - } - return 0; - __pyx_L2_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_backend"); - bad: - Py_DECREF(o); - return -1; -} - - -/* import_all_from is an unexposed function from ceval.c */ - -static int -__Pyx_import_all_from(PyObject *locals, PyObject *v) -{ - PyObject *all = __Pyx_GetAttrString(v, "__all__"); - PyObject *dict, *name, *value; - int skip_leading_underscores = 0; - int pos, err; - - if (all == NULL) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; /* Unexpected error */ - PyErr_Clear(); - dict = __Pyx_GetAttrString(v, "__dict__"); - if (dict == NULL) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; - PyErr_SetString(PyExc_ImportError, - "from-import-* object has no __dict__ and no __all__"); - return -1; - } - all = PyMapping_Keys(dict); - Py_DECREF(dict); - if (all == NULL) - return -1; - skip_leading_underscores = 1; - } - - for (pos = 0, err = 0; ; pos++) { - name = PySequence_GetItem(all, pos); - if (name == NULL) { - if (!PyErr_ExceptionMatches(PyExc_IndexError)) - err = -1; - else - PyErr_Clear(); - break; - } - if (skip_leading_underscores && -#if PY_MAJOR_VERSION < 3 - PyString_Check(name) && - PyString_AS_STRING(name)[0] == '_') -#else - PyUnicode_Check(name) && - PyUnicode_AS_UNICODE(name)[0] == '_') -#endif - { - Py_DECREF(name); - continue; - } - value = PyObject_GetAttr(v, name); - if (value == NULL) - err = -1; - else if (PyDict_CheckExact(locals)) - err = PyDict_SetItem(locals, name, value); - else - err = PyObject_SetItem(locals, name, value); - Py_DECREF(name); - Py_XDECREF(value); - if (err != 0) - break; - } - Py_DECREF(all); - return err; -} - - -static int __pyx_import_star(PyObject* m) { - - int i; - int ret = -1; - char* s; - PyObject *locals = 0; - PyObject *list = 0; - PyObject *name; - PyObject *item; - - locals = PyDict_New(); if (!locals) goto bad; - if (__Pyx_import_all_from(locals, m) < 0) goto bad; - list = PyDict_Items(locals); if (!list) goto bad; - - for(i=0; i= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("opencv_backend"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 1, 1, 1}, - {&__pyx_kp_opencv_constants, __pyx_k_opencv_constants, sizeof(__pyx_k_opencv_constants), 1, 1, 1}, - {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 1, 1, 1}, - {&__pyx_kp__libimport, __pyx_k__libimport, sizeof(__pyx_k__libimport), 1, 1, 1}, - {&__pyx_kp_cv, __pyx_k_cv, sizeof(__pyx_k_cv), 1, 1, 1}, - {&__pyx_kp_cxcore, __pyx_k_cxcore, sizeof(__pyx_k_cxcore), 1, 1, 1}, - {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 1, 1, 1}, - {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0}, - {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 1, 1, 1}, - {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 1, 0}, - {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 1, 1, 1}, - {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0}, - {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 1, 1, 1}, - {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0}, - {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 1, 1, 1}, - {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 1, 0}, - {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 1, 1, 1}, - {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 1, 0}, - {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 1, 1, 1}, - {&__pyx_kp__ipltypes, __pyx_k__ipltypes, sizeof(__pyx_k__ipltypes), 1, 1, 1}, - {&__pyx_kp_addressof, __pyx_k_addressof, sizeof(__pyx_k_addressof), 1, 1, 1}, - {&__pyx_kp_cvGetMat, __pyx_k_cvGetMat, sizeof(__pyx_k_cvGetMat), 1, 1, 1}, - {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 1, 1, 1}, - {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 1, 1, 1}, - {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1}, - {&__pyx_kp_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_range, __pyx_k_range, sizeof(__pyx_k_range), 1, 1, 1}, - {&__pyx_kp_CV_TERMCRIT_ITER, __pyx_k_CV_TERMCRIT_ITER, sizeof(__pyx_k_CV_TERMCRIT_ITER), 1, 1, 1}, - {&__pyx_kp_CV_TERMCRIT_EPS, __pyx_k_CV_TERMCRIT_EPS, sizeof(__pyx_k_CV_TERMCRIT_EPS), 1, 1, 1}, - {&__pyx_kp_CV_SHAPE_CUSTOM, __pyx_k_CV_SHAPE_CUSTOM, sizeof(__pyx_k_CV_SHAPE_CUSTOM), 1, 1, 1}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 0}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 0}, - {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 0}, - {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 0}, - {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 0}, - {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 0}, - {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 0}, - {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 0}, - {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 0}, - {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 0}, - {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 0}, - {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 0}, - {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 0}, - {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 0}, - {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1}, - {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1}, - {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1}, - {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, - {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0}, - {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0}, - {&__pyx_kp_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 0}, - {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 0}, - {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 0}, - {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_kp_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initopencv_backend(void); /*proto*/ -PyMODINIT_FUNC initopencv_backend(void) -#else -PyMODINIT_FUNC PyInit_opencv_backend(void); /*proto*/ -PyMODINIT_FUNC PyInit_opencv_backend(void) -#endif -{ - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - __pyx_init_filenames(); - #ifdef CYTHON_REFNANNY - void* __pyx_refchk = NULL; - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); - if (!__Pyx_Refnanny) { - PyErr_Clear(); - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); - if (!__Pyx_Refnanny) - Py_FatalError("failed to import refnanny module"); - } - __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_opencv_backend(void)", __LINE__, __FILE__); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("opencv_backend"), __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__pyx_module_is_main_scikits__image__opencv__opencv_backend) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("populate_iplimage", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage, "void (PyArrayObject *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("cvmat_ptr_from_iplimage", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("validate_array", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array, "int (PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_dtype", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_ndims", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_nchannels", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_same_dtype", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_same_shape", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_same_width_and_height", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_width_and_height, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_like", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_like, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("assert_not_sharing_data", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_not_sharing_data, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("new_array", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array, "PyArrayObject *(int, npy_intp *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("new_array_like", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like, "PyArrayObject *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("new_array_like_diff_dtype", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype, "PyArrayObject *(PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("get_array_nbytes", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_array_nbytes, "npy_intp (PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("clone_array_shape", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape, "npy_intp *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("array_as_cvPoint2D32f_ptr", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("get_cvTermCriteria", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria (int, double)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("get_IplConvKernel_ptr_from_array", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array, "__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *(PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("free_IplConvKernel", (void (*)(void))__pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel, "void (__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":1 - * import ctypes # <<<<<<<<<<<<<< - * import numpy as np - * cimport numpy as np - */ - __pyx_1 = __Pyx_Import(__pyx_kp_ctypes, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_ctypes, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":2 - * import ctypes - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as np - * from python cimport * - */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":5 - * cimport numpy as np - * from python cimport * - * from opencv_constants import * # <<<<<<<<<<<<<< - * from opencv_type cimport * - * from _libimport import cv, cxcore - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_31); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_31); - __Pyx_GIVEREF(__pyx_kp_31); - __pyx_1 = __Pyx_Import(__pyx_kp_opencv_constants, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":7 - * from opencv_constants import * - * from opencv_type cimport * - * from _libimport import cv, cxcore # <<<<<<<<<<<<<< - * - * if cv is None: - */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_cv); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_cv); - __Pyx_GIVEREF(__pyx_kp_cv); - __Pyx_INCREF(__pyx_kp_cxcore); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_cxcore); - __Pyx_GIVEREF(__pyx_kp_cxcore); - __pyx_1 = __Pyx_Import(__pyx_kp__libimport, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cv, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_cxcore); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cxcore, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":9 - * from _libimport import cv, cxcore - * - * if cv is None: # <<<<<<<<<<<<<< - * raise RuntimeError("Could not load libcv") - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = (__pyx_1 == Py_None); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_t_2) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":10 - * - * if cv is None: - * raise RuntimeError("Could not load libcv") # <<<<<<<<<<<<<< - * - * if cxcore is None: - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_32); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_32); - __Pyx_GIVEREF(__pyx_kp_32); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L2; - } - __pyx_L2:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":12 - * raise RuntimeError("Could not load libcv") - * - * if cxcore is None: # <<<<<<<<<<<<<< - * raise RuntimeError("Could not load libcxcore") - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cxcore); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = (__pyx_2 == Py_None); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - if (__pyx_t_2) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":13 - * - * if cxcore is None: - * raise RuntimeError("Could not load libcxcore") # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_33); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_33); - __Pyx_GIVEREF(__pyx_kp_33); - __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":17 - * - * # setup numpy tables for this module - * np.import_array() # <<<<<<<<<<<<<< - * - * #----------------------------------------------------------------------------- - */ - import_array(); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":25 - * # for some reason these have to declared as dtype objects rather than just the - * # dtype itself.... - * UINT8 = np.dtype('uint8') # <<<<<<<<<<<<<< - * INT8 = np.dtype('int8') - * UINT16 = np.dtype('uint16') - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_34); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_34); - __Pyx_GIVEREF(__pyx_kp_34); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_35, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":26 - * # dtype itself.... - * UINT8 = np.dtype('uint8') - * INT8 = np.dtype('int8') # <<<<<<<<<<<<<< - * UINT16 = np.dtype('uint16') - * INT16 = np.dtype('int16') - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_36); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_36); - __Pyx_GIVEREF(__pyx_kp_36); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_37, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":27 - * UINT8 = np.dtype('uint8') - * INT8 = np.dtype('int8') - * UINT16 = np.dtype('uint16') # <<<<<<<<<<<<<< - * INT16 = np.dtype('int16') - * INT32 = np.dtype('int32') - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_38); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_38); - __Pyx_GIVEREF(__pyx_kp_38); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_39, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":28 - * INT8 = np.dtype('int8') - * UINT16 = np.dtype('uint16') - * INT16 = np.dtype('int16') # <<<<<<<<<<<<<< - * INT32 = np.dtype('int32') - * FLOAT32 = np.dtype('float32') - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_40); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_40); - __Pyx_GIVEREF(__pyx_kp_40); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_41, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":29 - * UINT16 = np.dtype('uint16') - * INT16 = np.dtype('int16') - * INT32 = np.dtype('int32') # <<<<<<<<<<<<<< - * FLOAT32 = np.dtype('float32') - * FLOAT64 = np.dtype('float64') - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_42); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_42); - __Pyx_GIVEREF(__pyx_kp_42); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_43, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":30 - * INT16 = np.dtype('int16') - * INT32 = np.dtype('int32') - * FLOAT32 = np.dtype('float32') # <<<<<<<<<<<<<< - * FLOAT64 = np.dtype('float64') - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_44); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_44); - __Pyx_GIVEREF(__pyx_kp_44); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_45, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":31 - * INT32 = np.dtype('int32') - * FLOAT32 = np.dtype('float32') - * FLOAT64 = np.dtype('float64') # <<<<<<<<<<<<<< - * - * cdef int IPL_DEPTH_SIGN = 0x80000000 - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_46); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_46); - __Pyx_GIVEREF(__pyx_kp_46); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_47, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":33 - * FLOAT64 = np.dtype('float64') - * - * cdef int IPL_DEPTH_SIGN = 0x80000000 # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_8U = 8 - * cdef int IPL_DEPTH_8S = (IPL_DEPTH_SIGN | 8) - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN = 0x80000000; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":34 - * - * cdef int IPL_DEPTH_SIGN = 0x80000000 - * cdef int IPL_DEPTH_8U = 8 # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_8S = (IPL_DEPTH_SIGN | 8) - * cdef int IPL_DEPTH_16U = 16 - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8U = 8; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":35 - * cdef int IPL_DEPTH_SIGN = 0x80000000 - * cdef int IPL_DEPTH_8U = 8 - * cdef int IPL_DEPTH_8S = (IPL_DEPTH_SIGN | 8) # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_16U = 16 - * cdef int IPL_DEPTH_16S = (IPL_DEPTH_SIGN | 16) - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8S = (__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN | 8); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":36 - * cdef int IPL_DEPTH_8U = 8 - * cdef int IPL_DEPTH_8S = (IPL_DEPTH_SIGN | 8) - * cdef int IPL_DEPTH_16U = 16 # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_16S = (IPL_DEPTH_SIGN | 16) - * cdef int IPL_DEPTH_32S = (IPL_DEPTH_SIGN | 32) - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16U = 16; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":37 - * cdef int IPL_DEPTH_8S = (IPL_DEPTH_SIGN | 8) - * cdef int IPL_DEPTH_16U = 16 - * cdef int IPL_DEPTH_16S = (IPL_DEPTH_SIGN | 16) # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_32S = (IPL_DEPTH_SIGN | 32) - * cdef int IPL_DEPTH_32F = 32 - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16S = (__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN | 16); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":38 - * cdef int IPL_DEPTH_16U = 16 - * cdef int IPL_DEPTH_16S = (IPL_DEPTH_SIGN | 16) - * cdef int IPL_DEPTH_32S = (IPL_DEPTH_SIGN | 32) # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_32F = 32 - * cdef int IPL_DEPTH_64F = 64 - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32S = (__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_SIGN | 32); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":39 - * cdef int IPL_DEPTH_16S = (IPL_DEPTH_SIGN | 16) - * cdef int IPL_DEPTH_32S = (IPL_DEPTH_SIGN | 32) - * cdef int IPL_DEPTH_32F = 32 # <<<<<<<<<<<<<< - * cdef int IPL_DEPTH_64F = 64 - * - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32F = 32; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":40 - * cdef int IPL_DEPTH_32S = (IPL_DEPTH_SIGN | 32) - * cdef int IPL_DEPTH_32F = 32 - * cdef int IPL_DEPTH_64F = 64 # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_64F = 64; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":45 - * # I'd like a better to associate the IPL data type flag to the proper numpy - * # types without using a dictionary. - * _ipltypes = {UINT8: IPL_DEPTH_8U, INT8: IPL_DEPTH_8S, UINT16: IPL_DEPTH_16U, # <<<<<<<<<<<<<< - * INT16: IPL_DEPTH_16S, INT32: IPL_DEPTH_32S, FLOAT32: IPL_DEPTH_32F, - * FLOAT64: IPL_DEPTH_64F} - */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_35); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8U); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_37); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_8S); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_39); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16U); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":46 - * # types without using a dictionary. - * _ipltypes = {UINT8: IPL_DEPTH_8U, INT8: IPL_DEPTH_8S, UINT16: IPL_DEPTH_16U, - * INT16: IPL_DEPTH_16S, INT32: IPL_DEPTH_32S, FLOAT32: IPL_DEPTH_32F, # <<<<<<<<<<<<<< - * FLOAT64: IPL_DEPTH_64F} - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_16S); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_43); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32S); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_45); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_32F); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":47 - * _ipltypes = {UINT8: IPL_DEPTH_8U, INT8: IPL_DEPTH_8S, UINT16: IPL_DEPTH_16U, - * INT16: IPL_DEPTH_16S, INT32: IPL_DEPTH_32S, FLOAT32: IPL_DEPTH_32F, - * FLOAT64: IPL_DEPTH_64F} # <<<<<<<<<<<<<< - * - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_47); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_7scikits_5image_6opencv_14opencv_backend_IPL_DEPTH_64F); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp__ipltypes, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":55 - * - * - * cdef int IPLIMAGE_SIZE = sizeof(IplImage) # <<<<<<<<<<<<<< - * - * # a function to convert from IplImage to cvMat - */ - __pyx_v_7scikits_5image_6opencv_14opencv_backend_IPLIMAGE_SIZE = (sizeof(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":62 - * ctypedef CvMat* (*cvGetMatPtr)(IplImage*, CvMat*, int*, int) - * cdef cvGetMatPtr c_cvGetMat - * c_cvGetMat = (ctypes.addressof(cxcore.cvGetMat))[0] # <<<<<<<<<<<<<< - * - * cdef void populate_iplimage(np.ndarray arr, IplImage* img): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cxcore); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvGetMat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvGetMat = (((__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvGetMatPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":247 - * cdef cvCreateStructuringElementExPtr c_cvCreateStructuringElementEx - * c_cvCreateStructuringElementEx = ( - * ctypes.addressof(cv.cvCreateStructuringElementEx))[0] # <<<<<<<<<<<<<< - * - * ctypedef void (*cvReleaseStructuringElementPtr)(IplConvKernel**) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvCreateStructuringElementEx = (((__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvCreateStructuringElementExPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_backend.pyx":252 - * cdef cvReleaseStructuringElementPtr c_cvReleaseStructuringElement - * c_cvReleaseStructuringElement = ( - * ctypes.addressof(cv.cvReleaseStructuringElement))[0] # <<<<<<<<<<<<<< - * - * cdef IplConvKernel* get_IplConvKernel_ptr_from_array(np.ndarray arr, anchor) \ - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_49); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_14opencv_backend_c_cvReleaseStructuringElement = (((__pyx_t_7scikits_5image_6opencv_14opencv_backend_cvReleaseStructuringElementPtr *)((size_t)__pyx_t_5))[0]); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/python_mem.pxd":1 - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * - * ##################################################################### - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - __Pyx_AddTraceback("init scikits.image.opencv.opencv_backend"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.image.opencv.opencv_backend"); - } - __pyx_L0:; - __Pyx_FinishRefcountContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -static const char *__pyx_filenames[] = { - "opencv_backend.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - - -static INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); -} - -static INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); -} - -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(); - } -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunctionObjArgs(__import__, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - -#if PY_MAJOR_VERSION >= 3 - /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */ - if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) { - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - PyErr_NormalizeException(&type, &value, &tb); - PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb); - tstate->exc_type = 0; - tstate->exc_value = 0; - tstate->exc_traceback = 0; - PyException_SetContext(value, tmp_value); - Py_DECREF(tmp_type); - Py_XDECREF(tmp_tb); - } -#endif - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((char)-1) > ((char)0) && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((short)-1) > ((short)0) && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((int)-1) > ((int)0) && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (((unsigned long)-1) < ((unsigned long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((long)-1) > ((long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (((long)-1) < ((long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (((signed long)-1) < ((signed long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - -static INLINE int __Pyx_StrEq(const char *s1, const char *s2) { - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - return *s1 == *s2; -} - -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { -#if PY_VERSION_HEX < 0x02050000 - char *api = (char *)"__pyx_capi__"; -#else - const char *api = "__pyx_capi__"; -#endif - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - - - d = PyObject_GetAttrString(__pyx_m, api); - if (!d) { - PyErr_Clear(); - d = PyDict_New(); - if (!d) - goto bad; - Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, api, d) < 0) - goto bad; - } - tmp.fp = f; - cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); - if (!cobj) - goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) - goto bad; - Py_DECREF(cobj); - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(cobj); - Py_XDECREF(d); - return -1; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/scikits/image/opencv/opencv_cv.c b/scikits/image/opencv/opencv_cv.c deleted file mode 100644 index afa07c8c..00000000 --- a/scikits/image/opencv/opencv_cv.c +++ /dev/null @@ -1,20655 +0,0 @@ -/* Generated by Cython 0.11.3 on Mon Nov 2 16:14:53 2009 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyString_CheckExact PyBytes_CheckExact - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__scikits__image__opencv__opencv_cv -#include "stdlib.h" -#include "stdio.h" -#include "numpy/arrayobject.h" -#define __PYX_USE_C99_COMPLEX defined(_Complex_I) - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - - -#ifdef CYTHON_REFNANNY -typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*NewContext)(const char*, int, const char*); - void (*FinishContext)(void**); -} __Pyx_RefnannyAPIStruct; -static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; -#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI") -#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r) -#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__) -#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk) -#else -#define __Pyx_INCREF(r) Py_INCREF(r) -#define __Pyx_DECREF(r) Py_DECREF(r) -#define __Pyx_GOTREF(r) -#define __Pyx_GIVEREF(r) -#define __Pyx_XDECREF(r) Py_XDECREF(r) -#define __Pyx_SetupRefcountContext(name) -#define __Pyx_FinishRefcountContext() -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r) -#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r) - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - - -static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); - } - return r; -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static INLINE void __Pyx_RaiseNoneNotIterableError(void); - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static INLINE void __Pyx_RaiseTooManyValuesError(void); - -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); - -static INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject *); - -static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ - } - else { - PyObject *r, *m; - m = __Pyx_GetAttrString(L, "append"); - if (!m) return NULL; - r = PyObject_CallFunctionObjArgs(m, x, NULL); - Py_DECREF(m); - return r; - } -} - -static int __Pyx_Print(PyObject *, int); /*proto*/ -#if PY_MAJOR_VERSION >= 3 -static PyObject* __pyx_print = 0; -static PyObject* __pyx_print_kwargs = 0; -#endif - -static int __Pyx_PrintOne(PyObject *o); /*proto*/ - -#if __PYX_USE_C99_COMPLEX - #define __Pyx_REAL_PART(z) __real__(z) - #define __Pyx_IMAG_PART(z) __imag__(z) -#else - #define __Pyx_REAL_PART(z) ((z).real) - #define __Pyx_IMAG_PART(z) ((z).imag) -#endif - -#define __pyx_PyObject_from_complex(z) PyComplex_FromDoubles((double)__Pyx_REAL_PART(z), (double)__Pyx_IMAG_PART(z)) - -#if __PYX_USE_C99_COMPLEX - - typedef float _Complex __pyx_t_float_complex; - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - - #define __pyx_t_float_complex_is_zero(a) ((a) == 0) - #define __pyx_t_float_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_float_complex_add(a, b) ((a)+(b)) - #define __pyx_t_float_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_float_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_float_complex_div(a, b) ((a)/(b)) - #define __pyx_t_float_complex_neg(a) (-(a)) - -#else - - typedef struct { float real, imag; } __pyx_t_float_complex; - static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_float_complex_is_zero(__pyx_t_float_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_float_complex_eq(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_add(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_sub(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_mul(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_div(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_float_complex __pyx_t_float_complex_neg(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -#if __PYX_USE_C99_COMPLEX - - typedef double _Complex __pyx_t_double_complex; - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - - #define __pyx_t_double_complex_is_zero(a) ((a) == 0) - #define __pyx_t_double_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_double_complex_add(a, b) ((a)+(b)) - #define __pyx_t_double_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_double_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_double_complex_div(a, b) ((a)/(b)) - #define __pyx_t_double_complex_neg(a) (-(a)) - -#else - - typedef struct { double real, imag; } __pyx_t_double_complex; - static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_double_complex_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_double_complex_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_add(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_sub(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_mul(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_div(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_double_complex __pyx_t_double_complex_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -#if __PYX_USE_C99_COMPLEX - - typedef long double _Complex __pyx_t_long__double_complex; - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) { - return x + y*(__pyx_t_long__double_complex)_Complex_I; - } - - #define __pyx_t_long__double_complex_is_zero(a) ((a) == 0) - #define __pyx_t_long__double_complex_eq(a, b) ((a) == (b)) - #define __pyx_t_long__double_complex_add(a, b) ((a)+(b)) - #define __pyx_t_long__double_complex_sub(a, b) ((a)-(b)) - #define __pyx_t_long__double_complex_mul(a, b) ((a)*(b)) - #define __pyx_t_long__double_complex_div(a, b) ((a)/(b)) - #define __pyx_t_long__double_complex_neg(a) (-(a)) - -#else - - typedef struct { long double real, imag; } __pyx_t_long__double_complex; - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) { - __pyx_t_long__double_complex c; c.real = x; c.imag = y; return c; - } - - static INLINE int __pyx_t_long__double_complex_is_zero(__pyx_t_long__double_complex a) { - return (a.real == 0) & (a.imag == 0); - } - - static INLINE int __pyx_t_long__double_complex_eq(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - return (a.real == b.real) & (a.imag == b.imag); - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_add(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_sub(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_mul(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_div(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) { - __pyx_t_long__double_complex z; - long double denom = b.real*b.real + b.imag*b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - - static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_neg(__pyx_t_long__double_complex a) { - __pyx_t_long__double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - -#endif - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef __pyx_t_float_complex __pyx_t_5numpy_complex64_t; - -typedef __pyx_t_double_complex __pyx_t_5numpy_complex128_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":5 - * # available at build time. - * - * cdef struct _IplImage: # <<<<<<<<<<<<<< - * int nSize # sizeof(_IplImage) - * int ID # must be 0 - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplImage { - int nSize; - int ID; - int nChannels; - int alphaChannel; - int depth; - char colorModel[4]; - char channelSeq[4]; - int dataOrder; - int origin; - int align; - int width; - int height; - void *roi; - void *maskROI; - void *imageId; - void *tileInfo; - int imageSize; - char *imageData; - int widthStep; - int BorderMode[4]; - int BorderConst[4]; - char *imageDataOrigin; -}; - -typedef struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplImage __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":38 - * - * # you will never directly populate a CvMat. - * cdef union CvMat_uProxy: # <<<<<<<<<<<<<< - * unsigned char* ptr - * short* s - */ - -union __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat_uProxy { - unsigned char *ptr; - short *s; - int *i; - float *fl; - double *db; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":45 - * double* db - * - * cdef struct CvMat: # <<<<<<<<<<<<<< - * int type - * int step - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat { - int type; - int step; - int *refcount; - int hdr_refcount; - union __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat_uProxy data; - int rows; - int cols; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":54 - * int cols - * - * cdef struct CvPoint: # <<<<<<<<<<<<<< - * int x - * int y - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint { - int x; - int y; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":58 - * int y - * - * cdef struct CvPoint2D32f: # <<<<<<<<<<<<<< - * float x - * float y - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f { - float x; - float y; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":62 - * float y - * - * cdef struct CvSize: # <<<<<<<<<<<<<< - * int width - * int height - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize { - int width; - int height; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":66 - * int height - * - * cdef struct CvTermCriteria: # <<<<<<<<<<<<<< - * int type - * int max_iter - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria { - int type; - int max_iter; - double epsilon; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":71 - * double epsilon - * - * cdef struct CvScalar: # <<<<<<<<<<<<<< - * double val[4] - * - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar { - double val[4]; -}; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_type.pxd":74 - * double val[4] - * - * cdef struct _IplConvKernel: # <<<<<<<<<<<<<< - * int nCols - * int nRows - */ - -struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplConvKernel { - int nCols; - int nRows; - int anchorX; - int anchorY; - int *values; - int nShiftR; -}; - -typedef struct __pyx_t_7scikits_5image_6opencv_11opencv_type__IplConvKernel __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel; - -typedef __pyx_t_5numpy_uint8_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_UINT8_t; - -typedef __pyx_t_5numpy_int8_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT8_t; - -typedef __pyx_t_5numpy_int16_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT16_t; - -typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_INT32_t; - -typedef __pyx_t_5numpy_float32_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_FLOAT32_t; - -typedef __pyx_t_5numpy_float64_t __pyx_t_7scikits_5image_6opencv_14opencv_backend_FLOAT64_t; - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSobelPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLaplacePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCannyPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, double, double, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPreCorneDetectPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecsPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenValPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerHarrisPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int, double); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPixPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *, int, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrackPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *, int *, double, double, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int, double); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPixPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPixPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvResizePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpAffinePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, int, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspectivePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, int, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLogPolarPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f, double, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvErodePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDilatePtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvMorphologyExPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *, int, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSmoothPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int, int, int, double, double); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFilter2DPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvIntegralPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCvtColorPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef double (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvThresholdPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, double, double, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThresholdPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, double, int, int, int, double); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrDownPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrUpPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2Ptr)(struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCornersPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *, int *, int); - -typedef void (*__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCornersPtr)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize, struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *, int, int); -/* Module declarations from python_buffer */ - -/* Module declarations from stdlib */ - -/* Module declarations from stdio */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ -/* Module declarations from python_version */ - -/* Module declarations from python_ref */ - -/* Module declarations from python_exc */ - -/* Module declarations from python_module */ - -/* Module declarations from python_mem */ - -/* Module declarations from python_tuple */ - -/* Module declarations from python_list */ - -/* Module declarations from python_object */ - -/* Module declarations from python_sequence */ - -/* Module declarations from python_mapping */ - -/* Module declarations from python_iterator */ - -/* Module declarations from python_type */ - -/* Module declarations from python_number */ - -/* Module declarations from python_int */ - -/* Module declarations from python_bool */ - -/* Module declarations from python_long */ - -/* Module declarations from python_float */ - -/* Module declarations from python_complex */ - -/* Module declarations from python_string */ - -/* Module declarations from python_unicode */ - -/* Module declarations from python_dict */ - -/* Module declarations from python_instance */ - -/* Module declarations from python_function */ - -/* Module declarations from python_method */ - -/* Module declarations from python_set */ - -/* Module declarations from python */ - -/* Module declarations from scikits.image.opencv.opencv_type */ - -/* Module declarations from scikits.image.opencv.opencv_backend */ - -static void (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage)(PyArrayObject *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array)(PyArrayObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype)(PyArrayObject *, PyObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims)(PyArrayObject *, PyObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels)(PyArrayObject *, PyObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype)(PyArrayObject *, PyArrayObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape)(PyArrayObject *, PyArrayObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_width_and_height)(PyArrayObject *, PyArrayObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_like)(PyArrayObject *, PyArrayObject *); /*proto*/ -static int (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_not_sharing_data)(PyArrayObject *, PyArrayObject *); /*proto*/ -static PyArrayObject *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array)(int, npy_intp *, PyObject *); /*proto*/ -static PyArrayObject *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like)(PyArrayObject *); /*proto*/ -static PyArrayObject *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype)(PyArrayObject *, PyObject *); /*proto*/ -static npy_intp (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_array_nbytes)(PyArrayObject *); /*proto*/ -static npy_intp *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape)(PyArrayObject *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr)(PyArrayObject *); /*proto*/ -static struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria)(int, double); /*proto*/ -static __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *(*__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array)(PyArrayObject *, PyObject *); /*proto*/ -static void (*__pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel)(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *); /*proto*/ -/* Module declarations from scikits.image.opencv.opencv_cv */ - -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSobelPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSobel; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLaplacePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLaplace; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCannyPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCanny; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPreCorneDetectPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPreCornerDetect; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecsPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerEigenValsAndVecs; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenValPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerMinEigenVal; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerHarrisPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerHarris; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPixPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindCornerSubPix; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrackPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGoodFeaturesToTrack; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPixPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetRectSubPix; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPixPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetQuadrangleSubPix; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvResizePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvResize; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpAffinePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpAffine; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspectivePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpPerspective; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLogPolarPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLogPolar; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvErodePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvErode; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDilatePtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDilate; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvMorphologyExPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvMorphologyEx; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSmoothPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSmooth; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFilter2DPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFilter2D; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvIntegralPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvIntegral; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCvtColorPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCvtColor; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvThresholdPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvThreshold; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThresholdPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvAdaptiveThreshold; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrDownPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrDown; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrUpPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrUp; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2Ptr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCalibrateCamera2; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCornersPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindChessboardCorners; -static __pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCornersPtr __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDrawChessboardCorners; -static PyObject *__pyx_k_142 = 0; -static PyObject *__pyx_k_152 = 0; -static int __pyx_k_156; -static int __pyx_k_161; -static PyObject *__pyx_k_162 = 0; -static int __pyx_k_166; -static PyObject *__pyx_k_167 = 0; -static int __pyx_k_171; -static PyObject *__pyx_k_175 = 0; -static PyObject *__pyx_k_179 = 0; -static PyObject *__pyx_k_183 = 0; -static int __pyx_k_187; -static PyObject *__pyx_k_188 = 0; -static PyObject *__pyx_k_192 = 0; -static PyObject *__pyx_k_196 = 0; -static PyObject *__pyx_k_197 = 0; -static int __pyx_k_204; -static PyObject *__pyx_k_205 = 0; -static int __pyx_k_210; -static int __pyx_k_211; -static int __pyx_k_225; -static PyObject *__pyx_k_229 = 0; -#define __Pyx_MODULE_NAME "scikits.image.opencv.opencv_cv" -int __pyx_module_is_main_scikits__image__opencv__opencv_cv = 0; - -/* Implementation of scikits.image.opencv.opencv_cv */ -static char __pyx_k_38[] = "Could not load libcv"; -static char __pyx_k_123[] = "cvSobel(src, xorder=1, yorder=0, aperture_size=3)\n\nApply the Sobel operator to the input image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, int8, float32]\n The source image.\nxorder : integer\n The x order of the Sobel operator.\nyorder : integer\n The y order of the Sobel operator.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new which is the result of applying the Sobel\n operator to src."; -static char __pyx_k_126[] = "cvLaplace(src, aperture_size=3)\n\nApply the Laplace operator to the input image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, int8, float32]\n The source image.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new which is the result of applying the Laplace\n operator to src."; -static char __pyx_k_129[] = "cvCanny(src, threshold1=10, threshold2=50, aperture_size=3)\n\nApply Canny edge detection to the input image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8]\n The source image.\nthreshold1 : float\n The lower threshold used for edge linking.\nthreshold2 : float\n The upper threshold used to find strong edges.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new which is the result of applying Canny\n edge detection to src."; -static char __pyx_k_132[] = "cvPreCornerDetect(src, aperture_size=3)\n\nCalculate the feature map for corner detection.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\n The source image.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new array of the corner candidates."; -static char __pyx_k_135[] = "cvCornerEigenValsAndVecs(src, block_size=3, aperture_size=3)\n\nCalculates the eigenvalues and eigenvectors of image\nblocks for corner detection.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\n The source image.\nblock_size : integer\n The size of the neighborhood in which to calculate\n the eigenvalues and eigenvectors.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new array of the eigenvalues and eigenvectors.\n The shape of this array is (height, width, 6),\n Where height and width are the same as that\n of src."; -static char __pyx_k_138[] = "cvCornerMinEigenVal(src, block_size=3, aperture_size=3)\n\nCalculates the minimum eigenvalues of gradient matrices\nfor corner detection.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\n The source image.\nblock_size : integer\n The size of the neighborhood in which to calculate\n the eigenvalues.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\n\nReturns\n-------\nout : ndarray\n A new array of the eigenvalues."; -static char __pyx_k_141[] = "cvCornerHarris(src, block_size=3, aperture_size=3, k=0.04)\n\nApplies the Harris edge detector to the input image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\n The source image.\nblock_size : integer\n The size of the neighborhood in which to apply the detector.\naperture_size : integer=[3, 5, 7]\n The size of the Sobel kernel.\nk : float\n Harris detector free parameter. See Notes.\n\nReturns\n-------\nout : ndarray\n A new array of the Harris corners.\n\nNotes\n-----\nThe function cvCornerHarris() runs the Harris edge\ndetector on the image. Similarly to cvCornerMinEigenVal()\nand cvCornerEigenValsAndVecs(), for each pixel it calculates\na gradient covariation matrix M over a block_size X block_size\nneighborhood. Then, it stores det(M) - k * trace(M)**2\nto the output image. Corners in the image can be found as the\nlocal maxima of the output image."; -static char __pyx_k_145[] = "cvFindCornerSubPix(src, corners, win, zero_zone=(-1, -1), iterations=0, epsilon=1e-5)\n\nRefines corner locations to sub-pixel accuracy.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8]\n The source image.\ncorners : ndarray, shape=(N x 2)\n An initial approximation of the corners in the image.\n The corners will be refined in-place in this array.\nwin : tuple, (height, width)\n The window within which the function iterates until it\n converges on the real corner. The actual window is twice\n the size of what is declared here. (an OpenCV peculiarity).\nzero_zone : Half of the size of the dead region in the middle\n of the search zone over which the calculations are not\n performed. It is used sometimes to avoid possible\n singularities of the autocorrelation matrix.\n The value of (-1,-1) indicates that there is no such size.\niterations : integer\n The maximum number of iterations to perform. If 0,\n the function iterates until the error is less than epsilon.\nepsilon : float\n The epsilon error, below which the function terminates.\n Can be used in combination with iterations.\n\nReturns\n-------\nNone. The array 'corners' is modified in place."; -static char __pyx_k_148[] = "cvGoodFeaturesToTrack(src, corner_count, quality_level, min_distance, block_size=3, use_harris=0, k=0.04)\n\nDetermines strong corners in an image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\n The source image.\ncorner_count : int\n The maximum number of corners to find.\n Only found corners are returned.\nquality_level : float\n Multiplier for the max/min eigenvalue;\n specifies the minimal accepted quality of\n image corners.\nmin_distance : float\n Limit, specifying the minimum possible\n distance between the returned corners;\n Euclidian distance is used.\nblock_size : integer\n The size of the neighborhood in which to apply the detector.\nuse_harris : integer\n If nonzero, Harris operator (cvCornerHarris())\n is used instead of default cvCornerMinEigenVal()\nk : float\n Harris detector free parameter.\n Used only if use_harris != 0.\n\nReturns\n-------\nout : ndarray\n The locations of the found corners in the image.\n\nNotes\n-----\nThis function finds distinct and strong corners\nin an image which can be used as features in a tracking\nalgorithm. It also insures that features are distanced\nfrom one another by at least min_distance."; -static char __pyx_k_151[] = "cvGetRectSubPix(src, size, center)\n\nRetrieves the pixel rectangle from an image with\nsub-pixel accuracy.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nsize : two tuple, integers, (height, width)\n The size of the rectangle to extract.\ncenter : two tuple, floats, (x, y)\n The center location of the rectangle.\n The center must lie within the image, but the\n rectangle may extend beyond the bounds of the image.\n\nReturns\n-------\nout : ndarray\n The extracted rectangle of the image.\n\nNotes\n-----\nThe center of the specified rectangle must\nlie within the image, but the bounds of the rectangle\nmay extend beyond the image. Border replication is used\nto fill in missing pixels."; -static char __pyx_k_155[] = "cvGetQuadrangleSubPix(src, warpmat, float_out=False)\n\nRetrieves the pixel quandrangle from an image with\nsub-pixel accuracy. In english: apply an affine transform to an image.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nwarpmat : ndarray, 2x3\n The affine transformation to apply to the src image.\nfloat_out : bool\n If True, the return array will have dtype np.float32.\n Otherwise, the return array will have the same dtype\n as the src array.\n If True, the src array MUST have dtype np.uint8\n\nReturns\n-------\nout : ndarray\n Warped image of same size as src.\n\nNotes\n-----\nThe values of pixels at non-integer coordinates are retrieved\nusing bilinear interpolation. When the function needs pixels\noutside of the image, it uses replication border mode to\nreconstruct the values. Every channel of multiple-channel\nimages is processed independently.\n\nThis function has less overhead than cvWarpAffine\nand should be used unless specific feature of that\nfunction are required."; -static char __pyx_k_159[] = "cvResize(src, size, method=CV_INTER_LINEAR)\n\nResize an to the given size.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nsize : tuple, (height, width)\n The target resize size.\nmethod : integer\n The interpolation method used for resizing.\n Supported methods are:\n CV_INTER_NN\n CV_INTER_LINEAR\n CV_INTER_AREA\n CV_INTER_CUBIC\n\nReturns\n-------\nout : ndarray\n The resized image."; -static char __pyx_k_165[] = "cvWarpAffine(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.))\n\nApplies an affine transformation to the image.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nwarpmat : ndarray, 2x3\n The affine transformation to apply to the src image.\nflag : integer\n A combination of interpolation and method flags.\n Supported flags are: (see notes)\n Interpolation:\n CV_INTER_NN\n CV_INTER_LINEAR\n CV_INTER_AREA\n CV_INTER_CUBIC\n Method:\n CV_WARP_FILL_OUTLIERS\n CV_WARP_INVERSE_MAP\nfillval : 4-tuple, (R, G, B, A)\n The color to fill in missing pixels. Defaults to black.\n For < 4 channel images, use 0.'s for the value.\n\nReturns\n-------\nout : ndarray\n The warped image of same size and dtype as src.\n\nNotes\n-----\nCV_WARP_FILL_OUTLIERS - fills all of the destination image pixels;\n if some of them correspond to outliers in the source image,\n they are set to fillval.\nCV_WARP_INVERSE_MAP - indicates that warpmat is inversely transformed\n from the destination image to the source and, thus, can be used\n directly for pixel interpolation. Otherwise, the function finds\n the inverse transform from warpmat.\n\nThis function has a larger overhead than cvGetQuadrangleSubPix,\nand that function should be used instead, unless specific\nfeatures of this function are needed."; -static char __pyx_k_170[] = "cvWarpPerspective(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.))\n\nApplies a perspective transformation to an image.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nwarpmat : ndarray, 3x3\n The affine transformation to apply to the src image.\nflag : integer\n A combination of interpolation and method flags.\n Supported flags are: (see notes)\n Interpolation:\n CV_INTER_NN\n CV_INTER_LINEAR\n CV_INTER_AREA\n CV_INTER_CUBIC\n Method:\n CV_WARP_FILL_OUTLIERS\n CV_WARP_INVERSE_MAP\nfillval : 4-tuple, (R, G, B, A)\n The color to fill in missing pixels. Defaults to black.\n For < 4 channel images, use 0.'s for the value.\n\nReturns\n-------\nout : ndarray\n The warped image of same size and dtype as src.\n\nNotes\n-----\nCV_WARP_FILL_OUTLIERS - fills all of the destination image pixels;\n if some of them correspond to outliers in the source image,\n they are set to fillval.\nCV_WARP_INVERSE_MAP - indicates that warpmat is inversely transformed\n from the destination image to the source and, thus, can be used\n directly for pixel interpolation. Otherwise, the function finds\n the inverse transform from warpmat."; -static char __pyx_k_174[] = "cvLogPolar(src, center, M, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS)\n\nRemaps and image to Log-Polar space.\n\nParameters\n----------\nsrc : ndarray\n The source image.\ncenter : tuple, (x, y)\n The keypoint for the log polar transform.\nM : float\n The scale factor for the transform.\n (40 is a good starting point for a 256x256 image)\nflag : integer\n A combination of interpolation and method flags.\n Supported flags are: (see notes)\n Interpolation:\n CV_INTER_NN\n CV_INTER_LINEAR\n CV_INTER_AREA\n CV_INTER_CUBIC\n Method:\n CV_WARP_FILL_OUTLIERS\n CV_WARP_INVERSE_MAP\n\nReturns\n-------\nout : ndarray\n A transformed image the same size and dtype as src.\n\nNotes\n-----\nCV_WARP_FILL_OUTLIERS - fills all of the destination image pixels;\n if some of them correspond to outliers in the source image,\n they are set to zero.\nCV_WARP_INVERSE_MAP - assume that the source image is already\n in Log-Polar space, and transform back to cartesian space.\n\nThe function emulates the human \342\200\234foveal\342\200\235 vision and can be used\nfor fast scale and rotation-invariant template matching,\nfor object tracking and so forth."; -static char __pyx_k_178[] = "cvErode(src, element=None, iterations=1, anchor=None, in_place=False)\n\nErode the source image with the given element.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nelement : ndarray, 2D\n The structuring element. Must be 2D. Non-zero elements\n indicate which pixels of the underlying image to include\n in the operation as the element is slid over the image.\n If None, a 3x3 block element is used.\niterations : integer\n The number of times to perform the operation.\nanchor: 2-tuple, (x, y)\n The anchor of the structuring element. Must be\n FULLY inside the element. If None, the center of the\n element is used.\nin_place: bool\n If True, perform the operation in place.\n Otherwise, store the results in a new image.\n\nReturns\n-------\nout/None : ndarray or None\n An new array is returned only if in_place=False.\n Otherwise, this function returns None."; -static char __pyx_k_182[] = "cvDilate(src, element=None, iterations=1, anchor=None, in_place=False)\n\nDilate the source image with the given element.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nelement : ndarray, 2D\n The structuring element. Must be 2D. Non-zero elements\n indicate which pixels of the underlying image to include\n in the operation as the element is slid over the image.\n If None, a 3x3 block element is used.\niterations : integer\n The number of times to perform the operation.\nanchor: 2-tuple, (x, y)\n The anchor of the structuring element. Must be\n FULLY inside the element. If None, the center of the\n element is used.\nin_place: bool\n If True, perform the operation in place.\n Otherwise, store the results in a new image.\n\nReturns\n-------\nout/None : ndarray or None\n An new array is returned only if in_place=False.\n Otherwise, this function returns None."; -static char __pyx_k_186[] = "cvMorphologyEx(src, element, operation, iterations=1, anchor=None, in_place=False)\n\nApply a morphological operation to the image.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nelement : ndarray, 2D\n The structuring element. Must be 2D. Non-zero elements\n indicate which pixels of the underlying image to include\n in the operation as the element is slid over the image.\n Cannot be None.\noperation : flag\n The morphology operation to perform. Must be one of:\n CV_MOP_OPEN\n CV_MOP_CLOSE\n CV_MOP_GRADIENT\n CV_MOP_TOPHAT\n CV_MOP_BLACKHAT\niterations : integer\n The number of times to perform the operation.\nanchor: 2-tuple, (x, y)\n The anchor of the structuring element. Must be\n FULLY inside the element. If None, the center of the\n element is used.\nin_place: bool\n If True, perform the operation in place.\n Otherwise, store the results in a new image.\n\nReturns\n-------\nout/None : ndarray or None\n An new array is returned only if in_place=False.\n Otherwise, this function returns None."; -static char __pyx_k_191[] = "cvSmooth(src, smoothtype=CV_GAUSSIAN, param1=3, param2=0, param3=0., param4=0., in_place=False)\n\nSmooth an image with the specified filter.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nsmoothtype : integer\n The flag representing which smoothing operation to perfom.\n See notes on restrictions.\n Must be one of:\n CV_BLUR_NO_SCALE\n CV_BLUR\n CV_GAUSSIAN\n CV_MEDIAN\n CV_BILATERAL\nparam1 : integer\n See notes.\nparam2 : integer\n See notes.\nparam3 : float\n See notes.\nparam4 : float\n See notes.\nin_place : bool\n If True, perform the operation in place.\n This is not supported for every combination of arguments.\n See notes.\n\nReturns\n-------\nout/None : ndarray or None\n If in_place == True the function operates in place and returns None.\n Otherwise, the operation returns a new array that is\n the result of the smoothing operation.\n\nNotes\n-----\nThe following details the restrictions and argument interpretaions\nfor each of the smoothing operations.\n\nCV_BLUR_NO_SCALE:\n Source image must be 2D and have dtype uint8, int8, or float32.\n param1 x param2 define the neighborhood over which the pixels\n are summed. If param2 is zero it is set equal to param1.\n param3 and param4 are ignored.\n in_place operation is not supported.\nCV_BLUR:\n Source image must have dtype uint8, int8, or float32.\n param1 x param2 define the neighborhood over which the pixels\n are summed. If param2 is zero it is set equal to param1.\n param3 and param4 are ignored.\nCV_GAUSSIAN:\n Source image must have dtype uint8, int8, or float32.\n param1 x param2 defines the size of the gaussian kernel.\n If param2 is zero it is set equal to param1.\n param3 is the standard deviation of the kernel.\n If param3 is zero, an optimum stddev is calculated based\n on the kernel size. If both param1 and param2 or zero,\n then an optimum kernel size is calculated based on\n param3.\n in_place operation is supported.\nCV_MEDIAN:\n Source image must have dtype uint8, or int8.\n param1 x param1 define the neigborhood over which\n to find the median.\n param2, param3, and param4 are ignored.\n in_place operation is not supported.\nCV_BILATERAL:\n Source image must have dtype uint8, or int8.\n param1 x param2 define the neighborhood.\n param3 defines the color stddev.\n param4 defines the space stddev.\n in_place operation is not supported.\n\nUsing standard sigma for small kernels (3x3 to 7x7)\ngives better speed."; -static char __pyx_k_195[] = "cvFilter2D(src, kernel, anchor=None, in_place=False)\n\nConvolve an image with the given kernel.\n\nParameters\n----------\nsrc : ndarray\n The source image.\nkernel : ndarray, 2D, dtype=float32\n The kernel with which to convolve the image.\nanchor : 2-tuple, (x, y)\n The kernel anchor.\nin_place : bool\n If True, perform the operation in_place.\n\nReturns\n-------\nout/None : ndarray or None\n If in_place is True, returns None.\n Otherwise a new array is returned which is the result\n of the convolution.\n\nNotes\n-----\nThis is a high performance function. OpenCV automatically\ndetermines, based on the size of the image and the kernel,\nwhether it will faster to do the convolution in the spatial\nor the frequency domain, and behaves accordingly."; -static char __pyx_k_200[] = "cvIntegral(src, square_sum=False, titled_sum=False)\n\nCalculate the integral of an image.\n\nParameters\n----------\nsrc : ndarray, dtyp=[uint8, float32, float64]\n The source image.\nsquare_sum : bool\n If True, also returns the square sum.\ntilted_sum : bool\n If True, also returns the titled sum (45 degree tilt)\n\nReturns\n-------\n[out1, out2, out3] : list of ndarray's\n Returns a list consisting at least of:\n out1: the integral image, and optionally:\n out2: the square sum image\n out3: the titled sum image,\n or any combination of these two."; -static char __pyx_k_203[] = "cvCvtColor(src, code)\n\nConvert an image to another color space.\n\nParameters\n----------\nsrc : ndarray, dtype=[uint8, uint16, float32]\n The source image.\ncode : integer\n A flag representing which color conversion to perform.\n Valid flags are the following:\n CV_BGR2BGRA, CV_RGB2RGBA, CV_BGRA2BGR, CV_RGBA2RGB,\n CV_BGR2RGBA, CV_RGB2BGRA, CV_RGBA2BGR, CV_BGRA2RGB,\n CV_BGR2RGB, CV_RGB2BGR, CV_BGRA2RGBA, CV_RGBA2BGRA,\n CV_BGR2GRAY, CV_RGB2GRAY, CV_GRAY2BGR, CV_GRAY2RGB,\n CV_GRAY2BGRA, CV_GRAY2RGBA, CV_BGRA2GRAY, CV_RGBA2GRAY,\n CV_BGR2BGR565, CV_RGB2BGR565, CV_BGR5652BGR, CV_BGR5652RGB,\n CV_BGRA2BGR565, CV_RGBA2BGR565, CV_BGR5652BGRA, CV_BGR5652RGBA,\n CV_GRAY2BGR565, CV_BGR5652GRAY, CV_BGR2BGR555, CV_RGB2BGR555,\n CV_BGR5552BGR, CV_BGR5552RGB, CV_BGRA2BGR555, CV_RGBA2BGR555,\n CV_BGR5552BGRA, CV_BGR5552RGBA, CV_GRAY2BGR555, CV_BGR5552GRAY,\n CV_BGR2XYZ, CV_RGB2XYZ, CV_XYZ2BGR, CV_XYZ2RGB,\n CV_BGR2YCrCb, CV_RGB2YCrCb, CV_YCrCb2BGR, CV_YCrCb2RGB,\n CV_BGR2HSV, CV_RGB2HSV, CV_BGR2Lab, CV_RGB2Lab,\n CV_BayerBG2BGR, CV_BayerGB2BGR, CV_BayerRG2BGR, CV_BayerGR2BGR,\n CV_BayerBG2RGB, CV_BayerGB2RGB, CV_BayerRG2RGB, CV_BayerGR2RGB,\n CV_BGR2Luv, CV_RGB2Luv, CV_BGR2HLS, CV_RGB2HLS,\n CV_HSV2BGR, CV_HSV2RGB, CV_Lab2BGR, CV_Lab2RGB,\n CV_Luv2BGR, CV_Luv2RGB, CV_HLS2BGR, CV_HLS2RGB\n\nReturns\n-------\nout : ndarray\n A new image in the requested color-space, with\n an appropriate dtype.\n\nNotes\n-----\nNot all conversion types support all dtypes.\nAn exception will be raise if the dtype is not supported.\nSee the OpenCV documentation for more details\nabout the specific color conversions."; -static char __pyx_k_208[] = "cvThreshold(src, threshold, max_value=255, threshold_type=CV_THRESH_BINARY, use_otsu=False)\n\nThreshold an image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=[uint8, float32]\nthreshold : float\n The threshold value. (decision value)\nmax_value : float\n The maximum value.\nthreshold_type : integer\n The flag representing which type of thresholding to apply.\n Valid flags are:\n CV_THRESH_BINARY (max_value if src(x,y) > threshold else 0)\n CV_THRESH_BINARY_INV (0 if src(x,y) > threshold else max_value)\n CV_THRESH_TRUNC (threshold if src(x,y) > threshold else src(x,y))\n CV_THRESH_TOZERO (src(x,y) if src(x,y) > threshold else 0)\n CV_THRESH_TOZERO_INV (0 if src(x,y) > threshold else src(x,y))\nuse_otsu : bool\n If true, the optimum threshold is automatically computed\n and the passed in threshold value is ignored.\n Only implemented for uint8 source images.\n\nReturns\n-------\nout/(out, threshold) : ndarray or (ndarray, float)\n If use_otsu is True, then the computed threshold value is\n returned in addition to the thresholded image. Otherwise\n just the thresholded image is returned."; -static char __pyx_k_214[] = "cvAdaptiveThreshold(src, max_value, adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, threshold_type=CV_THRESH_BINARY, block_size=3, param1=5)\n\nApply an adaptive threshold to an image.\n\nParameters\n----------\nsrc : ndarray, 2D, dtype=uint8\nmax_value : float\n The maximum value.\nadaptive_method : integer\n The flag representing the adaptive method.\n Valid flags are:\n CV_ADAPTIVE_THRESH_MEAN_C (uses mean of the neighborhood)\n CV_ADAPTIVE_THRESH_GAUSSIAN_C (uses gaussian of the neighborhood)\nthreshold_type : integer\n The flag representing which type of thresholding to apply.\n Valid flags are:\n CV_THRESH_BINARY (max_value if src(x,y) > threshold else 0)\n CV_THRESH_BINARY_INV (0 if src(x,y) > threshold else max_value)\nblock_size : integer\n Defines a block_size x block_size neighborhood\nparam1 : float\n The weight to be subtracted from the neighborhood computation.\n\nReturns\n-------\nout : ndarray\n The thresholded image."; -static char __pyx_k_217[] = "cvPyrDown(src)\n\nDownsample an image.\n\nParameters\n----------\nsrc : ndarray, dtype=[uint8, uint16, float32, float64]\n\nReturns\n-------\nout : ndarray\n Downsampled image half the size of the original\n in each dimension."; -static char __pyx_k_220[] = "cvPyrUp(src)\n\nUpsample an image.\n\nParameters\n----------\nsrc : ndarray, dtype=[uint8, uint16, float32, float64]\n\nReturns\n-------\nout : ndarray\n Upsampled image twice the size of the original\n in each dimension."; -static char __pyx_k_223[] = "cvCalibrateCamera2(object_points, image_points, point_counts, image_size)\n\nFinds the intrinsic and extrinsic camera parameters\nusing a calibration pattern.\n\nParameters\n----------\nobject_points : ndarray, Nx3\n An array representing the (X, Y, Z) known coordinates of the\n calibration object.\nimage_points : ndarry, Nx2\n An array representing the pixel image coordinate of the\n points in object_points.\npoint_counts : ndarry, 1D, dtype=int32\n Vector containing the number of points in each particular view.\nimage_size : 2-tuple, (height, width)\n The height and width of the images used.\n\nReturns\n-------\n(intrinsics, distortion) : ndarray 3x3, ndarray 5-vector\n Intrinsics is the 3x3 camera instrinsics matrix.\n Distortion is the 5-vector of distortion coefficients."; -static char __pyx_k_228[] = "cvFindChessboardCorners(src, pattern_size, flag=CV_CALIB_CB_ADAPTIVE_THRESH)\n\nFinds the position of the internal corners of a chessboard.\n\nParameters\n----------\nsrc : ndarray, dtype=uint8\n Image to search for chessboard corners.\npattern_size : 2-tuple of inner corners (h,w)\nflag : integer\n CV_CALIB_CB_ADAPTIVE_THRESH - use adaptive thresholding\n to convert the image to black and white,\n rather than a fixed threshold level\n (computed from the average image brightness).\n CV_CALIB_CB_NORMALIZE_IMAGE - normalize the image using\n cvNormalizeHist() before applying fixed or adaptive\n thresholding.\n CV_CALIB_CB_FILTER_QUADS - use additional criteria\n (like contour area, perimeter, square-like shape) to\n filter out false quads that are extracted at the contour\n retrieval stage.\n\nReturns\n-------\nout : ndarray Nx2\n An nx2 array of the corners found."; -static char __pyx_k_232[] = "cvDrawChessboardCorners(src, pattern_size, corners, in_place=False)\n\nRenders found chessboard corners into an image.\n\nParameters\n----------\nsrc : ndarray, dim 3, dtype: uint8\n Image to draw into.\npattern_size : 2-tuple, (h, w)\n Number of inner corners (h,w)\ncorners : ndarray, nx2, dtype=float32\n Corners found in the image. See cvFindChessboardCorners and\n cvFindCornerSubPix\nin_place: bool\n If true, perform the drawing on the submitted\n image. If false, a copy of the image will be made and drawn to.\n\nReturns\n-------\nout/None : ndarray or none\n If in_place is True, the function returns None.\n Otherwise, the function returns a new image with\n the corners drawn into it."; -static PyObject *__pyx_int_3; -static PyObject *__pyx_int_4; -static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_int_6; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_8; -static PyObject *__pyx_int_16; -static PyObject *__pyx_int_9; -static PyObject *__pyx_int_17; -static PyObject *__pyx_int_11; -static PyObject *__pyx_int_19; -static PyObject *__pyx_int_10; -static PyObject *__pyx_int_18; -static PyObject *__pyx_int_24; -static PyObject *__pyx_int_25; -static PyObject *__pyx_int_26; -static PyObject *__pyx_int_27; -static char __pyx_k___main__[] = "__main__"; -static PyObject *__pyx_kp___main__; -static char __pyx_k_src[] = "src"; -static PyObject *__pyx_kp_src; -static char __pyx_k_xorder[] = "xorder"; -static PyObject *__pyx_kp_xorder; -static char __pyx_k_yorder[] = "yorder"; -static PyObject *__pyx_kp_yorder; -static char __pyx_k_aperture_size[] = "aperture_size"; -static PyObject *__pyx_kp_aperture_size; -static char __pyx_k_31[] = "threshold1"; -static PyObject *__pyx_kp_31; -static char __pyx_k_32[] = "threshold2"; -static PyObject *__pyx_kp_32; -static char __pyx_k_block_size[] = "block_size"; -static PyObject *__pyx_kp_block_size; -static char __pyx_k_k[] = "k"; -static PyObject *__pyx_kp_k; -static char __pyx_k_corners[] = "corners"; -static PyObject *__pyx_kp_corners; -static char __pyx_k_win[] = "win"; -static PyObject *__pyx_kp_win; -static char __pyx_k_zero_zone[] = "zero_zone"; -static PyObject *__pyx_kp_zero_zone; -static char __pyx_k_iterations[] = "iterations"; -static PyObject *__pyx_kp_iterations; -static char __pyx_k_epsilon[] = "epsilon"; -static PyObject *__pyx_kp_epsilon; -static char __pyx_k_corner_count[] = "corner_count"; -static PyObject *__pyx_kp_corner_count; -static char __pyx_k_quality_level[] = "quality_level"; -static PyObject *__pyx_kp_quality_level; -static char __pyx_k_min_distance[] = "min_distance"; -static PyObject *__pyx_kp_min_distance; -static char __pyx_k_use_harris[] = "use_harris"; -static PyObject *__pyx_kp_use_harris; -static char __pyx_k_size[] = "size"; -static PyObject *__pyx_kp_size; -static char __pyx_k_center[] = "center"; -static PyObject *__pyx_kp_center; -static char __pyx_k_warpmat[] = "warpmat"; -static PyObject *__pyx_kp_warpmat; -static char __pyx_k_float_out[] = "float_out"; -static PyObject *__pyx_kp_float_out; -static char __pyx_k_method[] = "method"; -static PyObject *__pyx_kp_method; -static char __pyx_k_flag[] = "flag"; -static PyObject *__pyx_kp_flag; -static char __pyx_k_fillval[] = "fillval"; -static PyObject *__pyx_kp_fillval; -static char __pyx_k_M[] = "M"; -static PyObject *__pyx_kp_M; -static char __pyx_k_element[] = "element"; -static PyObject *__pyx_kp_element; -static char __pyx_k_anchor[] = "anchor"; -static PyObject *__pyx_kp_anchor; -static char __pyx_k_in_place[] = "in_place"; -static PyObject *__pyx_kp_in_place; -static char __pyx_k_operation[] = "operation"; -static PyObject *__pyx_kp_operation; -static char __pyx_k_smoothtype[] = "smoothtype"; -static PyObject *__pyx_kp_smoothtype; -static char __pyx_k_33[] = "param1"; -static PyObject *__pyx_kp_33; -static char __pyx_k_34[] = "param2"; -static PyObject *__pyx_kp_34; -static char __pyx_k_35[] = "param3"; -static PyObject *__pyx_kp_35; -static char __pyx_k_36[] = "param4"; -static PyObject *__pyx_kp_36; -static char __pyx_k_kernel[] = "kernel"; -static PyObject *__pyx_kp_kernel; -static char __pyx_k_square_sum[] = "square_sum"; -static PyObject *__pyx_kp_square_sum; -static char __pyx_k_tilted_sum[] = "tilted_sum"; -static PyObject *__pyx_kp_tilted_sum; -static char __pyx_k_code[] = "code"; -static PyObject *__pyx_kp_code; -static char __pyx_k_threshold[] = "threshold"; -static PyObject *__pyx_kp_threshold; -static char __pyx_k_max_value[] = "max_value"; -static PyObject *__pyx_kp_max_value; -static char __pyx_k_threshold_type[] = "threshold_type"; -static PyObject *__pyx_kp_threshold_type; -static char __pyx_k_use_otsu[] = "use_otsu"; -static PyObject *__pyx_kp_use_otsu; -static char __pyx_k_adaptive_method[] = "adaptive_method"; -static PyObject *__pyx_kp_adaptive_method; -static char __pyx_k_object_points[] = "object_points"; -static PyObject *__pyx_kp_object_points; -static char __pyx_k_image_points[] = "image_points"; -static PyObject *__pyx_kp_image_points; -static char __pyx_k_point_counts[] = "point_counts"; -static PyObject *__pyx_kp_point_counts; -static char __pyx_k_image_size[] = "image_size"; -static PyObject *__pyx_kp_image_size; -static char __pyx_k_pattern_size[] = "pattern_size"; -static PyObject *__pyx_kp_pattern_size; -static char __pyx_k_ctypes[] = "ctypes"; -static PyObject *__pyx_kp_ctypes; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k_opencv_backend[] = "opencv_backend"; -static PyObject *__pyx_kp_opencv_backend; -static char __pyx_k_37[] = "*"; -static PyObject *__pyx_kp_37; -static char __pyx_k_opencv_constants[] = "opencv_constants"; -static PyObject *__pyx_kp_opencv_constants; -static char __pyx_k_opencv_cv[] = "opencv_cv"; -static PyObject *__pyx_kp_opencv_cv; -static char __pyx_k__libimport[] = "_libimport"; -static PyObject *__pyx_kp__libimport; -static char __pyx_k_cv[] = "cv"; -static PyObject *__pyx_kp_cv; -static char __pyx_k__utilities[] = "_utilities"; -static PyObject *__pyx_kp__utilities; -static char __pyx_k_cvdoc[] = "cvdoc"; -static PyObject *__pyx_kp_cvdoc; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static PyObject *__pyx_kp_RuntimeError; -static char __pyx_k_39[] = "CV_BGR2BGRA"; -static PyObject *__pyx_kp_39; -static char __pyx_k_40[] = "UINT8"; -static PyObject *__pyx_kp_40; -static char __pyx_k_41[] = "UINT16"; -static PyObject *__pyx_kp_41; -static char __pyx_k_42[] = "FLOAT32"; -static PyObject *__pyx_kp_42; -static char __pyx_k_43[] = "CV_RGB2RGBA"; -static PyObject *__pyx_kp_43; -static char __pyx_k_44[] = "CV_BGRA2BGR"; -static PyObject *__pyx_kp_44; -static char __pyx_k_45[] = "CV_RGBA2RGB"; -static PyObject *__pyx_kp_45; -static char __pyx_k_46[] = "CV_BGR2RGBA"; -static PyObject *__pyx_kp_46; -static char __pyx_k_47[] = "CV_RGB2BGRA"; -static PyObject *__pyx_kp_47; -static char __pyx_k_48[] = "CV_RGBA2BGR"; -static PyObject *__pyx_kp_48; -static char __pyx_k_49[] = "CV_BGRA2RGB"; -static PyObject *__pyx_kp_49; -static char __pyx_k_50[] = "CV_BGR2RGB"; -static PyObject *__pyx_kp_50; -static char __pyx_k_51[] = "CV_RGB2BGR"; -static PyObject *__pyx_kp_51; -static char __pyx_k_52[] = "CV_BGRA2RGBA"; -static PyObject *__pyx_kp_52; -static char __pyx_k_53[] = "CV_RGBA2BGRA"; -static PyObject *__pyx_kp_53; -static char __pyx_k_54[] = "CV_BGR2GRAY"; -static PyObject *__pyx_kp_54; -static char __pyx_k_55[] = "CV_RGB2GRAY"; -static PyObject *__pyx_kp_55; -static char __pyx_k_56[] = "CV_GRAY2BGR"; -static PyObject *__pyx_kp_56; -static char __pyx_k_57[] = "CV_GRAY2RGB"; -static PyObject *__pyx_kp_57; -static char __pyx_k_58[] = "CV_GRAY2BGRA"; -static PyObject *__pyx_kp_58; -static char __pyx_k_59[] = "CV_GRAY2RGBA"; -static PyObject *__pyx_kp_59; -static char __pyx_k_60[] = "CV_BGRA2GRAY"; -static PyObject *__pyx_kp_60; -static char __pyx_k_61[] = "CV_RGBA2GRAY"; -static PyObject *__pyx_kp_61; -static char __pyx_k_62[] = "CV_BGR2BGR565"; -static PyObject *__pyx_kp_62; -static char __pyx_k_63[] = "CV_RGB2BGR565"; -static PyObject *__pyx_kp_63; -static char __pyx_k_64[] = "CV_BGR5652BGR"; -static PyObject *__pyx_kp_64; -static char __pyx_k_65[] = "CV_BGR5652RGB"; -static PyObject *__pyx_kp_65; -static char __pyx_k_66[] = "CV_BGRA2BGR565"; -static PyObject *__pyx_kp_66; -static char __pyx_k_67[] = "CV_RGBA2BGR565"; -static PyObject *__pyx_kp_67; -static char __pyx_k_68[] = "CV_BGR5652BGRA"; -static PyObject *__pyx_kp_68; -static char __pyx_k_69[] = "CV_BGR5652RGBA"; -static PyObject *__pyx_kp_69; -static char __pyx_k_70[] = "CV_GRAY2BGR565"; -static PyObject *__pyx_kp_70; -static char __pyx_k_71[] = "CV_BGR5652GRAY"; -static PyObject *__pyx_kp_71; -static char __pyx_k_72[] = "CV_BGR2BGR555"; -static PyObject *__pyx_kp_72; -static char __pyx_k_73[] = "CV_RGB2BGR555"; -static PyObject *__pyx_kp_73; -static char __pyx_k_74[] = "CV_BGR5552BGR"; -static PyObject *__pyx_kp_74; -static char __pyx_k_75[] = "CV_BGR5552RGB"; -static PyObject *__pyx_kp_75; -static char __pyx_k_76[] = "CV_BGRA2BGR555"; -static PyObject *__pyx_kp_76; -static char __pyx_k_77[] = "CV_RGBA2BGR555"; -static PyObject *__pyx_kp_77; -static char __pyx_k_78[] = "CV_BGR5552BGRA"; -static PyObject *__pyx_kp_78; -static char __pyx_k_79[] = "CV_BGR5552RGBA"; -static PyObject *__pyx_kp_79; -static char __pyx_k_80[] = "CV_GRAY2BGR555"; -static PyObject *__pyx_kp_80; -static char __pyx_k_81[] = "CV_BGR5552GRAY"; -static PyObject *__pyx_kp_81; -static char __pyx_k_82[] = "CV_BGR2XYZ"; -static PyObject *__pyx_kp_82; -static char __pyx_k_83[] = "CV_RGB2XYZ"; -static PyObject *__pyx_kp_83; -static char __pyx_k_84[] = "CV_XYZ2BGR"; -static PyObject *__pyx_kp_84; -static char __pyx_k_85[] = "CV_XYZ2RGB"; -static PyObject *__pyx_kp_85; -static char __pyx_k_86[] = "CV_BGR2YCrCb"; -static PyObject *__pyx_kp_86; -static char __pyx_k_87[] = "CV_RGB2YCrCb"; -static PyObject *__pyx_kp_87; -static char __pyx_k_88[] = "CV_YCrCb2BGR"; -static PyObject *__pyx_kp_88; -static char __pyx_k_89[] = "CV_YCrCb2RGB"; -static PyObject *__pyx_kp_89; -static char __pyx_k_90[] = "CV_BGR2HSV"; -static PyObject *__pyx_kp_90; -static char __pyx_k_91[] = "CV_RGB2HSV"; -static PyObject *__pyx_kp_91; -static char __pyx_k_92[] = "CV_BGR2Lab"; -static PyObject *__pyx_kp_92; -static char __pyx_k_93[] = "CV_RGB2Lab"; -static PyObject *__pyx_kp_93; -static char __pyx_k_94[] = "CV_BayerBG2BGR"; -static PyObject *__pyx_kp_94; -static char __pyx_k_95[] = "CV_BayerGB2BGR"; -static PyObject *__pyx_kp_95; -static char __pyx_k_96[] = "CV_BayerRG2BGR"; -static PyObject *__pyx_kp_96; -static char __pyx_k_97[] = "CV_BayerGR2BGR"; -static PyObject *__pyx_kp_97; -static char __pyx_k_98[] = "CV_BayerBG2RGB"; -static PyObject *__pyx_kp_98; -static char __pyx_k_99[] = "CV_BayerGB2RGB"; -static PyObject *__pyx_kp_99; -static char __pyx_k_100[] = "CV_BayerRG2RGB"; -static PyObject *__pyx_kp_100; -static char __pyx_k_101[] = "CV_BayerGR2RGB"; -static PyObject *__pyx_kp_101; -static char __pyx_k_102[] = "CV_BGR2Luv"; -static PyObject *__pyx_kp_102; -static char __pyx_k_103[] = "CV_RGB2Luv"; -static PyObject *__pyx_kp_103; -static char __pyx_k_104[] = "CV_BGR2HLS"; -static PyObject *__pyx_kp_104; -static char __pyx_k_105[] = "CV_RGB2HLS"; -static PyObject *__pyx_kp_105; -static char __pyx_k_106[] = "CV_HSV2BGR"; -static PyObject *__pyx_kp_106; -static char __pyx_k_107[] = "CV_HSV2RGB"; -static PyObject *__pyx_kp_107; -static char __pyx_k_108[] = "CV_Lab2BGR"; -static PyObject *__pyx_kp_108; -static char __pyx_k_109[] = "CV_Lab2RGB"; -static PyObject *__pyx_kp_109; -static char __pyx_k_110[] = "CV_Luv2BGR"; -static PyObject *__pyx_kp_110; -static char __pyx_k_111[] = "CV_Luv2RGB"; -static PyObject *__pyx_kp_111; -static char __pyx_k_112[] = "CV_HLS2BGR"; -static PyObject *__pyx_kp_112; -static char __pyx_k_113[] = "CV_HLS2RGB"; -static PyObject *__pyx_kp_113; -static char __pyx_k__cvtcolor_dict[] = "_cvtcolor_dict"; -static PyObject *__pyx_kp__cvtcolor_dict; -static char __pyx_k_addressof[] = "addressof"; -static PyObject *__pyx_kp_addressof; -static char __pyx_k_cvSobel[] = "cvSobel"; -static PyObject *__pyx_kp_cvSobel; -static char __pyx_k_cvLaplace[] = "cvLaplace"; -static PyObject *__pyx_kp_cvLaplace; -static char __pyx_k_cvCanny[] = "cvCanny"; -static PyObject *__pyx_kp_cvCanny; -static char __pyx_k_cvPreCornerDetect[] = "cvPreCornerDetect"; -static PyObject *__pyx_kp_cvPreCornerDetect; -static char __pyx_k_114[] = "cvCornerEigenValsAndVecs"; -static PyObject *__pyx_kp_114; -static char __pyx_k_cvCornerMinEigenVal[] = "cvCornerMinEigenVal"; -static PyObject *__pyx_kp_cvCornerMinEigenVal; -static char __pyx_k_cvCornerHarris[] = "cvCornerHarris"; -static PyObject *__pyx_kp_cvCornerHarris; -static char __pyx_k_cvFindCornerSubPix[] = "cvFindCornerSubPix"; -static PyObject *__pyx_kp_cvFindCornerSubPix; -static char __pyx_k_115[] = "cvGoodFeaturesToTrack"; -static PyObject *__pyx_kp_115; -static char __pyx_k_cvGetRectSubPix[] = "cvGetRectSubPix"; -static PyObject *__pyx_kp_cvGetRectSubPix; -static char __pyx_k_116[] = "cvGetQuadrangleSubPix"; -static PyObject *__pyx_kp_116; -static char __pyx_k_cvResize[] = "cvResize"; -static PyObject *__pyx_kp_cvResize; -static char __pyx_k_cvWarpAffine[] = "cvWarpAffine"; -static PyObject *__pyx_kp_cvWarpAffine; -static char __pyx_k_cvWarpPerspective[] = "cvWarpPerspective"; -static PyObject *__pyx_kp_cvWarpPerspective; -static char __pyx_k_cvLogPolar[] = "cvLogPolar"; -static PyObject *__pyx_kp_cvLogPolar; -static char __pyx_k_cvErode[] = "cvErode"; -static PyObject *__pyx_kp_cvErode; -static char __pyx_k_cvDilate[] = "cvDilate"; -static PyObject *__pyx_kp_cvDilate; -static char __pyx_k_cvMorphologyEx[] = "cvMorphologyEx"; -static PyObject *__pyx_kp_cvMorphologyEx; -static char __pyx_k_cvSmooth[] = "cvSmooth"; -static PyObject *__pyx_kp_cvSmooth; -static char __pyx_k_117[] = "cvFilter2D"; -static PyObject *__pyx_kp_117; -static char __pyx_k_cvIntegral[] = "cvIntegral"; -static PyObject *__pyx_kp_cvIntegral; -static char __pyx_k_cvCvtColor[] = "cvCvtColor"; -static PyObject *__pyx_kp_cvCvtColor; -static char __pyx_k_cvThreshold[] = "cvThreshold"; -static PyObject *__pyx_kp_cvThreshold; -static char __pyx_k_cvAdaptiveThreshold[] = "cvAdaptiveThreshold"; -static PyObject *__pyx_kp_cvAdaptiveThreshold; -static char __pyx_k_cvPyrDown[] = "cvPyrDown"; -static PyObject *__pyx_kp_cvPyrDown; -static char __pyx_k_cvPyrUp[] = "cvPyrUp"; -static PyObject *__pyx_kp_cvPyrUp; -static char __pyx_k_118[] = "cvCalibrateCamera2"; -static PyObject *__pyx_kp_118; -static char __pyx_k_119[] = "cvFindChessboardCorners"; -static PyObject *__pyx_kp_119; -static char __pyx_k_120[] = "cvDrawChessboardCorners"; -static PyObject *__pyx_kp_120; -static char __pyx_k_package[] = "package"; -static PyObject *__pyx_kp_package; -static char __pyx_k_121[] = "cv"; -static PyObject *__pyx_kp_121; -static char __pyx_k_group[] = "group"; -static PyObject *__pyx_kp_group; -static char __pyx_k_122[] = "image"; -static PyObject *__pyx_kp_122; -static char __pyx_k_doc[] = "doc"; -static PyObject *__pyx_kp_doc; -static char __pyx_k_124[] = "cv"; -static PyObject *__pyx_kp_124; -static char __pyx_k_125[] = "image"; -static PyObject *__pyx_kp_125; -static char __pyx_k_127[] = "cv"; -static PyObject *__pyx_kp_127; -static char __pyx_k_128[] = "image"; -static PyObject *__pyx_kp_128; -static char __pyx_k_130[] = "cv"; -static PyObject *__pyx_kp_130; -static char __pyx_k_131[] = "image"; -static PyObject *__pyx_kp_131; -static char __pyx_k_133[] = "cv"; -static PyObject *__pyx_kp_133; -static char __pyx_k_134[] = "image"; -static PyObject *__pyx_kp_134; -static char __pyx_k_136[] = "cv"; -static PyObject *__pyx_kp_136; -static char __pyx_k_137[] = "image"; -static PyObject *__pyx_kp_137; -static char __pyx_k_139[] = "cv"; -static PyObject *__pyx_kp_139; -static char __pyx_k_140[] = "image"; -static PyObject *__pyx_kp_140; -static char __pyx_k_143[] = "cv"; -static PyObject *__pyx_kp_143; -static char __pyx_k_144[] = "image"; -static PyObject *__pyx_kp_144; -static char __pyx_k_146[] = "cv"; -static PyObject *__pyx_kp_146; -static char __pyx_k_147[] = "image"; -static PyObject *__pyx_kp_147; -static char __pyx_k_149[] = "cv"; -static PyObject *__pyx_kp_149; -static char __pyx_k_150[] = "image"; -static PyObject *__pyx_kp_150; -static char __pyx_k_153[] = "cv"; -static PyObject *__pyx_kp_153; -static char __pyx_k_154[] = "image"; -static PyObject *__pyx_kp_154; -static char __pyx_k_CV_INTER_LINEAR[] = "CV_INTER_LINEAR"; -static PyObject *__pyx_kp_CV_INTER_LINEAR; -static char __pyx_k_157[] = "cv"; -static PyObject *__pyx_kp_157; -static char __pyx_k_158[] = "image"; -static PyObject *__pyx_kp_158; -static char __pyx_k_160[] = "CV_WARP_FILL_OUTLIERS"; -static PyObject *__pyx_kp_160; -static char __pyx_k_163[] = "cv"; -static PyObject *__pyx_kp_163; -static char __pyx_k_164[] = "image"; -static PyObject *__pyx_kp_164; -static char __pyx_k_168[] = "cv"; -static PyObject *__pyx_kp_168; -static char __pyx_k_169[] = "image"; -static PyObject *__pyx_kp_169; -static char __pyx_k_172[] = "cv"; -static PyObject *__pyx_kp_172; -static char __pyx_k_173[] = "image"; -static PyObject *__pyx_kp_173; -static char __pyx_k_176[] = "cv"; -static PyObject *__pyx_kp_176; -static char __pyx_k_177[] = "image"; -static PyObject *__pyx_kp_177; -static char __pyx_k_180[] = "cv"; -static PyObject *__pyx_kp_180; -static char __pyx_k_181[] = "image"; -static PyObject *__pyx_kp_181; -static char __pyx_k_184[] = "cv"; -static PyObject *__pyx_kp_184; -static char __pyx_k_185[] = "image"; -static PyObject *__pyx_kp_185; -static char __pyx_k_CV_GAUSSIAN[] = "CV_GAUSSIAN"; -static PyObject *__pyx_kp_CV_GAUSSIAN; -static char __pyx_k_189[] = "cv"; -static PyObject *__pyx_kp_189; -static char __pyx_k_190[] = "image"; -static PyObject *__pyx_kp_190; -static char __pyx_k_193[] = "cv"; -static PyObject *__pyx_kp_193; -static char __pyx_k_194[] = "image"; -static PyObject *__pyx_kp_194; -static char __pyx_k_198[] = "cv"; -static PyObject *__pyx_kp_198; -static char __pyx_k_199[] = "image"; -static PyObject *__pyx_kp_199; -static char __pyx_k_201[] = "cv"; -static PyObject *__pyx_kp_201; -static char __pyx_k_202[] = "image"; -static PyObject *__pyx_kp_202; -static char __pyx_k_CV_THRESH_BINARY[] = "CV_THRESH_BINARY"; -static PyObject *__pyx_kp_CV_THRESH_BINARY; -static char __pyx_k_206[] = "cv"; -static PyObject *__pyx_kp_206; -static char __pyx_k_207[] = "image"; -static PyObject *__pyx_kp_207; -static char __pyx_k_209[] = "CV_ADAPTIVE_THRESH_MEAN_C"; -static PyObject *__pyx_kp_209; -static char __pyx_k_212[] = "cv"; -static PyObject *__pyx_kp_212; -static char __pyx_k_213[] = "image"; -static PyObject *__pyx_kp_213; -static char __pyx_k_215[] = "cv"; -static PyObject *__pyx_kp_215; -static char __pyx_k_216[] = "image"; -static PyObject *__pyx_kp_216; -static char __pyx_k_218[] = "cv"; -static PyObject *__pyx_kp_218; -static char __pyx_k_219[] = "image"; -static PyObject *__pyx_kp_219; -static char __pyx_k_221[] = "cv"; -static PyObject *__pyx_kp_221; -static char __pyx_k_222[] = "calibration"; -static PyObject *__pyx_kp_222; -static char __pyx_k_224[] = "CV_CALIB_CB_ADAPTIVE_THRESH"; -static PyObject *__pyx_kp_224; -static char __pyx_k_226[] = "cv"; -static PyObject *__pyx_kp_226; -static char __pyx_k_227[] = "calibration"; -static PyObject *__pyx_kp_227; -static char __pyx_k_230[] = "cv"; -static PyObject *__pyx_kp_230; -static char __pyx_k_231[] = "calibration"; -static PyObject *__pyx_kp_231; -static char __pyx_k_233[] = "INT8"; -static PyObject *__pyx_kp_233; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_dtype[] = "dtype"; -static PyObject *__pyx_kp_dtype; -static char __pyx_k_235[] = "INT16"; -static PyObject *__pyx_kp_235; -static char __pyx_k_reshape[] = "reshape"; -static PyObject *__pyx_kp_reshape; -static char __pyx_k_CV_INTER_NN[] = "CV_INTER_NN"; -static PyObject *__pyx_kp_CV_INTER_NN; -static char __pyx_k_CV_INTER_AREA[] = "CV_INTER_AREA"; -static PyObject *__pyx_kp_CV_INTER_AREA; -static char __pyx_k_CV_INTER_CUBIC[] = "CV_INTER_CUBIC"; -static PyObject *__pyx_kp_CV_INTER_CUBIC; -static char __pyx_k_range[] = "range"; -static PyObject *__pyx_kp_range; -static char __pyx_k_CV_MOP_OPEN[] = "CV_MOP_OPEN"; -static PyObject *__pyx_kp_CV_MOP_OPEN; -static char __pyx_k_CV_MOP_CLOSE[] = "CV_MOP_CLOSE"; -static PyObject *__pyx_kp_CV_MOP_CLOSE; -static char __pyx_k_CV_MOP_GRADIENT[] = "CV_MOP_GRADIENT"; -static PyObject *__pyx_kp_CV_MOP_GRADIENT; -static char __pyx_k_CV_MOP_TOPHAT[] = "CV_MOP_TOPHAT"; -static PyObject *__pyx_kp_CV_MOP_TOPHAT; -static char __pyx_k_CV_MOP_BLACKHAT[] = "CV_MOP_BLACKHAT"; -static PyObject *__pyx_kp_CV_MOP_BLACKHAT; -static char __pyx_k_CV_BLUR_NO_SCALE[] = "CV_BLUR_NO_SCALE"; -static PyObject *__pyx_kp_CV_BLUR_NO_SCALE; -static char __pyx_k_CV_BLUR[] = "CV_BLUR"; -static PyObject *__pyx_kp_CV_BLUR; -static char __pyx_k_260[] = "FLOAT64"; -static PyObject *__pyx_kp_260; -static char __pyx_k_261[] = "INT32"; -static PyObject *__pyx_kp_261; -static char __pyx_k_append[] = "append"; -static PyObject *__pyx_kp_append; -static char __pyx_k_KeyError[] = "KeyError"; -static PyObject *__pyx_kp_KeyError; -static char __pyx_k_263[] = "CV_ADAPTIVE_THRESH_GAUSSIAN_C"; -static PyObject *__pyx_kp_263; -static char __pyx_k_265[] = "CV_THRESH_BINARY_INV"; -static PyObject *__pyx_kp_265; -static char __pyx_k_copy[] = "copy"; -static PyObject *__pyx_kp_copy; -static PyObject *__pyx_kp_38; -static PyObject *__pyx_kp_123; -static PyObject *__pyx_kp_126; -static PyObject *__pyx_kp_129; -static PyObject *__pyx_kp_132; -static PyObject *__pyx_kp_135; -static PyObject *__pyx_kp_138; -static PyObject *__pyx_kp_141; -static PyObject *__pyx_kp_145; -static PyObject *__pyx_kp_148; -static PyObject *__pyx_kp_151; -static PyObject *__pyx_kp_155; -static PyObject *__pyx_kp_159; -static PyObject *__pyx_kp_165; -static PyObject *__pyx_kp_170; -static PyObject *__pyx_kp_174; -static PyObject *__pyx_kp_178; -static PyObject *__pyx_kp_182; -static PyObject *__pyx_kp_186; -static PyObject *__pyx_kp_191; -static PyObject *__pyx_kp_195; -static PyObject *__pyx_kp_200; -static PyObject *__pyx_kp_203; -static PyObject *__pyx_kp_208; -static PyObject *__pyx_kp_214; -static PyObject *__pyx_kp_217; -static PyObject *__pyx_kp_220; -static PyObject *__pyx_kp_223; -static PyObject *__pyx_kp_228; -static PyObject *__pyx_kp_232; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_kp_234; -static char __pyx_k_234[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_236; -static char __pyx_k_236[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_237; -static char __pyx_k_237[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_238; -static char __pyx_k_238[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_239; -static char __pyx_k_239[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_240; -static char __pyx_k_240[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_241; -static char __pyx_k_241[] = "aperture_size must be 3, 5, or 7"; -static PyObject *__pyx_kp_242; -static PyObject *__pyx_kp_243; -static char __pyx_k_242[] = "win must be a 2-tuple"; -static char __pyx_k_243[] = "The window is too large."; -static PyObject *__pyx_kp_244; -static char __pyx_k_244[] = "warpmat must be 2x3"; -static PyObject *__pyx_kp_245; -static PyObject *__pyx_kp_246; -static char __pyx_k_245[] = "size must be a 2-tuple (height, width)"; -static char __pyx_k_246[] = "unsupported interpolation type"; -static PyObject *__pyx_kp_247; -static PyObject *__pyx_kp_248; -static PyObject *__pyx_kp_249; -static char __pyx_k_247[] = "fillval must be a 4-tuple"; -static char __pyx_k_248[] = "warpmat must be 2x3"; -static char __pyx_k_249[] = "unsupported flag combination"; -static PyObject *__pyx_kp_250; -static PyObject *__pyx_kp_251; -static PyObject *__pyx_kp_252; -static char __pyx_k_250[] = "fillval must be a 4-tuple"; -static char __pyx_k_251[] = "warpmat must be 3x3"; -static char __pyx_k_252[] = "unsupported flag combination"; -static PyObject *__pyx_kp_253; -static PyObject *__pyx_kp_254; -static char __pyx_k_253[] = "center must be a 2-tuple"; -static char __pyx_k_254[] = "unsupported flag combination"; -static PyObject *__pyx_kp_255; -static char __pyx_k_255[] = "operation type not understood"; -static PyObject *__pyx_kp_256; -static PyObject *__pyx_kp_257; -static char __pyx_k_256[] = "In place operation not supported with this filter"; -static char __pyx_k_257[] = "In place operation not supported with this filter"; -static PyObject *__pyx_kp_258; -static PyObject *__pyx_kp_259; -static char __pyx_k_258[] = "anchor must be (x, y) tuple"; -static char __pyx_k_259[] = "anchor point must be inside kernel"; -static PyObject *__pyx_kp_262; -static char __pyx_k_262[] = "unknown conversion code"; -static PyObject *__pyx_kp_264; -static PyObject *__pyx_kp_266; -static PyObject *__pyx_kp_267; -static char __pyx_k_264[] = "Invalid adaptive method"; -static char __pyx_k_266[] = "Invalid threshold type"; -static char __pyx_k_267[] = "block size must be and odd number and greater than 1"; -static PyObject *__pyx_int_15; -static char __pyx_k___getbuffer__[] = "__getbuffer__"; -static PyObject *__pyx_kp___getbuffer__; -static char __pyx_k___releasebuffer__[] = "__releasebuffer__"; -static PyObject *__pyx_kp___releasebuffer__; -static char __pyx_k_info[] = "info"; -static PyObject *__pyx_kp_info; -static char __pyx_k_flags[] = "flags"; -static PyObject *__pyx_kp_flags; -static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_5; -static PyObject *__pyx_kp_23; -static char __pyx_k_1[] = "ndarray is not C contiguous"; -static char __pyx_k_2[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_3[] = ">"; -static char __pyx_k_4[] = "<"; -static char __pyx_k_5[] = "Non-native byte order not supported"; -static char __pyx_k_6[] = "b"; -static char __pyx_k_7[] = "B"; -static char __pyx_k_8[] = "h"; -static char __pyx_k_9[] = "H"; -static char __pyx_k_10[] = "i"; -static char __pyx_k_11[] = "I"; -static char __pyx_k_12[] = "l"; -static char __pyx_k_13[] = "L"; -static char __pyx_k_14[] = "q"; -static char __pyx_k_15[] = "Q"; -static char __pyx_k_16[] = "f"; -static char __pyx_k_17[] = "d"; -static char __pyx_k_18[] = "g"; -static char __pyx_k_19[] = "Zf"; -static char __pyx_k_20[] = "Zd"; -static char __pyx_k_21[] = "Zg"; -static char __pyx_k_22[] = "O"; -static char __pyx_k_23[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_24[] = "^"; -static PyObject *__pyx_kp_25; -static PyObject *__pyx_kp_28; -static PyObject *__pyx_kp_29; -static PyObject *__pyx_kp_30; -static char __pyx_k_25[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_26[] = ">"; -static char __pyx_k_27[] = "<"; -static char __pyx_k_28[] = "Non-native byte order not supported"; -static char __pyx_k_29[] = "Format string allocated too short."; -static char __pyx_k_30[] = "unknown dtype code in numpy.pxd (%d)"; - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":312 - * A new which is the result of applying the Sobel - * operator to src.''') - * def cvSobel(np.ndarray src, int xorder=1, int yorder=0, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSobel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSobel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_xorder; - int __pyx_v_yorder; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_xorder,&__pyx_kp_yorder,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvSobel"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_xorder); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_yorder); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvSobel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_xorder = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_xorder == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_xorder = 1; - } - if (values[2]) { - __pyx_v_yorder = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_yorder == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_yorder = 0; - } - if (values[3]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_xorder = 1; - __pyx_v_yorder = 0; - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: __pyx_v_yorder = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_yorder == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_xorder = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_xorder == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvSobel", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvSobel"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":315 - * int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_nchannels(src, [1]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":316 - * - * validate_array(src) - * assert_dtype(src, [UINT8, INT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":317 - * validate_array(src) - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":319 - * assert_nchannels(src, [1]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":320 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_234); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_234); - __Pyx_GIVEREF(__pyx_kp_234); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":324 - * cdef np.ndarray out - * - * if src.dtype == UINT8 or src.dtype == INT8: # <<<<<<<<<<<<<< - * out = new_array_like_diff_dtype(src, INT16) - * else: - */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_4) { - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __pyx_t_3; - } else { - __pyx_t_6 = __pyx_t_4; - } - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":325 - * - * if src.dtype == UINT8 or src.dtype == INT8: - * out = new_array_like_diff_dtype(src, INT16) # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_235); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":327 - * out = new_array_like_diff_dtype(src, INT16) - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":332 - * cdef IplImage outimg - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":333 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvSobel(&srcimg, &outimg, xorder, yorder, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":335 - * populate_iplimage(out, &outimg) - * - * c_cvSobel(&srcimg, &outimg, xorder, yorder, aperture_size) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSobel((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_xorder, __pyx_v_yorder, __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":337 - * c_cvSobel(&srcimg, &outimg, xorder, yorder, aperture_size) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvSobel"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":361 - * A new which is the result of applying the Laplace - * operator to src.''') - * def cvLaplace(np.ndarray src, int aperture_size=3): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLaplace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLaplace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvLaplace"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvLaplace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvLaplace", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvLaplace"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":363 - * def cvLaplace(np.ndarray src, int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_nchannels(src, [1]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":364 - * - * validate_array(src) - * assert_dtype(src, [UINT8, INT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":365 - * validate_array(src) - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":367 - * assert_nchannels(src, [1]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":368 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_236); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_236); - __Pyx_GIVEREF(__pyx_kp_236); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":372 - * cdef np.ndarray out - * - * if src.dtype == UINT8 or src.dtype == INT8: # <<<<<<<<<<<<<< - * out = new_array_like_diff_dtype(src, INT16) - * else: - */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_4) { - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __pyx_t_3; - } else { - __pyx_t_6 = __pyx_t_4; - } - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":373 - * - * if src.dtype == UINT8 or src.dtype == INT8: - * out = new_array_like_diff_dtype(src, INT16) # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_235); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":375 - * out = new_array_like_diff_dtype(src, INT16) - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":380 - * cdef IplImage outimg - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":381 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvLaplace(&srcimg, &outimg, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":383 - * populate_iplimage(out, &outimg) - * - * c_cvLaplace(&srcimg, &outimg, aperture_size) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLaplace((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":385 - * c_cvLaplace(&srcimg, &outimg, aperture_size) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvLaplace"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":413 - * A new which is the result of applying Canny - * edge detection to src.''') - * def cvCanny(np.ndarray src, double threshold1=10, double threshold2=50, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCanny(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCanny(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - double __pyx_v_threshold1; - double __pyx_v_threshold2; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_31,&__pyx_kp_32,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvCanny"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_31); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_32); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCanny") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_threshold1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_threshold1 = ((double)10); - } - if (values[2]) { - __pyx_v_threshold2 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_threshold2 = ((double)50); - } - if (values[3]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_threshold1 = ((double)10); - __pyx_v_threshold2 = ((double)50); - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: __pyx_v_threshold2 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_threshold1 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCanny", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCanny"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":416 - * int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * assert_nchannels(src, [1]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":417 - * - * validate_array(src) - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":418 - * validate_array(src) - * assert_dtype(src, [UINT8]) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":420 - * assert_nchannels(src, [1]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":421 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_237); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_237); - __Pyx_GIVEREF(__pyx_kp_237); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":424 - * - * cdef np.ndarray out - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":428 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":429 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvCanny(&srcimg, &outimg, threshold1, threshold2, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":431 - * populate_iplimage(out, &outimg) - * - * c_cvCanny(&srcimg, &outimg, threshold1, threshold2, aperture_size) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCanny((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_threshold1, __pyx_v_threshold2, __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":433 - * c_cvCanny(&srcimg, &outimg, threshold1, threshold2, aperture_size) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCanny"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":456 - * out : ndarray - * A new array of the corner candidates.''') - * def cvPreCornerDetect(np.ndarray src, int aperture_size=3): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPreCornerDetect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPreCornerDetect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvPreCornerDetect"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvPreCornerDetect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvPreCornerDetect", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvPreCornerDetect"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":458 - * def cvPreCornerDetect(np.ndarray src, int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * assert_nchannels(src, [1]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":459 - * - * validate_array(src) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":460 - * validate_array(src) - * assert_dtype(src, [UINT8, FLOAT32]) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":462 - * assert_nchannels(src, [1]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":463 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_238); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_238); - __Pyx_GIVEREF(__pyx_kp_238); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":466 - * - * cdef np.ndarray out - * out = new_array_like_diff_dtype(src, FLOAT32) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":470 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":471 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvPreCornerDetect(&srcimg, &outimg, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":473 - * populate_iplimage(out, &outimg) - * - * c_cvPreCornerDetect(&srcimg, &outimg, aperture_size) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPreCornerDetect((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":475 - * c_cvPreCornerDetect(&srcimg, &outimg, aperture_size) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvPreCornerDetect"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":505 - * Where height and width are the same as that - * of src.''') - * def cvCornerEigenValsAndVecs(np.ndarray src, int block_size=3, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_block_size; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - npy_intp __pyx_v_outshape[2]; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_block_size,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvCornerEigenValsAndVecs"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_block_size); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCornerEigenValsAndVecs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_block_size = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_block_size = 3; - } - if (values[2]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_block_size = 3; - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_block_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCornerEigenValsAndVecs", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerEigenValsAndVecs"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":508 - * int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":509 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":510 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":512 - * assert_dtype(src, [UINT8, FLOAT32]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":513 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_239); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_239); - __Pyx_GIVEREF(__pyx_kp_239); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":517 - * cdef np.ndarray out - * cdef np.npy_intp outshape[2] - * outshape[0] = src.shape[0] # <<<<<<<<<<<<<< - * outshape[1] = src.shape[1] * 6 - * - */ - (__pyx_v_outshape[0]) = (__pyx_v_src->dimensions[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":518 - * cdef np.npy_intp outshape[2] - * outshape[0] = src.shape[0] - * outshape[1] = src.shape[1] * 6 # <<<<<<<<<<<<<< - * - * out = new_array(2, outshape, FLOAT32) - */ - (__pyx_v_outshape[1]) = ((__pyx_v_src->dimensions[1]) * 6); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":520 - * outshape[1] = src.shape[1] * 6 - * - * out = new_array(2, outshape, FLOAT32) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_outshape, __pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":524 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":525 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvCornerEigenValsAndVecs(&srcimg, &outimg, block_size, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":527 - * populate_iplimage(out, &outimg) - * - * c_cvCornerEigenValsAndVecs(&srcimg, &outimg, block_size, aperture_size) # <<<<<<<<<<<<<< - * - * return out.reshape(out.shape[0], -1, 6) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerEigenValsAndVecs((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_block_size, __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":529 - * c_cvCornerEigenValsAndVecs(&srcimg, &outimg, block_size, aperture_size) - * - * return out.reshape(out.shape[0], -1, 6) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_out), __pyx_kp_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_out->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - __Pyx_INCREF(__pyx_int_6); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_6); - __Pyx_GIVEREF(__pyx_int_6); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerEigenValsAndVecs"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":556 - * out : ndarray - * A new array of the eigenvalues.''') - * def cvCornerMinEigenVal(np.ndarray src, int block_size=3, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenVal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenVal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_block_size; - int __pyx_v_aperture_size; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_block_size,&__pyx_kp_aperture_size,0}; - __Pyx_SetupRefcountContext("cvCornerMinEigenVal"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_block_size); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCornerMinEigenVal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_block_size = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_block_size = 3; - } - if (values[2]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - } else { - __pyx_v_block_size = 3; - __pyx_v_aperture_size = 3; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_block_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCornerMinEigenVal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerMinEigenVal"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":559 - * int aperture_size=3): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":560 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":561 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":563 - * assert_dtype(src, [UINT8, FLOAT32]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":564 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_240); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_240); - __Pyx_GIVEREF(__pyx_kp_240); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":567 - * - * cdef np.ndarray out - * out = new_array_like_diff_dtype(src, FLOAT32) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":571 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":572 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvCornerMinEigenVal(&srcimg, &outimg, block_size, aperture_size) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":574 - * populate_iplimage(out, &outimg) - * - * c_cvCornerMinEigenVal(&srcimg, &outimg, block_size, aperture_size) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerMinEigenVal((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_block_size, __pyx_v_aperture_size); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":576 - * c_cvCornerMinEigenVal(&srcimg, &outimg, block_size, aperture_size) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerMinEigenVal"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":613 - * to the output image. Corners in the image can be found as the - * local maxima of the output image.''') - * def cvCornerHarris(np.ndarray src, int block_size=3, int aperture_size=3, # <<<<<<<<<<<<<< - * double k=0.04): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerHarris(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerHarris(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_block_size; - int __pyx_v_aperture_size; - double __pyx_v_k; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_block_size,&__pyx_kp_aperture_size,&__pyx_kp_k,0}; - __Pyx_SetupRefcountContext("cvCornerHarris"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_block_size); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_aperture_size); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_k); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCornerHarris") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_block_size = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_block_size = 3; - } - if (values[2]) { - __pyx_v_aperture_size = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_aperture_size = 3; - } - if (values[3]) { - __pyx_v_k = __pyx_PyFloat_AsDouble(values[3]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_k = 0.040000000000000001; - } - } else { - __pyx_v_block_size = 3; - __pyx_v_aperture_size = 3; - __pyx_v_k = 0.040000000000000001; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: __pyx_v_k = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: __pyx_v_aperture_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_aperture_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_block_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCornerHarris", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerHarris"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":616 - * double k=0.04): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":617 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":618 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":620 - * assert_dtype(src, [UINT8, FLOAT32]) - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): # <<<<<<<<<<<<<< - * raise ValueError('aperture_size must be 3, 5, or 7') - * - */ - if ((__pyx_v_aperture_size != 3)) { - if ((__pyx_v_aperture_size != 5)) { - __pyx_t_3 = (__pyx_v_aperture_size != 7); - } else { - __pyx_t_3 = (__pyx_v_aperture_size != 5); - } - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = (__pyx_v_aperture_size != 3); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":621 - * - * if (aperture_size != 3 and aperture_size != 5 and aperture_size != 7): - * raise ValueError('aperture_size must be 3, 5, or 7') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_241); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_241); - __Pyx_GIVEREF(__pyx_kp_241); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":624 - * - * cdef np.ndarray out - * out = new_array_like_diff_dtype(src, FLOAT32) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":628 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":629 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvCornerHarris(&srcimg, &outimg, block_size, aperture_size, k) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":631 - * populate_iplimage(out, &outimg) - * - * c_cvCornerHarris(&srcimg, &outimg, block_size, aperture_size, k) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerHarris((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_block_size, __pyx_v_aperture_size, __pyx_v_k); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":633 - * c_cvCornerHarris(&srcimg, &outimg, block_size, aperture_size, k) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCornerHarris"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":671 - * ------- - * None. The array 'corners' is modified in place.''') - * def cvFindCornerSubPix(np.ndarray src, np.ndarray corners, win, # <<<<<<<<<<<<<< - * zero_zone=(-1, -1), int iterations=0, - * double epsilon=1e-5): - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_corners = 0; - PyObject *__pyx_v_win = 0; - PyObject *__pyx_v_zero_zone = 0; - int __pyx_v_iterations; - double __pyx_v_epsilon; - int __pyx_v_count; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_v_cvcorners; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize __pyx_v_cvwin; - int __pyx_v_imgheight; - int __pyx_v_imgwidth; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize __pyx_v_cvzerozone; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria __pyx_v_crit; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_corners,&__pyx_kp_win,&__pyx_kp_zero_zone,&__pyx_kp_iterations,&__pyx_kp_epsilon,0}; - __Pyx_SetupRefcountContext("cvFindCornerSubPix"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[6] = {0,0,0,0,0,0}; - values[3] = __pyx_k_142; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_corners); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvFindCornerSubPix", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_win); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvFindCornerSubPix", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_zero_zone); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_iterations); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_epsilon); - if (unlikely(value)) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvFindCornerSubPix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_corners = ((PyArrayObject *)values[1]); - __pyx_v_win = values[2]; - __pyx_v_zero_zone = values[3]; - if (values[4]) { - __pyx_v_iterations = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_iterations = 0; - } - if (values[5]) { - __pyx_v_epsilon = __pyx_PyFloat_AsDouble(values[5]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_epsilon = 1.0000000000000001e-05; - } - } else { - __pyx_v_zero_zone = __pyx_k_142; - __pyx_v_iterations = 0; - __pyx_v_epsilon = 1.0000000000000001e-05; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: - __pyx_v_epsilon = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 5: - __pyx_v_iterations = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 4: - __pyx_v_zero_zone = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: - __pyx_v_win = PyTuple_GET_ITEM(__pyx_args, 2); - __pyx_v_corners = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvFindCornerSubPix", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFindCornerSubPix"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":675 - * double epsilon=1e-5): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":676 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":677 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * - * validate_array(corners) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":679 - * assert_dtype(src, [UINT8]) - * - * validate_array(corners) # <<<<<<<<<<<<<< - * assert_ndims(corners, [2]) - * assert_dtype(corners, [FLOAT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_corners); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":680 - * - * validate_array(corners) - * assert_ndims(corners, [2]) # <<<<<<<<<<<<<< - * assert_dtype(corners, [FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_corners, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":681 - * validate_array(corners) - * assert_ndims(corners, [2]) - * assert_dtype(corners, [FLOAT32]) # <<<<<<<<<<<<<< - * - * cdef int count = (corners.shape[0] * corners.shape[1] / 2.) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_corners, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":683 - * assert_dtype(corners, [FLOAT32]) - * - * cdef int count = (corners.shape[0] * corners.shape[1] / 2.) # <<<<<<<<<<<<<< - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) - * - */ - __pyx_v_count = ((int)(((__pyx_v_corners->dimensions[0]) * (__pyx_v_corners->dimensions[1])) / 2.0)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":684 - * - * cdef int count = (corners.shape[0] * corners.shape[1] / 2.) - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) # <<<<<<<<<<<<<< - * - * if len(win) != 2: - */ - __pyx_v_cvcorners = __pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(__pyx_v_corners); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":686 - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) - * - * if len(win) != 2: # <<<<<<<<<<<<<< - * raise ValueError('win must be a 2-tuple') - * cdef CvSize cvwin - */ - __pyx_t_3 = PyObject_Length(__pyx_v_win); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (__pyx_t_3 != 2); - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":687 - * - * if len(win) != 2: - * raise ValueError('win must be a 2-tuple') # <<<<<<<<<<<<<< - * cdef CvSize cvwin - * cvwin.height = win[0] - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_242); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_242); - __Pyx_GIVEREF(__pyx_kp_242); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":689 - * raise ValueError('win must be a 2-tuple') - * cdef CvSize cvwin - * cvwin.height = win[0] # <<<<<<<<<<<<<< - * cvwin.width = win[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_win, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvwin.height = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":690 - * cdef CvSize cvwin - * cvwin.height = win[0] - * cvwin.width = win[1] # <<<<<<<<<<<<<< - * - * cdef int imgheight = src.shape[0] - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_win, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvwin.width = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":692 - * cvwin.width = win[1] - * - * cdef int imgheight = src.shape[0] # <<<<<<<<<<<<<< - * cdef int imgwidth = src.shape[1] - * if imgwidth < (cvwin.width * 2 + 5) or imgheight < (cvwin.height * 2 + 5): - */ - __pyx_v_imgheight = (__pyx_v_src->dimensions[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":693 - * - * cdef int imgheight = src.shape[0] - * cdef int imgwidth = src.shape[1] # <<<<<<<<<<<<<< - * if imgwidth < (cvwin.width * 2 + 5) or imgheight < (cvwin.height * 2 + 5): - * raise ValueError('The window is too large.') - */ - __pyx_v_imgwidth = (__pyx_v_src->dimensions[1]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":694 - * cdef int imgheight = src.shape[0] - * cdef int imgwidth = src.shape[1] - * if imgwidth < (cvwin.width * 2 + 5) or imgheight < (cvwin.height * 2 + 5): # <<<<<<<<<<<<<< - * raise ValueError('The window is too large.') - * - */ - if (!(__pyx_v_imgwidth < ((__pyx_v_cvwin.width * 2) + 5))) { - __pyx_t_4 = (__pyx_v_imgheight < ((__pyx_v_cvwin.height * 2) + 5)); - } else { - __pyx_t_4 = (__pyx_v_imgwidth < ((__pyx_v_cvwin.width * 2) + 5)); - } - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":695 - * cdef int imgwidth = src.shape[1] - * if imgwidth < (cvwin.width * 2 + 5) or imgheight < (cvwin.height * 2 + 5): - * raise ValueError('The window is too large.') # <<<<<<<<<<<<<< - * - * cdef CvSize cvzerozone - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_243); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_243); - __Pyx_GIVEREF(__pyx_kp_243); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":698 - * - * cdef CvSize cvzerozone - * cvzerozone.height = zero_zone[0] # <<<<<<<<<<<<<< - * cvzerozone.width = zero_zone[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_zero_zone, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvzerozone.height = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":699 - * cdef CvSize cvzerozone - * cvzerozone.height = zero_zone[0] - * cvzerozone.width = zero_zone[1] # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_zero_zone, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvzerozone.width = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":702 - * - * cdef IplImage srcimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * - * cdef CvTermCriteria crit - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":705 - * - * cdef CvTermCriteria crit - * crit = get_cvTermCriteria(iterations, epsilon) # <<<<<<<<<<<<<< - * - * c_cvFindCornerSubPix(&srcimg, cvcorners, count, cvwin, cvzerozone, crit) - */ - __pyx_v_crit = __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria(__pyx_v_iterations, __pyx_v_epsilon); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":707 - * crit = get_cvTermCriteria(iterations, epsilon) - * - * c_cvFindCornerSubPix(&srcimg, cvcorners, count, cvwin, cvzerozone, crit) # <<<<<<<<<<<<<< - * - * return None - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindCornerSubPix((&__pyx_v_srcimg), __pyx_v_cvcorners, __pyx_v_count, __pyx_v_cvwin, __pyx_v_cvzerozone, __pyx_v_crit); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":709 - * c_cvFindCornerSubPix(&srcimg, cvcorners, count, cvwin, cvzerozone, crit) - * - * return None # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFindCornerSubPix"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":756 - * algorithm. It also insures that features are distanced - * from one another by at least min_distance.''') - * def cvGoodFeaturesToTrack(np.ndarray src, int corner_count, # <<<<<<<<<<<<<< - * double quality_level, double min_distance, - * int block_size=3, int use_harris=0, double k=0.04): - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_corner_count; - double __pyx_v_quality_level; - double __pyx_v_min_distance; - int __pyx_v_block_size; - int __pyx_v_use_harris; - double __pyx_v_k; - PyArrayObject *__pyx_v_eig = 0; - PyArrayObject *__pyx_v_temp = 0; - npy_intp __pyx_v_cornershape[2]; - PyArrayObject *__pyx_v_out = 0; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_v_cvcorners; - int __pyx_v_ncorners_found; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_eigimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_tempimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_maskimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_corner_count,&__pyx_kp_quality_level,&__pyx_kp_min_distance,&__pyx_kp_block_size,&__pyx_kp_use_harris,&__pyx_kp_k,0}; - __Pyx_SetupRefcountContext("cvGoodFeaturesToTrack"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[7] = {0,0,0,0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_corner_count); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGoodFeaturesToTrack", 0, 4, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_quality_level); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGoodFeaturesToTrack", 0, 4, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_min_distance); - if (likely(values[3])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGoodFeaturesToTrack", 0, 4, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_block_size); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_use_harris); - if (unlikely(value)) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_k); - if (unlikely(value)) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvGoodFeaturesToTrack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_corner_count = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_corner_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_quality_level = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_distance = __pyx_PyFloat_AsDouble(values[3]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[4]) { - __pyx_v_block_size = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_block_size = 3; - } - if (values[5]) { - __pyx_v_use_harris = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_use_harris == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_use_harris = 0; - } - if (values[6]) { - __pyx_v_k = __pyx_PyFloat_AsDouble(values[6]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_k = 0.040000000000000001; - } - } else { - __pyx_v_block_size = 3; - __pyx_v_use_harris = 0; - __pyx_v_k = 0.040000000000000001; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: - __pyx_v_k = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 6: - __pyx_v_use_harris = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_use_harris == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 5: - __pyx_v_block_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 4: - __pyx_v_min_distance = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_quality_level = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_corner_count = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_corner_count == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvGoodFeaturesToTrack", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGoodFeaturesToTrack"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":760 - * int block_size=3, int use_harris=0, double k=0.04): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * assert_nchannels(src, [1]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":761 - * - * validate_array(src) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":762 - * validate_array(src) - * assert_dtype(src, [UINT8, FLOAT32]) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * - * cdef np.ndarray eig = new_array_like_diff_dtype(src, FLOAT32) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":764 - * assert_nchannels(src, [1]) - * - * cdef np.ndarray eig = new_array_like_diff_dtype(src, FLOAT32) # <<<<<<<<<<<<<< - * cdef np.ndarray temp = new_array_like(eig) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_eig = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":765 - * - * cdef np.ndarray eig = new_array_like_diff_dtype(src, FLOAT32) - * cdef np.ndarray temp = new_array_like(eig) # <<<<<<<<<<<<<< - * - * cdef np.npy_intp cornershape[2] - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_eig)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_temp = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":768 - * - * cdef np.npy_intp cornershape[2] - * cornershape[0] = corner_count # <<<<<<<<<<<<<< - * cornershape[1] = 2 - * - */ - (__pyx_v_cornershape[0]) = ((npy_intp)__pyx_v_corner_count); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":769 - * cdef np.npy_intp cornershape[2] - * cornershape[0] = corner_count - * cornershape[1] = 2 # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array(2, cornershape, FLOAT32) - */ - (__pyx_v_cornershape[1]) = 2; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":771 - * cornershape[1] = 2 - * - * cdef np.ndarray out = new_array(2, cornershape, FLOAT32) # <<<<<<<<<<<<<< - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(out) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_cornershape, __pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":772 - * - * cdef np.ndarray out = new_array(2, cornershape, FLOAT32) - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(out) # <<<<<<<<<<<<<< - * - * cdef int ncorners_found - */ - __pyx_v_cvcorners = __pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(__pyx_v_out); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":775 - * - * cdef int ncorners_found - * ncorners_found = corner_count # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_v_ncorners_found = __pyx_v_corner_count; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":782 - * cdef IplImage *maskimg - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(eig, &eigimg) - * populate_iplimage(temp, &tempimg) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":783 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(eig, &eigimg) # <<<<<<<<<<<<<< - * populate_iplimage(temp, &tempimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_eig, (&__pyx_v_eigimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":784 - * populate_iplimage(src, &srcimg) - * populate_iplimage(eig, &eigimg) - * populate_iplimage(temp, &tempimg) # <<<<<<<<<<<<<< - * - * # don't need to support ROI. The user can just pass a slice. - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_temp, (&__pyx_v_tempimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":787 - * - * # don't need to support ROI. The user can just pass a slice. - * maskimg = NULL # <<<<<<<<<<<<<< - * - * c_cvGoodFeaturesToTrack(&srcimg, &eigimg, &tempimg, cvcorners, - */ - __pyx_v_maskimg = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":792 - * &ncorners_found, quality_level, min_distance, - * maskimg, block_size, - * use_harris, k) # <<<<<<<<<<<<<< - * - * return out[:ncorners_found] - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGoodFeaturesToTrack((&__pyx_v_srcimg), (&__pyx_v_eigimg), (&__pyx_v_tempimg), __pyx_v_cvcorners, (&__pyx_v_ncorners_found), __pyx_v_quality_level, __pyx_v_min_distance, __pyx_v_maskimg, __pyx_v_block_size, __pyx_v_use_harris, __pyx_v_k); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":794 - * use_harris, k) - * - * return out[:ncorners_found] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_1 = PySequence_GetSlice(((PyObject *)__pyx_v_out), 0, __pyx_v_ncorners_found); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGoodFeaturesToTrack"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_eig); - __Pyx_XDECREF((PyObject *)__pyx_v_temp); - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":829 - * may extend beyond the image. Border replication is used - * to fill in missing pixels.''') - * def cvGetRectSubPix(np.ndarray src, size, center): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_size = 0; - PyObject *__pyx_v_center = 0; - npy_intp *__pyx_v_shape; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f __pyx_v_cvcenter; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - npy_intp __pyx_t_2; - float __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_size,&__pyx_kp_center,0}; - __Pyx_SetupRefcountContext("cvGetRectSubPix"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGetRectSubPix", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_center); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGetRectSubPix", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvGetRectSubPix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_size = values[1]; - __pyx_v_center = values[2]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_center = PyTuple_GET_ITEM(__pyx_args, 2); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvGetRectSubPix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGetRectSubPix"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":831 - * def cvGetRectSubPix(np.ndarray src, size, center): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * cdef np.npy_intp* shape = clone_array_shape(src) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":833 - * validate_array(src) - * - * cdef np.npy_intp* shape = clone_array_shape(src) # <<<<<<<<<<<<<< - * shape[0] = size[0] - * shape[1] = size[1] - */ - __pyx_v_shape = __pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(__pyx_v_src); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":834 - * - * cdef np.npy_intp* shape = clone_array_shape(src) - * shape[0] = size[0] # <<<<<<<<<<<<<< - * shape[1] = size[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = __Pyx_PyInt_from_py_npy_intp(__pyx_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_shape[0]) = ((npy_intp)__pyx_t_2); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":835 - * cdef np.npy_intp* shape = clone_array_shape(src) - * shape[0] = size[0] - * shape[1] = size[1] # <<<<<<<<<<<<<< - * - * cdef CvPoint2D32f cvcenter - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = __Pyx_PyInt_from_py_npy_intp(__pyx_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_shape[1]) = ((npy_intp)__pyx_t_2); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":838 - * - * cdef CvPoint2D32f cvcenter - * cvcenter.x = center[0] # <<<<<<<<<<<<<< - * cvcenter.y = center[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_center, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvcenter.x = ((float)__pyx_t_3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":839 - * cdef CvPoint2D32f cvcenter - * cvcenter.x = center[0] - * cvcenter.y = center[1] # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array(src.ndim, shape, src.dtype) - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_center, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvcenter.y = ((float)__pyx_t_3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":841 - * cvcenter.y = center[1] - * - * cdef np.ndarray out = new_array(src.ndim, shape, src.dtype) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_src->nd, __pyx_v_shape, __pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":845 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":846 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvGetRectSubPix(&srcimg, &outimg, cvcenter) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":848 - * populate_iplimage(out, &outimg) - * - * c_cvGetRectSubPix(&srcimg, &outimg, cvcenter) # <<<<<<<<<<<<<< - * - * PyMem_Free(shape) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetRectSubPix((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cvcenter); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":850 - * c_cvGetRectSubPix(&srcimg, &outimg, cvcenter) - * - * PyMem_Free(shape) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_shape); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":852 - * PyMem_Free(shape) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGetRectSubPix"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":893 - * and should be used unless specific feature of that - * function are required.''') - * def cvGetQuadrangleSubPix(np.ndarray src, np.ndarray warpmat, float_out=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_warpmat = 0; - PyObject *__pyx_v_float_out = 0; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_cvmat; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmatptr; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_warpmat,&__pyx_kp_float_out,0}; - __Pyx_SetupRefcountContext("cvGetQuadrangleSubPix"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - values[2] = __pyx_k_152; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_warpmat); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvGetQuadrangleSubPix", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_float_out); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvGetQuadrangleSubPix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_warpmat = ((PyArrayObject *)values[1]); - __pyx_v_float_out = values[2]; - } else { - __pyx_v_float_out = __pyx_k_152; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: - __pyx_v_float_out = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: - __pyx_v_warpmat = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvGetQuadrangleSubPix", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGetQuadrangleSubPix"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_warpmat), __pyx_ptype_5numpy_ndarray, 1, "warpmat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":895 - * def cvGetQuadrangleSubPix(np.ndarray src, np.ndarray warpmat, float_out=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * validate_array(warpmat) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":896 - * - * validate_array(src) - * validate_array(warpmat) # <<<<<<<<<<<<<< - * - * assert_nchannels(src, [1, 3]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_warpmat); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":898 - * validate_array(warpmat) - * - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * - * assert_nchannels(warpmat, [1]) - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":900 - * assert_nchannels(src, [1, 3]) - * - * assert_nchannels(warpmat, [1]) # <<<<<<<<<<<<<< - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_warpmat, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":902 - * assert_nchannels(warpmat, [1]) - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: # <<<<<<<<<<<<<< - * raise ValueError('warpmat must be 2x3') - * - */ - if (!((__pyx_v_warpmat->dimensions[0]) != 2)) { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[1]) != 3); - } else { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[0]) != 2); - } - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":903 - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: - * raise ValueError('warpmat must be 2x3') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_244); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_244); - __Pyx_GIVEREF(__pyx_kp_244); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":907 - * cdef np.ndarray out - * - * if float_out: # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * out = new_array_like_diff_dtype(src, FLOAT32) - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_float_out); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":908 - * - * if float_out: - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * out = new_array_like_diff_dtype(src, FLOAT32) - * else: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyList_SET_ITEM(__pyx_t_4, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":909 - * if float_out: - * assert_dtype(src, [UINT8]) - * out = new_array_like_diff_dtype(src, FLOAT32) # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":911 - * out = new_array_like_diff_dtype(src, FLOAT32) - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":918 - * cdef CvMat* cvmatptr - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":919 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":920 - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) # <<<<<<<<<<<<<< - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_warpmat, (&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":921 - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) # <<<<<<<<<<<<<< - * - * c_cvGetQuadrangleSubPix(&srcimg, &outimg, cvmatptr) - */ - __pyx_v_cvmatptr = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":923 - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * - * c_cvGetQuadrangleSubPix(&srcimg, &outimg, cvmatptr) # <<<<<<<<<<<<<< - * - * PyMem_Free(cvmatptr) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetQuadrangleSubPix((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cvmatptr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":925 - * c_cvGetQuadrangleSubPix(&srcimg, &outimg, cvmatptr) - * - * PyMem_Free(cvmatptr) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_cvmatptr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":927 - * PyMem_Free(cvmatptr) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvGetQuadrangleSubPix"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":957 - * out : ndarray - * The resized image.''') - * def cvResize(np.ndarray src, size, int method=CV_INTER_LINEAR): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvResize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvResize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_size = 0; - int __pyx_v_method; - int __pyx_v_ndim; - npy_intp *__pyx_v_shape; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - npy_intp __pyx_t_8; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_size,&__pyx_kp_method,0}; - __Pyx_SetupRefcountContext("cvResize"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvResize", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_method); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvResize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_size = values[1]; - if (values[2]) { - __pyx_v_method = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_method = __pyx_k_156; - } - } else { - __pyx_v_method = __pyx_k_156; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: - __pyx_v_method = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvResize", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvResize"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":959 - * def cvResize(np.ndarray src, size, int method=CV_INTER_LINEAR): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * if len(size) != 2: - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":961 - * validate_array(src) - * - * if len(size) != 2: # <<<<<<<<<<<<<< - * raise ValueError('size must be a 2-tuple (height, width)') - * - */ - __pyx_t_2 = PyObject_Length(__pyx_v_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 2); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":962 - * - * if len(size) != 2: - * raise ValueError('size must be a 2-tuple (height, width)') # <<<<<<<<<<<<<< - * - * if method not in [CV_INTER_NN, CV_INTER_LINEAR, CV_INTER_AREA, - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_245); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_245); - __Pyx_GIVEREF(__pyx_kp_245); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":964 - * raise ValueError('size must be a 2-tuple (height, width)') - * - * if method not in [CV_INTER_NN, CV_INTER_LINEAR, CV_INTER_AREA, # <<<<<<<<<<<<<< - * CV_INTER_CUBIC]: - * raise ValueError('unsupported interpolation type') - */ - __pyx_t_1 = __pyx_v_method; - __pyx_t_5 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_NN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (((int)__pyx_t_3)) { - __pyx_t_4 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_LINEAR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_1, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = ((int)__pyx_t_6); - } else { - __pyx_t_7 = ((int)__pyx_t_3); - } - if (__pyx_t_7) { - __pyx_t_5 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_AREA); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = ((int)__pyx_t_3); - } else { - __pyx_t_6 = __pyx_t_7; - } - if (__pyx_t_6) { - __pyx_t_4 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":965 - * - * if method not in [CV_INTER_NN, CV_INTER_LINEAR, CV_INTER_AREA, - * CV_INTER_CUBIC]: # <<<<<<<<<<<<<< - * raise ValueError('unsupported interpolation type') - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_CUBIC); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_1, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = ((int)__pyx_t_7); - } else { - __pyx_t_3 = __pyx_t_6; - } - __pyx_t_6 = __pyx_t_3; - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":966 - * if method not in [CV_INTER_NN, CV_INTER_LINEAR, CV_INTER_AREA, - * CV_INTER_CUBIC]: - * raise ValueError('unsupported interpolation type') # <<<<<<<<<<<<<< - * - * cdef int ndim = src.ndim - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_246); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_246); - __Pyx_GIVEREF(__pyx_kp_246); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":968 - * raise ValueError('unsupported interpolation type') - * - * cdef int ndim = src.ndim # <<<<<<<<<<<<<< - * cdef np.npy_intp* shape = clone_array_shape(src) - * shape[0] = size[0] - */ - __pyx_v_ndim = __pyx_v_src->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":969 - * - * cdef int ndim = src.ndim - * cdef np.npy_intp* shape = clone_array_shape(src) # <<<<<<<<<<<<<< - * shape[0] = size[0] - * shape[1] = size[1] - */ - __pyx_v_shape = __pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(__pyx_v_src); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":970 - * cdef int ndim = src.ndim - * cdef np.npy_intp* shape = clone_array_shape(src) - * shape[0] = size[0] # <<<<<<<<<<<<<< - * shape[1] = size[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_8 = __Pyx_PyInt_from_py_npy_intp(__pyx_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_shape[0]) = ((npy_intp)__pyx_t_8); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":971 - * cdef np.npy_intp* shape = clone_array_shape(src) - * shape[0] = size[0] - * shape[1] = size[1] # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array(ndim, shape, src.dtype) - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_8 = __Pyx_PyInt_from_py_npy_intp(__pyx_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_shape[1]) = ((npy_intp)__pyx_t_8); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":973 - * shape[1] = size[1] - * - * cdef np.ndarray out = new_array(ndim, shape, src.dtype) # <<<<<<<<<<<<<< - * validate_array(out) - * - */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_ndim, __pyx_v_shape, __pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":974 - * - * cdef np.ndarray out = new_array(ndim, shape, src.dtype) - * validate_array(out) # <<<<<<<<<<<<<< - * - * PyMem_Free(shape) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_out); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":976 - * validate_array(out) - * - * PyMem_Free(shape) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - PyMem_Free(__pyx_v_shape); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":980 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":981 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvResize(&srcimg, &outimg, method) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":983 - * populate_iplimage(out, &outimg) - * - * c_cvResize(&srcimg, &outimg, method) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvResize((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_method); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":985 - * c_cvResize(&srcimg, &outimg, method) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvResize"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1036 - * and that function should be used instead, unless specific - * features of this function are needed.''') - * def cvWarpAffine(np.ndarray src, np.ndarray warpmat, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpAffine(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpAffine(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_warpmat = 0; - int __pyx_v_flag; - PyObject *__pyx_v_fillval = 0; - PyObject *__pyx_v_valid_flags; - PyArrayObject *__pyx_v_out; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar __pyx_v_cvfill; - int __pyx_v_i; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_cvmat; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmatptr; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - double __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_warpmat,&__pyx_kp_flag,&__pyx_kp_fillval,0}; - __Pyx_SetupRefcountContext("cvWarpAffine"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - values[3] = __pyx_k_162; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_warpmat); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvWarpAffine", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flag); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_fillval); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvWarpAffine") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_warpmat = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_flag = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_flag = __pyx_k_161; - } - __pyx_v_fillval = values[3]; - } else { - __pyx_v_flag = __pyx_k_161; - __pyx_v_fillval = __pyx_k_162; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: - __pyx_v_fillval = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: - __pyx_v_flag = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_warpmat = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvWarpAffine", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvWarpAffine"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_valid_flags = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_warpmat), __pyx_ptype_5numpy_ndarray, 1, "warpmat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1040 - * fillval=(0., 0., 0., 0.)): - * - * validate_array(src) # <<<<<<<<<<<<<< - * validate_array(warpmat) - * if len(fillval) != 4: - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1041 - * - * validate_array(src) - * validate_array(warpmat) # <<<<<<<<<<<<<< - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_warpmat); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1042 - * validate_array(src) - * validate_array(warpmat) - * if len(fillval) != 4: # <<<<<<<<<<<<<< - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) - */ - __pyx_t_2 = PyObject_Length(__pyx_v_fillval); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 4); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1043 - * validate_array(warpmat) - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') # <<<<<<<<<<<<<< - * assert_nchannels(src, [1, 3]) - * assert_nchannels(warpmat, [1]) - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_247); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_247); - __Pyx_GIVEREF(__pyx_kp_247); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1044 - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * assert_nchannels(warpmat, [1]) - * - */ - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1045 - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) - * assert_nchannels(warpmat, [1]) # <<<<<<<<<<<<<< - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: - */ - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_warpmat, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1047 - * assert_nchannels(warpmat, [1]) - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: # <<<<<<<<<<<<<< - * raise ValueError('warpmat must be 2x3') - * - */ - if (!((__pyx_v_warpmat->dimensions[0]) != 2)) { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[1]) != 3); - } else { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[0]) != 2); - } - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1048 - * - * if warpmat.shape[0] != 2 or warpmat.shape[1] != 3: - * raise ValueError('warpmat must be 2x3') # <<<<<<<<<<<<<< - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_248); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_248); - __Pyx_GIVEREF(__pyx_kp_248); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1050 - * raise ValueError('warpmat must be 2x3') - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] # <<<<<<<<<<<<<< - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') - */ - __pyx_t_4 = PyList_New(12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_int_0); - PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_4, 2, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_4, 3, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_8); - PyList_SET_ITEM(__pyx_t_4, 4, __pyx_int_8); - __Pyx_GIVEREF(__pyx_int_8); - __Pyx_INCREF(__pyx_int_16); - PyList_SET_ITEM(__pyx_t_4, 5, __pyx_int_16); - __Pyx_GIVEREF(__pyx_int_16); - __Pyx_INCREF(__pyx_int_9); - PyList_SET_ITEM(__pyx_t_4, 6, __pyx_int_9); - __Pyx_GIVEREF(__pyx_int_9); - __Pyx_INCREF(__pyx_int_17); - PyList_SET_ITEM(__pyx_t_4, 7, __pyx_int_17); - __Pyx_GIVEREF(__pyx_int_17); - __Pyx_INCREF(__pyx_int_11); - PyList_SET_ITEM(__pyx_t_4, 8, __pyx_int_11); - __Pyx_GIVEREF(__pyx_int_11); - __Pyx_INCREF(__pyx_int_19); - PyList_SET_ITEM(__pyx_t_4, 9, __pyx_int_19); - __Pyx_GIVEREF(__pyx_int_19); - __Pyx_INCREF(__pyx_int_10); - PyList_SET_ITEM(__pyx_t_4, 10, __pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - __Pyx_INCREF(__pyx_int_18); - PyList_SET_ITEM(__pyx_t_4, 11, __pyx_int_18); - __Pyx_GIVEREF(__pyx_int_18); - __Pyx_DECREF(__pyx_v_valid_flags); - __pyx_v_valid_flags = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1051 - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - * if flag not in valid_flags: # <<<<<<<<<<<<<< - * raise ValueError('unsupported flag combination') - * - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (!PySequence_Contains(__pyx_v_valid_flags, __pyx_t_4)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1052 - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_249); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_249); - __Pyx_GIVEREF(__pyx_kp_249); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1055 - * - * cdef np.ndarray out - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef CvScalar cvfill - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1059 - * cdef CvScalar cvfill - * cdef int i - * for i in range(4): # <<<<<<<<<<<<<< - * cvfill.val[i] = fillval[i] - * - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1060 - * cdef int i - * for i in range(4): - * cvfill.val[i] = fillval[i] # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_fillval, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_cvfill.val[__pyx_v_i]) = ((double)__pyx_t_6); - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1067 - * cdef CvMat* cvmatptr - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1068 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1069 - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) # <<<<<<<<<<<<<< - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_warpmat, (&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1070 - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) # <<<<<<<<<<<<<< - * - * c_cvWarpAffine(&srcimg, &outimg, cvmatptr, flag, cvfill) - */ - __pyx_v_cvmatptr = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1072 - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * - * c_cvWarpAffine(&srcimg, &outimg, cvmatptr, flag, cvfill) # <<<<<<<<<<<<<< - * - * PyMem_Free(cvmatptr) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpAffine((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cvmatptr, __pyx_v_flag, __pyx_v_cvfill); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1074 - * c_cvWarpAffine(&srcimg, &outimg, cvmatptr, flag, cvfill) - * - * PyMem_Free(cvmatptr) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_cvmatptr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1076 - * PyMem_Free(cvmatptr) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvWarpAffine"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_valid_flags); - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1123 - * directly for pixel interpolation. Otherwise, the function finds - * the inverse transform from warpmat.''') - * def cvWarpPerspective(np.ndarray src, np.ndarray warpmat, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspective(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspective(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_warpmat = 0; - int __pyx_v_flag; - PyObject *__pyx_v_fillval = 0; - PyObject *__pyx_v_valid_flags; - PyArrayObject *__pyx_v_out; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvScalar __pyx_v_cvfill; - int __pyx_v_i; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_cvmat; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmatptr; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - double __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_warpmat,&__pyx_kp_flag,&__pyx_kp_fillval,0}; - __Pyx_SetupRefcountContext("cvWarpPerspective"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - values[3] = __pyx_k_167; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_warpmat); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvWarpPerspective", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flag); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_fillval); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvWarpPerspective") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_warpmat = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_flag = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_flag = __pyx_k_166; - } - __pyx_v_fillval = values[3]; - } else { - __pyx_v_flag = __pyx_k_166; - __pyx_v_fillval = __pyx_k_167; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: - __pyx_v_fillval = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: - __pyx_v_flag = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_warpmat = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvWarpPerspective", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvWarpPerspective"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_valid_flags = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_warpmat), __pyx_ptype_5numpy_ndarray, 1, "warpmat", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1127 - * fillval=(0., 0., 0., 0.)): - * - * validate_array(src) # <<<<<<<<<<<<<< - * validate_array(warpmat) - * if len(fillval) != 4: - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1128 - * - * validate_array(src) - * validate_array(warpmat) # <<<<<<<<<<<<<< - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_warpmat); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1129 - * validate_array(src) - * validate_array(warpmat) - * if len(fillval) != 4: # <<<<<<<<<<<<<< - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) - */ - __pyx_t_2 = PyObject_Length(__pyx_v_fillval); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 4); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1130 - * validate_array(warpmat) - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') # <<<<<<<<<<<<<< - * assert_nchannels(src, [1, 3]) - * assert_nchannels(warpmat, [1]) - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_250); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_250); - __Pyx_GIVEREF(__pyx_kp_250); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1131 - * if len(fillval) != 4: - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * assert_nchannels(warpmat, [1]) - * if warpmat.shape[0] != 3 or warpmat.shape[1] != 3: - */ - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1132 - * raise ValueError('fillval must be a 4-tuple') - * assert_nchannels(src, [1, 3]) - * assert_nchannels(warpmat, [1]) # <<<<<<<<<<<<<< - * if warpmat.shape[0] != 3 or warpmat.shape[1] != 3: - * raise ValueError('warpmat must be 3x3') - */ - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_warpmat, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1133 - * assert_nchannels(src, [1, 3]) - * assert_nchannels(warpmat, [1]) - * if warpmat.shape[0] != 3 or warpmat.shape[1] != 3: # <<<<<<<<<<<<<< - * raise ValueError('warpmat must be 3x3') - * - */ - if (!((__pyx_v_warpmat->dimensions[0]) != 3)) { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[1]) != 3); - } else { - __pyx_t_3 = ((__pyx_v_warpmat->dimensions[0]) != 3); - } - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1134 - * assert_nchannels(warpmat, [1]) - * if warpmat.shape[0] != 3 or warpmat.shape[1] != 3: - * raise ValueError('warpmat must be 3x3') # <<<<<<<<<<<<<< - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_251); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_251); - __Pyx_GIVEREF(__pyx_kp_251); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1136 - * raise ValueError('warpmat must be 3x3') - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] # <<<<<<<<<<<<<< - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') - */ - __pyx_t_4 = PyList_New(12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_int_0); - PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_4, 2, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_4, 3, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_8); - PyList_SET_ITEM(__pyx_t_4, 4, __pyx_int_8); - __Pyx_GIVEREF(__pyx_int_8); - __Pyx_INCREF(__pyx_int_16); - PyList_SET_ITEM(__pyx_t_4, 5, __pyx_int_16); - __Pyx_GIVEREF(__pyx_int_16); - __Pyx_INCREF(__pyx_int_9); - PyList_SET_ITEM(__pyx_t_4, 6, __pyx_int_9); - __Pyx_GIVEREF(__pyx_int_9); - __Pyx_INCREF(__pyx_int_17); - PyList_SET_ITEM(__pyx_t_4, 7, __pyx_int_17); - __Pyx_GIVEREF(__pyx_int_17); - __Pyx_INCREF(__pyx_int_11); - PyList_SET_ITEM(__pyx_t_4, 8, __pyx_int_11); - __Pyx_GIVEREF(__pyx_int_11); - __Pyx_INCREF(__pyx_int_19); - PyList_SET_ITEM(__pyx_t_4, 9, __pyx_int_19); - __Pyx_GIVEREF(__pyx_int_19); - __Pyx_INCREF(__pyx_int_10); - PyList_SET_ITEM(__pyx_t_4, 10, __pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - __Pyx_INCREF(__pyx_int_18); - PyList_SET_ITEM(__pyx_t_4, 11, __pyx_int_18); - __Pyx_GIVEREF(__pyx_int_18); - __Pyx_DECREF(__pyx_v_valid_flags); - __pyx_v_valid_flags = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1137 - * - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - * if flag not in valid_flags: # <<<<<<<<<<<<<< - * raise ValueError('unsupported flag combination') - * - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (!PySequence_Contains(__pyx_v_valid_flags, __pyx_t_4)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1138 - * valid_flags = [0, 1, 2, 3, 8, 16, 9, 17, 11, 19, 10, 18] - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_252); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_252); - __Pyx_GIVEREF(__pyx_kp_252); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1141 - * - * cdef np.ndarray out - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef CvScalar cvfill - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1145 - * cdef CvScalar cvfill - * cdef int i - * for i in range(4): # <<<<<<<<<<<<<< - * cvfill.val[i] = fillval[i] - * - */ - for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) { - __pyx_v_i = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1146 - * cdef int i - * for i in range(4): - * cvfill.val[i] = fillval[i] # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_fillval, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - (__pyx_v_cvfill.val[__pyx_v_i]) = ((double)__pyx_t_6); - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1151 - * cdef IplImage outimg - * cdef IplImage cvmat - * cdef CvMat* cvmatptr = NULL # <<<<<<<<<<<<<< - * - * populate_iplimage(src, &srcimg) - */ - __pyx_v_cvmatptr = NULL; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1153 - * cdef CvMat* cvmatptr = NULL - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1154 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1155 - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) # <<<<<<<<<<<<<< - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * c_cvWarpPerspective(&srcimg, &outimg, cvmatptr, flag, cvfill) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_warpmat, (&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1156 - * populate_iplimage(out, &outimg) - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) # <<<<<<<<<<<<<< - * c_cvWarpPerspective(&srcimg, &outimg, cvmatptr, flag, cvfill) - * - */ - __pyx_v_cvmatptr = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_cvmat)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1157 - * populate_iplimage(warpmat, &cvmat) - * cvmatptr = cvmat_ptr_from_iplimage(&cvmat) - * c_cvWarpPerspective(&srcimg, &outimg, cvmatptr, flag, cvfill) # <<<<<<<<<<<<<< - * - * PyMem_Free(cvmatptr) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpPerspective((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cvmatptr, __pyx_v_flag, __pyx_v_cvfill); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1159 - * c_cvWarpPerspective(&srcimg, &outimg, cvmatptr, flag, cvfill) - * - * PyMem_Free(cvmatptr) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_cvmatptr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1161 - * PyMem_Free(cvmatptr) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvWarpPerspective"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_valid_flags); - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1210 - * for fast scale and rotation-invariant template matching, - * for object tracking and so forth.''') - * def cvLogPolar(np.ndarray src, center, double M, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLogPolar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLogPolar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_center = 0; - double __pyx_v_M; - int __pyx_v_flag; - PyObject *__pyx_v_valid_flags; - PyArrayObject *__pyx_v_out = 0; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f __pyx_v_cv_center; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - float __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_center,&__pyx_kp_M,&__pyx_kp_flag,0}; - __Pyx_SetupRefcountContext("cvLogPolar"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_center); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvLogPolar", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_M); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvLogPolar", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flag); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvLogPolar") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_center = values[1]; - __pyx_v_M = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[3]) { - __pyx_v_flag = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_flag = __pyx_k_171; - } - } else { - __pyx_v_flag = __pyx_k_171; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: - __pyx_v_flag = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: - __pyx_v_M = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_center = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvLogPolar", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvLogPolar"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_valid_flags = Py_None; __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1213 - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS): - * - * validate_array(src) # <<<<<<<<<<<<<< - * if len(center) != 2: - * raise ValueError('center must be a 2-tuple') - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1214 - * - * validate_array(src) - * if len(center) != 2: # <<<<<<<<<<<<<< - * raise ValueError('center must be a 2-tuple') - * - */ - __pyx_t_2 = PyObject_Length(__pyx_v_center); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 2); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1215 - * validate_array(src) - * if len(center) != 2: - * raise ValueError('center must be a 2-tuple') # <<<<<<<<<<<<<< - * - * valid_flags = [0, 16, 8, 24, 1, 17, 9, 25, 2, 18, 10, 26, 3, 19, 11, 27] - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_253); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_253); - __Pyx_GIVEREF(__pyx_kp_253); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1217 - * raise ValueError('center must be a 2-tuple') - * - * valid_flags = [0, 16, 8, 24, 1, 17, 9, 25, 2, 18, 10, 26, 3, 19, 11, 27] # <<<<<<<<<<<<<< - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') - */ - __pyx_t_5 = PyList_New(16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_int_0); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_16); - PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_16); - __Pyx_GIVEREF(__pyx_int_16); - __Pyx_INCREF(__pyx_int_8); - PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_8); - __Pyx_GIVEREF(__pyx_int_8); - __Pyx_INCREF(__pyx_int_24); - PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_24); - __Pyx_GIVEREF(__pyx_int_24); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_5, 4, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_17); - PyList_SET_ITEM(__pyx_t_5, 5, __pyx_int_17); - __Pyx_GIVEREF(__pyx_int_17); - __Pyx_INCREF(__pyx_int_9); - PyList_SET_ITEM(__pyx_t_5, 6, __pyx_int_9); - __Pyx_GIVEREF(__pyx_int_9); - __Pyx_INCREF(__pyx_int_25); - PyList_SET_ITEM(__pyx_t_5, 7, __pyx_int_25); - __Pyx_GIVEREF(__pyx_int_25); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_5, 8, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_18); - PyList_SET_ITEM(__pyx_t_5, 9, __pyx_int_18); - __Pyx_GIVEREF(__pyx_int_18); - __Pyx_INCREF(__pyx_int_10); - PyList_SET_ITEM(__pyx_t_5, 10, __pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - __Pyx_INCREF(__pyx_int_26); - PyList_SET_ITEM(__pyx_t_5, 11, __pyx_int_26); - __Pyx_GIVEREF(__pyx_int_26); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_5, 12, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_19); - PyList_SET_ITEM(__pyx_t_5, 13, __pyx_int_19); - __Pyx_GIVEREF(__pyx_int_19); - __Pyx_INCREF(__pyx_int_11); - PyList_SET_ITEM(__pyx_t_5, 14, __pyx_int_11); - __Pyx_GIVEREF(__pyx_int_11); - __Pyx_INCREF(__pyx_int_27); - PyList_SET_ITEM(__pyx_t_5, 15, __pyx_int_27); - __Pyx_GIVEREF(__pyx_int_27); - __Pyx_DECREF(__pyx_v_valid_flags); - __pyx_v_valid_flags = ((PyObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1218 - * - * valid_flags = [0, 16, 8, 24, 1, 17, 9, 25, 2, 18, 10, 26, 3, 19, 11, 27] - * if flag not in valid_flags: # <<<<<<<<<<<<<< - * raise ValueError('unsupported flag combination') - * - */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = (!PySequence_Contains(__pyx_v_valid_flags, __pyx_t_5)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1219 - * valid_flags = [0, 16, 8, 24, 1, 17, 9, 25, 2, 18, 10, 26, 3, 19, 11, 27] - * if flag not in valid_flags: - * raise ValueError('unsupported flag combination') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array_like(src) - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_254); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_254); - __Pyx_GIVEREF(__pyx_kp_254); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1221 - * raise ValueError('unsupported flag combination') - * - * cdef np.ndarray out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef CvPoint2D32f cv_center - */ - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1224 - * - * cdef CvPoint2D32f cv_center - * cv_center.x = center[0] # <<<<<<<<<<<<<< - * cv_center.y = center[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_center, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_center.x = ((float)__pyx_t_6); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1225 - * cdef CvPoint2D32f cv_center - * cv_center.x = center[0] - * cv_center.y = center[1] # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_center, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_center.y = ((float)__pyx_t_6); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1229 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1230 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvLogPolar(&srcimg, &outimg, cv_center, M, flag) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1232 - * populate_iplimage(out, &outimg) - * - * c_cvLogPolar(&srcimg, &outimg, cv_center, M, flag) # <<<<<<<<<<<<<< - * return out - * - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLogPolar((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cv_center, __pyx_v_M, __pyx_v_flag); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1233 - * - * c_cvLogPolar(&srcimg, &outimg, cv_center, M, flag) - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvLogPolar"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_valid_flags); - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1269 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvErode(np.ndarray src, np.ndarray element=None, int iterations=1, # <<<<<<<<<<<<<< - * anchor=None, in_place=False): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvErode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvErode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_element = 0; - int __pyx_v_iterations; - PyObject *__pyx_v_anchor = 0; - PyObject *__pyx_v_in_place = 0; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_v_iplkernel; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_element,&__pyx_kp_iterations,&__pyx_kp_anchor,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvErode"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[5] = {0,0,0,0,0}; - values[1] = (PyObject*)((PyArrayObject *)Py_None); - values[3] = Py_None; - values[4] = __pyx_k_175; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_element); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_iterations); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_anchor); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvErode") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_element = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_iterations = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_iterations = 1; - } - __pyx_v_anchor = values[3]; - __pyx_v_in_place = values[4]; - } else { - __pyx_v_element = ((PyArrayObject *)Py_None); - __pyx_v_iterations = 1; - __pyx_v_anchor = Py_None; - __pyx_v_in_place = __pyx_k_175; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: __pyx_v_in_place = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: __pyx_v_anchor = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: __pyx_v_iterations = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_element = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvErode", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvErode"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5numpy_ndarray, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1272 - * anchor=None, in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1277 - * cdef IplConvKernel* iplkernel - * - * if element == None: # <<<<<<<<<<<<<< - * iplkernel = NULL - * else: - */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_element), Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1278 - * - * if element == None: - * iplkernel = NULL # <<<<<<<<<<<<<< - * else: - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) - */ - __pyx_v_iplkernel = NULL; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1280 - * iplkernel = NULL - * else: - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_4 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array(__pyx_v_element, __pyx_v_anchor); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_iplkernel = __pyx_t_4; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1282 - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) - * - * if in_place: # <<<<<<<<<<<<<< - * out = src - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1283 - * - * if in_place: - * out = src # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1285 - * out = src - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1289 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1290 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvErode(&srcimg, &outimg, iplkernel, iterations) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1292 - * populate_iplimage(out, &outimg) - * - * c_cvErode(&srcimg, &outimg, iplkernel, iterations) # <<<<<<<<<<<<<< - * - * free_IplConvKernel(iplkernel) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvErode((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_iplkernel, __pyx_v_iterations); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1294 - * c_cvErode(&srcimg, &outimg, iplkernel, iterations) - * - * free_IplConvKernel(iplkernel) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel(__pyx_v_iplkernel); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1296 - * free_IplConvKernel(iplkernel) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1297 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1299 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L8:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvErode"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1335 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvDilate(np.ndarray src, np.ndarray element=None, int iterations=1, # <<<<<<<<<<<<<< - * anchor=None, in_place=False): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDilate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDilate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_element = 0; - int __pyx_v_iterations; - PyObject *__pyx_v_anchor = 0; - PyObject *__pyx_v_in_place = 0; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_v_iplkernel; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_element,&__pyx_kp_iterations,&__pyx_kp_anchor,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvDilate"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[5] = {0,0,0,0,0}; - values[1] = (PyObject*)((PyArrayObject *)Py_None); - values[3] = Py_None; - values[4] = __pyx_k_179; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_element); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_iterations); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_anchor); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvDilate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_element = ((PyArrayObject *)values[1]); - if (values[2]) { - __pyx_v_iterations = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_iterations = 1; - } - __pyx_v_anchor = values[3]; - __pyx_v_in_place = values[4]; - } else { - __pyx_v_element = ((PyArrayObject *)Py_None); - __pyx_v_iterations = 1; - __pyx_v_anchor = Py_None; - __pyx_v_in_place = __pyx_k_179; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: __pyx_v_in_place = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: __pyx_v_anchor = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: __pyx_v_iterations = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_element = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvDilate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvDilate"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5numpy_ndarray, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1338 - * anchor=None, in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1343 - * cdef IplConvKernel* iplkernel - * - * if element == None: # <<<<<<<<<<<<<< - * iplkernel = NULL - * else: - */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_element), Py_None, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1344 - * - * if element == None: - * iplkernel = NULL # <<<<<<<<<<<<<< - * else: - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) - */ - __pyx_v_iplkernel = NULL; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1346 - * iplkernel = NULL - * else: - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_4 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array(__pyx_v_element, __pyx_v_anchor); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_iplkernel = __pyx_t_4; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1348 - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) - * - * if in_place: # <<<<<<<<<<<<<< - * out = src - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1349 - * - * if in_place: - * out = src # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1351 - * out = src - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1355 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1356 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvDilate(&srcimg, &outimg, iplkernel, iterations) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1358 - * populate_iplimage(out, &outimg) - * - * c_cvDilate(&srcimg, &outimg, iplkernel, iterations) # <<<<<<<<<<<<<< - * - * free_IplConvKernel(iplkernel) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDilate((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_iplkernel, __pyx_v_iterations); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1360 - * c_cvDilate(&srcimg, &outimg, iplkernel, iterations) - * - * free_IplConvKernel(iplkernel) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel(__pyx_v_iplkernel); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1362 - * free_IplConvKernel(iplkernel) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1363 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1365 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L8:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvDilate"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1408 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvMorphologyEx(np.ndarray src, np.ndarray element, int operation, # <<<<<<<<<<<<<< - * int iterations=1, anchor=None, in_place=False): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvMorphologyEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvMorphologyEx(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_element = 0; - int __pyx_v_operation; - int __pyx_v_iterations; - PyObject *__pyx_v_anchor = 0; - PyObject *__pyx_v_in_place = 0; - PyArrayObject *__pyx_v_out; - PyArrayObject *__pyx_v_temp; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_v_iplkernel; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_tempimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_tempimgptr; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *__pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_element,&__pyx_kp_operation,&__pyx_kp_iterations,&__pyx_kp_anchor,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvMorphologyEx"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[6] = {0,0,0,0,0,0}; - values[4] = Py_None; - values[5] = __pyx_k_183; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvMorphologyEx", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_operation); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvMorphologyEx", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_iterations); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_anchor); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvMorphologyEx") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_element = ((PyArrayObject *)values[1]); - __pyx_v_operation = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_operation == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[3]) { - __pyx_v_iterations = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_iterations = 1; - } - __pyx_v_anchor = values[4]; - __pyx_v_in_place = values[5]; - } else { - __pyx_v_iterations = 1; - __pyx_v_anchor = Py_None; - __pyx_v_in_place = __pyx_k_183; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: - __pyx_v_in_place = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: - __pyx_v_anchor = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: - __pyx_v_iterations = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_iterations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: - __pyx_v_operation = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_operation == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_element = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvMorphologyEx", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvMorphologyEx"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_temp = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5numpy_ndarray, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1411 - * int iterations=1, anchor=None, in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1417 - * cdef IplConvKernel* iplkernel - * - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_2 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array(__pyx_v_element, __pyx_v_anchor); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_iplkernel = __pyx_t_2; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1419 - * iplkernel = get_IplConvKernel_ptr_from_array(element, anchor) - * - * if in_place: # <<<<<<<<<<<<<< - * out = src - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1420 - * - * if in_place: - * out = src # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1422 - * out = src - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1427 - * cdef IplImage outimg - * cdef IplImage tempimg - * cdef IplImage* tempimgptr = &tempimg # <<<<<<<<<<<<<< - * - * populate_iplimage(src, &srcimg) - */ - __pyx_v_tempimgptr = (&__pyx_v_tempimg); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1429 - * cdef IplImage* tempimgptr = &tempimg - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1430 - * - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * # determine if we need the tempimg - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1433 - * - * # determine if we need the tempimg - * if operation == CV_MOP_OPEN or operation == CV_MOP_CLOSE: # <<<<<<<<<<<<<< - * tempimgptr = NULL - * elif operation == CV_MOP_GRADIENT: - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_operation); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_MOP_OPEN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!__pyx_t_3) { - __pyx_t_5 = PyInt_FromLong(__pyx_v_operation); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_MOP_CLOSE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_t_6; - } else { - __pyx_t_7 = __pyx_t_3; - } - if (__pyx_t_7) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1434 - * # determine if we need the tempimg - * if operation == CV_MOP_OPEN or operation == CV_MOP_CLOSE: - * tempimgptr = NULL # <<<<<<<<<<<<<< - * elif operation == CV_MOP_GRADIENT: - * temp = new_array_like(src) - */ - __pyx_v_tempimgptr = NULL; - goto __pyx_L7; - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1435 - * if operation == CV_MOP_OPEN or operation == CV_MOP_CLOSE: - * tempimgptr = NULL - * elif operation == CV_MOP_GRADIENT: # <<<<<<<<<<<<<< - * temp = new_array_like(src) - * populate_iplimage(temp, &tempimg) - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_operation); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_MOP_GRADIENT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_7) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1436 - * tempimgptr = NULL - * elif operation == CV_MOP_GRADIENT: - * temp = new_array_like(src) # <<<<<<<<<<<<<< - * populate_iplimage(temp, &tempimg) - * elif operation == CV_MOP_TOPHAT or operation == CV_MOP_BLACKHAT: - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_temp)); - __pyx_v_temp = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1437 - * elif operation == CV_MOP_GRADIENT: - * temp = new_array_like(src) - * populate_iplimage(temp, &tempimg) # <<<<<<<<<<<<<< - * elif operation == CV_MOP_TOPHAT or operation == CV_MOP_BLACKHAT: - * if in_place: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_temp, (&__pyx_v_tempimg)); - goto __pyx_L7; - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1438 - * temp = new_array_like(src) - * populate_iplimage(temp, &tempimg) - * elif operation == CV_MOP_TOPHAT or operation == CV_MOP_BLACKHAT: # <<<<<<<<<<<<<< - * if in_place: - * temp = new_array_like(src) - */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_operation); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_MOP_TOPHAT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_7) { - __pyx_t_4 = PyInt_FromLong(__pyx_v_operation); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_MOP_BLACKHAT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __pyx_t_3; - } else { - __pyx_t_6 = __pyx_t_7; - } - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1439 - * populate_iplimage(temp, &tempimg) - * elif operation == CV_MOP_TOPHAT or operation == CV_MOP_BLACKHAT: - * if in_place: # <<<<<<<<<<<<<< - * temp = new_array_like(src) - * populate_iplimage(temp, &tempimg) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1440 - * elif operation == CV_MOP_TOPHAT or operation == CV_MOP_BLACKHAT: - * if in_place: - * temp = new_array_like(src) # <<<<<<<<<<<<<< - * populate_iplimage(temp, &tempimg) - * else: - */ - __pyx_t_5 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_v_temp)); - __pyx_v_temp = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1441 - * if in_place: - * temp = new_array_like(src) - * populate_iplimage(temp, &tempimg) # <<<<<<<<<<<<<< - * else: - * tempimgptr = NULL - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_temp, (&__pyx_v_tempimg)); - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1443 - * populate_iplimage(temp, &tempimg) - * else: - * tempimgptr = NULL # <<<<<<<<<<<<<< - * else: - * raise RuntimeError('operation type not understood') - */ - __pyx_v_tempimgptr = NULL; - } - __pyx_L8:; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1445 - * tempimgptr = NULL - * else: - * raise RuntimeError('operation type not understood') # <<<<<<<<<<<<<< - * - * c_cvMorphologyEx(&srcimg, &outimg, tempimgptr, iplkernel, operation, - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_255); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_255); - __Pyx_GIVEREF(__pyx_kp_255); - __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1448 - * - * c_cvMorphologyEx(&srcimg, &outimg, tempimgptr, iplkernel, operation, - * iterations) # <<<<<<<<<<<<<< - * - * free_IplConvKernel(iplkernel) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvMorphologyEx((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_tempimgptr, __pyx_v_iplkernel, __pyx_v_operation, __pyx_v_iterations); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1450 - * iterations) - * - * free_IplConvKernel(iplkernel) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel(__pyx_v_iplkernel); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1452 - * free_IplConvKernel(iplkernel) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1453 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L9; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1455 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L9:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvMorphologyEx"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_DECREF((PyObject *)__pyx_v_temp); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1541 - * Using standard sigma for small kernels (3x3 to 7x7) - * gives better speed.''') - * def cvSmooth(np.ndarray src, int smoothtype=CV_GAUSSIAN, int param1=3, # <<<<<<<<<<<<<< - * int param2=0, double param3=0, double param4=0, - * bool in_place=False): - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSmooth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSmooth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_smoothtype; - int __pyx_v_param1; - int __pyx_v_param2; - double __pyx_v_param3; - double __pyx_v_param4; - PyObject *__pyx_v_in_place = 0; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_smoothtype,&__pyx_kp_33,&__pyx_kp_34,&__pyx_kp_35,&__pyx_kp_36,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvSmooth"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[7] = {0,0,0,0,0,0,0}; - values[6] = (PyObject*)__pyx_k_188; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smoothtype); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_33); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_34); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_35); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_36); - if (unlikely(value)) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvSmooth") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - if (values[1]) { - __pyx_v_smoothtype = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_smoothtype == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_smoothtype = __pyx_k_187; - } - if (values[2]) { - __pyx_v_param1 = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_param1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_param1 = 3; - } - if (values[3]) { - __pyx_v_param2 = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_param2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_param2 = 0; - } - if (values[4]) { - __pyx_v_param3 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_param3 = ((double)0); - } - if (values[5]) { - __pyx_v_param4 = __pyx_PyFloat_AsDouble(values[5]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_param4 = ((double)0); - } - __pyx_v_in_place = ((PyObject *)values[6]); - } else { - __pyx_v_smoothtype = __pyx_k_187; - __pyx_v_param1 = 3; - __pyx_v_param2 = 0; - __pyx_v_param3 = ((double)0); - __pyx_v_param4 = ((double)0); - __pyx_v_in_place = __pyx_k_188; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: __pyx_v_in_place = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 6)); - case 6: __pyx_v_param4 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 5: __pyx_v_param3 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 4: __pyx_v_param2 = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_param2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: __pyx_v_param1 = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_param1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: __pyx_v_smoothtype = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_smoothtype == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvSmooth", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvSmooth"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_place), &PyBool_Type, 1, "in_place", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1545 - * bool in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1552 - * - * # CV_BLUR_NO_SCALE - * if smoothtype == CV_BLUR_NO_SCALE: # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_smoothtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_BLUR_NO_SCALE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1554 - * if smoothtype == CV_BLUR_NO_SCALE: - * - * if in_place: # <<<<<<<<<<<<<< - * raise RuntimeError('In place operation not supported with this ' - * 'filter') - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_in_place)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1555 - * - * if in_place: - * raise RuntimeError('In place operation not supported with this ' # <<<<<<<<<<<<<< - * 'filter') - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_256); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_256); - __Pyx_GIVEREF(__pyx_kp_256); - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1558 - * 'filter') - * - * assert_dtype(src, [UINT8, INT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_ndims(src, [2]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1559 - * - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_ndims(src, [2]) # <<<<<<<<<<<<<< - * - * if src.dtype == FLOAT32: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1561 - * assert_ndims(src, [2]) - * - * if src.dtype == FLOAT32: # <<<<<<<<<<<<<< - * out = new_array_like(src) - * else: - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1562 - * - * if src.dtype == FLOAT32: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * else: - * out = new_array_like_diff_dtype(src, INT16) - */ - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1564 - * out = new_array_like(src) - * else: - * out = new_array_like_diff_dtype(src, INT16) # <<<<<<<<<<<<<< - * - * # CV_BLUR and CV_GAUSSIAN - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_235); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype(__pyx_v_src, __pyx_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L8:; - goto __pyx_L6; - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1567 - * - * # CV_BLUR and CV_GAUSSIAN - * elif smoothtype == CV_BLUR or smoothtype == CV_GAUSSIAN: # <<<<<<<<<<<<<< - * - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_smoothtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_BLUR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_4) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_smoothtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_GAUSSIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_4; - } - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1569 - * elif smoothtype == CV_BLUR or smoothtype == CV_GAUSSIAN: - * - * assert_dtype(src, [UINT8, INT8, FLOAT32]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1, 3]) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1570 - * - * assert_dtype(src, [UINT8, INT8, FLOAT32]) - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1572 - * assert_nchannels(src, [1, 3]) - * - * if in_place: # <<<<<<<<<<<<<< - * out = src - * else: - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_in_place)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1573 - * - * if in_place: - * out = src # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - goto __pyx_L9; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1575 - * out = src - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * # CV_MEDIAN and CV_BILATERAL - */ - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L9:; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1579 - * # CV_MEDIAN and CV_BILATERAL - * else: - * assert_dtype(src, [UINT8, INT8]) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1, 3]) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_233); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1580 - * else: - * assert_dtype(src, [UINT8, INT8]) - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1582 - * assert_nchannels(src, [1, 3]) - * - * if in_place: # <<<<<<<<<<<<<< - * raise RuntimeError('In place operation not supported with this ' - * 'filter') - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_in_place)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1583 - * - * if in_place: - * raise RuntimeError('In place operation not supported with this ' # <<<<<<<<<<<<<< - * 'filter') - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_257); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_257); - __Pyx_GIVEREF(__pyx_kp_257); - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1586 - * 'filter') - * - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1590 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1591 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvSmooth(&srcimg, &outimg, smoothtype, param1, param2, param3, param4) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1593 - * populate_iplimage(out, &outimg) - * - * c_cvSmooth(&srcimg, &outimg, smoothtype, param1, param2, param3, param4) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSmooth((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_smoothtype, __pyx_v_param1, __pyx_v_param2, __pyx_v_param3, __pyx_v_param4); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1595 - * c_cvSmooth(&srcimg, &outimg, smoothtype, param1, param2, param3, param4) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_in_place)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1596 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L11; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1598 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L11:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvSmooth"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1634 - * whether it will faster to do the convolution in the spatial - * or the frequency domain, and behaves accordingly.''') - * def cvFilter2D(np.ndarray src, np.ndarray kernel, anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFilter2D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFilter2D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyArrayObject *__pyx_v_kernel = 0; - PyObject *__pyx_v_anchor = 0; - PyObject *__pyx_v_in_place = 0; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint __pyx_v_cv_anchor; - PyArrayObject *__pyx_v_out; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_kernelimg; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cv_kernel; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_kernel,&__pyx_kp_anchor,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvFilter2D"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - values[2] = Py_None; - values[3] = __pyx_k_192; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kernel); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvFilter2D", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_anchor); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvFilter2D") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_kernel = ((PyArrayObject *)values[1]); - __pyx_v_anchor = values[2]; - __pyx_v_in_place = values[3]; - } else { - __pyx_v_anchor = Py_None; - __pyx_v_in_place = __pyx_k_192; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: - __pyx_v_in_place = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: - __pyx_v_anchor = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: - __pyx_v_kernel = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvFilter2D", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFilter2D"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), __pyx_ptype_5numpy_ndarray, 1, "kernel", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1636 - * def cvFilter2D(np.ndarray src, np.ndarray kernel, anchor=None, in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * validate_array(kernel) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1637 - * - * validate_array(src) - * validate_array(kernel) # <<<<<<<<<<<<<< - * - * assert_ndims(kernel, [2]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_kernel); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1639 - * validate_array(kernel) - * - * assert_ndims(kernel, [2]) # <<<<<<<<<<<<<< - * assert_dtype(kernel, [FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_kernel, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1640 - * - * assert_ndims(kernel, [2]) - * assert_dtype(kernel, [FLOAT32]) # <<<<<<<<<<<<<< - * - * cdef CvPoint cv_anchor - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_kernel, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1643 - * - * cdef CvPoint cv_anchor - * if anchor is not None: # <<<<<<<<<<<<<< - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * cv_anchor.x = anchor[0] - */ - __pyx_t_3 = (__pyx_v_anchor != Py_None); - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1644 - * cdef CvPoint cv_anchor - * if anchor is not None: - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' # <<<<<<<<<<<<<< - * cv_anchor.x = anchor[0] - * cv_anchor.y = anchor[1] - */ - #ifndef PYREX_WITHOUT_ASSERTIONS - __pyx_t_4 = PyObject_Length(__pyx_v_anchor); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!(__pyx_t_4 == 2))) { - PyErr_SetObject(PyExc_AssertionError, __pyx_kp_258); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1645 - * if anchor is not None: - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * cv_anchor.x = anchor[0] # <<<<<<<<<<<<<< - * cv_anchor.y = anchor[1] - * assert (cv_anchor.x < kernel.shape[1]) and (cv_anchor.x >= 0) \ - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_anchor, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_anchor.x = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1646 - * assert len(anchor) == 2, 'anchor must be (x, y) tuple' - * cv_anchor.x = anchor[0] - * cv_anchor.y = anchor[1] # <<<<<<<<<<<<<< - * assert (cv_anchor.x < kernel.shape[1]) and (cv_anchor.x >= 0) \ - * and (cv_anchor.y < kernel.shape[0]) and (cv_anchor.y >= 0), \ - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_anchor, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_anchor.y = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1647 - * cv_anchor.x = anchor[0] - * cv_anchor.y = anchor[1] - * assert (cv_anchor.x < kernel.shape[1]) and (cv_anchor.x >= 0) \ # <<<<<<<<<<<<<< - * and (cv_anchor.y < kernel.shape[0]) and (cv_anchor.y >= 0), \ - * 'anchor point must be inside kernel' - */ - #ifndef PYREX_WITHOUT_ASSERTIONS - if ((__pyx_v_cv_anchor.x < (__pyx_v_kernel->dimensions[1]))) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1648 - * cv_anchor.y = anchor[1] - * assert (cv_anchor.x < kernel.shape[1]) and (cv_anchor.x >= 0) \ - * and (cv_anchor.y < kernel.shape[0]) and (cv_anchor.y >= 0), \ # <<<<<<<<<<<<<< - * 'anchor point must be inside kernel' - * else: - */ - if ((__pyx_v_cv_anchor.x >= 0)) { - if ((__pyx_v_cv_anchor.y < (__pyx_v_kernel->dimensions[0]))) { - __pyx_t_3 = (__pyx_v_cv_anchor.y >= 0); - } else { - __pyx_t_3 = (__pyx_v_cv_anchor.y < (__pyx_v_kernel->dimensions[0])); - } - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = (__pyx_v_cv_anchor.x >= 0); - } - __pyx_t_3 = __pyx_t_5; - } else { - __pyx_t_3 = (__pyx_v_cv_anchor.x < (__pyx_v_kernel->dimensions[1])); - } - if (unlikely(!__pyx_t_3)) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1649 - * assert (cv_anchor.x < kernel.shape[1]) and (cv_anchor.x >= 0) \ - * and (cv_anchor.y < kernel.shape[0]) and (cv_anchor.y >= 0), \ - * 'anchor point must be inside kernel' # <<<<<<<<<<<<<< - * else: - * cv_anchor.x = (kernel.shape[1] / 2.) - */ - PyErr_SetObject(PyExc_AssertionError, __pyx_kp_259); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1651 - * 'anchor point must be inside kernel' - * else: - * cv_anchor.x = (kernel.shape[1] / 2.) # <<<<<<<<<<<<<< - * cv_anchor.y = (kernel.shape[0] / 2.) - * - */ - __pyx_v_cv_anchor.x = ((int)((__pyx_v_kernel->dimensions[1]) / 2.0)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1652 - * else: - * cv_anchor.x = (kernel.shape[1] / 2.) - * cv_anchor.y = (kernel.shape[0] / 2.) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_v_cv_anchor.y = ((int)((__pyx_v_kernel->dimensions[0]) / 2.0)); - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1656 - * cdef np.ndarray out - * - * if in_place: # <<<<<<<<<<<<<< - * out = src - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1657 - * - * if in_place: - * out = src # <<<<<<<<<<<<<< - * else: - * out = new_array_like(src) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1659 - * out = src - * else: - * out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1664 - * cdef IplImage outimg - * cdef IplImage kernelimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * populate_iplimage(kernel, &kernelimg) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1665 - * cdef IplImage kernelimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * populate_iplimage(kernel, &kernelimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1666 - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) - * populate_iplimage(kernel, &kernelimg) # <<<<<<<<<<<<<< - * - * cdef CvMat* cv_kernel - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_kernel, (&__pyx_v_kernelimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1669 - * - * cdef CvMat* cv_kernel - * cv_kernel = cvmat_ptr_from_iplimage(&kernelimg) # <<<<<<<<<<<<<< - * - * c_cvFilter2D(&srcimg, &outimg, cv_kernel, cv_anchor) - */ - __pyx_v_cv_kernel = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_kernelimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1671 - * cv_kernel = cvmat_ptr_from_iplimage(&kernelimg) - * - * c_cvFilter2D(&srcimg, &outimg, cv_kernel, cv_anchor) # <<<<<<<<<<<<<< - * - * PyMem_Free(cv_kernel) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFilter2D((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_cv_kernel, __pyx_v_cv_anchor); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1673 - * c_cvFilter2D(&srcimg, &outimg, cv_kernel, cv_anchor) - * - * PyMem_Free(cv_kernel) # <<<<<<<<<<<<<< - * - * if in_place: - */ - PyMem_Free(__pyx_v_cv_kernel); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1675 - * PyMem_Free(cv_kernel) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1676 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1678 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L8:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFilter2D"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1707 - * out3: the titled sum image, - * or any combination of these two.''') - * def cvIntegral(np.ndarray src, square_sum=False, tilted_sum=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvIntegral(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvIntegral(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_square_sum = 0; - PyObject *__pyx_v_tilted_sum = 0; - PyObject *__pyx_v_out; - PyArrayObject *__pyx_v_outsum; - PyArrayObject *__pyx_v_outsqsum; - PyArrayObject *__pyx_v_outtiltsum; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outsumimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outsqsumimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outtiltsumimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_outsqsumimgptr; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *__pyx_v_outtiltsumimgptr; - npy_intp *__pyx_v_out_shape; - int __pyx_v_out_dims; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_square_sum,&__pyx_kp_tilted_sum,0}; - __Pyx_SetupRefcountContext("cvIntegral"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - values[1] = __pyx_k_196; - values[2] = __pyx_k_197; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_square_sum); - if (unlikely(value)) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tilted_sum); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvIntegral") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_square_sum = values[1]; - __pyx_v_tilted_sum = values[2]; - } else { - __pyx_v_square_sum = __pyx_k_196; - __pyx_v_tilted_sum = __pyx_k_197; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_tilted_sum = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: __pyx_v_square_sum = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvIntegral", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvIntegral"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_outsum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_outsqsum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_outtiltsum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1709 - * def cvIntegral(np.ndarray src, square_sum=False, tilted_sum=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32, FLOAT64]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1710 - * - * validate_array(src) - * assert_dtype(src, [UINT8, FLOAT32, FLOAT64]) # <<<<<<<<<<<<<< - * - * out = [] - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1712 - * assert_dtype(src, [UINT8, FLOAT32, FLOAT64]) - * - * out = [] # <<<<<<<<<<<<<< - * - * cdef np.ndarray outsum - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(__pyx_v_out); - __pyx_v_out = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1722 - * cdef IplImage outsqsumimg - * cdef IplImage outtiltsumimg - * cdef IplImage* outsqsumimgptr = &outsqsumimg # <<<<<<<<<<<<<< - * cdef IplImage* outtiltsumimgptr = &outtiltsumimg - * - */ - __pyx_v_outsqsumimgptr = (&__pyx_v_outsqsumimg); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1723 - * cdef IplImage outtiltsumimg - * cdef IplImage* outsqsumimgptr = &outsqsumimg - * cdef IplImage* outtiltsumimgptr = &outtiltsumimg # <<<<<<<<<<<<<< - * - * populate_iplimage(src, &srcimg) - */ - __pyx_v_outtiltsumimgptr = (&__pyx_v_outtiltsumimg); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1725 - * cdef IplImage* outtiltsumimgptr = &outtiltsumimg - * - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * - * # out arrays need to be (H + 1) x (W + 1) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1728 - * - * # out arrays need to be (H + 1) x (W + 1) - * cdef np.npy_intp* out_shape = clone_array_shape(src) # <<<<<<<<<<<<<< - * out_shape[0] = src.shape[0] + 1 - * out_shape[1] = src.shape[1] + 1 - */ - __pyx_v_out_shape = __pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(__pyx_v_src); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1729 - * # out arrays need to be (H + 1) x (W + 1) - * cdef np.npy_intp* out_shape = clone_array_shape(src) - * out_shape[0] = src.shape[0] + 1 # <<<<<<<<<<<<<< - * out_shape[1] = src.shape[1] + 1 - * cdef int out_dims = src.ndim - */ - (__pyx_v_out_shape[0]) = ((__pyx_v_src->dimensions[0]) + 1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1730 - * cdef np.npy_intp* out_shape = clone_array_shape(src) - * out_shape[0] = src.shape[0] + 1 - * out_shape[1] = src.shape[1] + 1 # <<<<<<<<<<<<<< - * cdef int out_dims = src.ndim - * - */ - (__pyx_v_out_shape[1]) = ((__pyx_v_src->dimensions[1]) + 1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1731 - * out_shape[0] = src.shape[0] + 1 - * out_shape[1] = src.shape[1] + 1 - * cdef int out_dims = src.ndim # <<<<<<<<<<<<<< - * - * if src.dtype == UINT8: - */ - __pyx_v_out_dims = __pyx_v_src->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1733 - * cdef int out_dims = src.ndim - * - * if src.dtype == UINT8: # <<<<<<<<<<<<<< - * outsum = new_array(out_dims, out_shape, INT32) - * else: - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1734 - * - * if src.dtype == UINT8: - * outsum = new_array(out_dims, out_shape, INT32) # <<<<<<<<<<<<<< - * else: - * outsum = new_array(out_dims, out_shape, FLOAT64) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_261); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_out_dims, __pyx_v_out_shape, __pyx_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_outsum)); - __pyx_v_outsum = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1736 - * outsum = new_array(out_dims, out_shape, INT32) - * else: - * outsum = new_array(out_dims, out_shape, FLOAT64) # <<<<<<<<<<<<<< - * - * populate_iplimage(outsum, &outsumimg) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_out_dims, __pyx_v_out_shape, __pyx_3)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_outsum)); - __pyx_v_outsum = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1738 - * outsum = new_array(out_dims, out_shape, FLOAT64) - * - * populate_iplimage(outsum, &outsumimg) # <<<<<<<<<<<<<< - * out.append(outsum) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_outsum, (&__pyx_v_outsumimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1739 - * - * populate_iplimage(outsum, &outsumimg) - * out.append(outsum) # <<<<<<<<<<<<<< - * - * if square_sum: - */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_out, ((PyObject *)__pyx_v_outsum)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1741 - * out.append(outsum) - * - * if square_sum: # <<<<<<<<<<<<<< - * outsqsum = new_array(out_dims, out_shape, FLOAT64) - * populate_iplimage(outsqsum, &outsqsumimg) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_square_sum); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1742 - * - * if square_sum: - * outsqsum = new_array(out_dims, out_shape, FLOAT64) # <<<<<<<<<<<<<< - * populate_iplimage(outsqsum, &outsqsumimg) - * out.append(outsqsum) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_out_dims, __pyx_v_out_shape, __pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_outsqsum)); - __pyx_v_outsqsum = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1743 - * if square_sum: - * outsqsum = new_array(out_dims, out_shape, FLOAT64) - * populate_iplimage(outsqsum, &outsqsumimg) # <<<<<<<<<<<<<< - * out.append(outsqsum) - * else: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_outsqsum, (&__pyx_v_outsqsumimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1744 - * outsqsum = new_array(out_dims, out_shape, FLOAT64) - * populate_iplimage(outsqsum, &outsqsumimg) - * out.append(outsqsum) # <<<<<<<<<<<<<< - * else: - * outsqsumimgptr = NULL - */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_out, ((PyObject *)__pyx_v_outsqsum)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1746 - * out.append(outsqsum) - * else: - * outsqsumimgptr = NULL # <<<<<<<<<<<<<< - * - * if tilted_sum: - */ - __pyx_v_outsqsumimgptr = NULL; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1748 - * outsqsumimgptr = NULL - * - * if tilted_sum: # <<<<<<<<<<<<<< - * outtiltsum = new_array(out_dims, out_shape, outsum.dtype) - * populate_iplimage(outtiltsum, &outtiltsumimg) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_tilted_sum); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1749 - * - * if tilted_sum: - * outtiltsum = new_array(out_dims, out_shape, outsum.dtype) # <<<<<<<<<<<<<< - * populate_iplimage(outtiltsum, &outtiltsumimg) - * out.append(outtiltsum) - */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_outsum), __pyx_kp_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_out_dims, __pyx_v_out_shape, __pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_outtiltsum)); - __pyx_v_outtiltsum = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1750 - * if tilted_sum: - * outtiltsum = new_array(out_dims, out_shape, outsum.dtype) - * populate_iplimage(outtiltsum, &outtiltsumimg) # <<<<<<<<<<<<<< - * out.append(outtiltsum) - * else: - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_outtiltsum, (&__pyx_v_outtiltsumimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1751 - * outtiltsum = new_array(out_dims, out_shape, outsum.dtype) - * populate_iplimage(outtiltsum, &outtiltsumimg) - * out.append(outtiltsum) # <<<<<<<<<<<<<< - * else: - * outtiltsumimgptr = NULL - */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_out, ((PyObject *)__pyx_v_outtiltsum)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1753 - * out.append(outtiltsum) - * else: - * outtiltsumimgptr = NULL # <<<<<<<<<<<<<< - * - * c_cvIntegral(&srcimg, &outsumimg, outsqsumimgptr, outtiltsumimgptr) - */ - __pyx_v_outtiltsumimgptr = NULL; - } - __pyx_L8:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1755 - * outtiltsumimgptr = NULL - * - * c_cvIntegral(&srcimg, &outsumimg, outsqsumimgptr, outtiltsumimgptr) # <<<<<<<<<<<<<< - * - * PyMem_Free(out_shape) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvIntegral((&__pyx_v_srcimg), (&__pyx_v_outsumimg), __pyx_v_outsqsumimgptr, __pyx_v_outtiltsumimgptr); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1757 - * c_cvIntegral(&srcimg, &outsumimg, outsqsumimgptr, outtiltsumimgptr) - * - * PyMem_Free(out_shape) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_out_shape); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1759 - * PyMem_Free(out_shape) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_out); - __pyx_r = __pyx_v_out; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvIntegral"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_out); - __Pyx_DECREF((PyObject *)__pyx_v_outsum); - __Pyx_DECREF((PyObject *)__pyx_v_outsqsum); - __Pyx_DECREF((PyObject *)__pyx_v_outtiltsum); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1809 - * See the OpenCV documentation for more details - * about the specific color conversions.''') - * def cvCvtColor(np.ndarray src, int code): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCvtColor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCvtColor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - int __pyx_v_code; - PyObject *__pyx_v_conversion_params; - int __pyx_v_src_channels; - int __pyx_v_out_channels; - PyObject *__pyx_v_src_dtypes; - PyArrayObject *__pyx_v_out; - npy_intp __pyx_v_out_shape2[2]; - npy_intp __pyx_v_out_shape3[3]; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_code,0}; - __Pyx_SetupRefcountContext("cvCvtColor"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_code); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvCvtColor", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCvtColor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_code = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCvtColor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCvtColor"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_conversion_params = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_src_dtypes = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1811 - * def cvCvtColor(np.ndarray src, int code): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, UINT16, FLOAT32]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1812 - * - * validate_array(src) - * assert_dtype(src, [UINT8, UINT16, FLOAT32]) # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1814 - * assert_dtype(src, [UINT8, UINT16, FLOAT32]) - * - * try: # <<<<<<<<<<<<<< - * conversion_params = _cvtcolor_dict[code] - * except KeyError: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1815 - * - * try: - * conversion_params = _cvtcolor_dict[code] # <<<<<<<<<<<<<< - * except KeyError: - * print 'unknown conversion code' - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__cvtcolor_dict); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetItemInt(__pyx_1, __pyx_v_code, sizeof(int), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_v_conversion_params); - __pyx_v_conversion_params = __pyx_2; - __pyx_2 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L13_try_end; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_3); __pyx_3 = 0; - __Pyx_XDECREF(__pyx_1); __pyx_1 = 0; - __Pyx_XDECREF(__pyx_2); __pyx_2 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1816 - * try: - * conversion_params = _cvtcolor_dict[code] - * except KeyError: # <<<<<<<<<<<<<< - * print 'unknown conversion code' - * raise - */ - __pyx_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_4) { - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCvtColor"); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1817 - * conversion_params = _cvtcolor_dict[code] - * except KeyError: - * print 'unknown conversion code' # <<<<<<<<<<<<<< - * raise - * - */ - if (__Pyx_PrintOne(__pyx_kp_262) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1818 - * except KeyError: - * print 'unknown conversion code' - * raise # <<<<<<<<<<<<<< - * - * cdef int src_channels = conversion_params[0] - */ - __Pyx_Raise(__pyx_t_2, __pyx_t_3, __pyx_t_4); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L7_exception_handled; - } - __pyx_L8_except_error:; - __Pyx_XDECREF(__pyx_save_exc_type); - __Pyx_XDECREF(__pyx_save_exc_value); - __Pyx_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L7_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L13_try_end:; - } - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1820 - * raise - * - * cdef int src_channels = conversion_params[0] # <<<<<<<<<<<<<< - * cdef int out_channels = conversion_params[1] - * src_dtypes = conversion_params[2] - */ - __pyx_3 = __Pyx_GetItemInt(__pyx_v_conversion_params, 0, sizeof(long), PyInt_FromLong); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_v_src_channels = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1821 - * - * cdef int src_channels = conversion_params[0] - * cdef int out_channels = conversion_params[1] # <<<<<<<<<<<<<< - * src_dtypes = conversion_params[2] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_conversion_params, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_out_channels = ((int)__pyx_t_1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1822 - * cdef int src_channels = conversion_params[0] - * cdef int out_channels = conversion_params[1] - * src_dtypes = conversion_params[2] # <<<<<<<<<<<<<< - * - * assert_nchannels(src, src_channels) - */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_conversion_params, 2, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_v_src_dtypes); - __pyx_v_src_dtypes = __pyx_2; - __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1824 - * src_dtypes = conversion_params[2] - * - * assert_nchannels(src, src_channels) # <<<<<<<<<<<<<< - * assert_dtype(src, src_dtypes) - * - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_src_channels); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1825 - * - * assert_nchannels(src, src_channels) - * assert_dtype(src, src_dtypes) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, __pyx_v_src_dtypes); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1833 - * cdef np.npy_intp out_shape2[2] - * cdef np.npy_intp out_shape3[3] - * out_shape2[0] = src.shape[0] # <<<<<<<<<<<<<< - * out_shape2[1] = src.shape[1] - * out_shape3[0] = src.shape[0] - */ - (__pyx_v_out_shape2[0]) = (__pyx_v_src->dimensions[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1834 - * cdef np.npy_intp out_shape3[3] - * out_shape2[0] = src.shape[0] - * out_shape2[1] = src.shape[1] # <<<<<<<<<<<<<< - * out_shape3[0] = src.shape[0] - * out_shape3[1] = src.shape[1] - */ - (__pyx_v_out_shape2[1]) = (__pyx_v_src->dimensions[1]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1835 - * out_shape2[0] = src.shape[0] - * out_shape2[1] = src.shape[1] - * out_shape3[0] = src.shape[0] # <<<<<<<<<<<<<< - * out_shape3[1] = src.shape[1] - * - */ - (__pyx_v_out_shape3[0]) = (__pyx_v_src->dimensions[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1836 - * out_shape2[1] = src.shape[1] - * out_shape3[0] = src.shape[0] - * out_shape3[1] = src.shape[1] # <<<<<<<<<<<<<< - * - * if out_channels == 1: - */ - (__pyx_v_out_shape3[1]) = (__pyx_v_src->dimensions[1]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1838 - * out_shape3[1] = src.shape[1] - * - * if out_channels == 1: # <<<<<<<<<<<<<< - * out = new_array(2, out_shape2, src.dtype) - * else: - */ - __pyx_t_5 = (__pyx_v_out_channels == 1); - if (__pyx_t_5) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1839 - * - * if out_channels == 1: - * out = new_array(2, out_shape2, src.dtype) # <<<<<<<<<<<<<< - * else: - * out_shape3[2] = out_channels - */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_out_shape2, __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L16; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1841 - * out = new_array(2, out_shape2, src.dtype) - * else: - * out_shape3[2] = out_channels # <<<<<<<<<<<<<< - * out = new_array(3, out_shape3, src.dtype) - * - */ - (__pyx_v_out_shape3[2]) = ((npy_intp)__pyx_v_out_channels); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1842 - * else: - * out_shape3[2] = out_channels - * out = new_array(3, out_shape3, src.dtype) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(3, __pyx_v_out_shape3, __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L16:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1846 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1847 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvCvtColor(&srcimg, &outimg, code) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1849 - * populate_iplimage(out, &outimg) - * - * c_cvCvtColor(&srcimg, &outimg, code) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCvtColor((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_code); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1851 - * c_cvCvtColor(&srcimg, &outimg, code) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCvtColor"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF(__pyx_v_conversion_params); - __Pyx_DECREF(__pyx_v_src_dtypes); - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1889 - * returned in addition to the thresholded image. Otherwise - * just the thresholded image is returned.''') - * def cvThreshold(np.ndarray src, double threshold, double max_value=255, # <<<<<<<<<<<<<< - * int threshold_type=CV_THRESH_BINARY, use_otsu=False): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvThreshold(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvThreshold(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - double __pyx_v_threshold; - double __pyx_v_max_value; - int __pyx_v_threshold_type; - PyObject *__pyx_v_use_otsu = 0; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_threshold,&__pyx_kp_max_value,&__pyx_kp_threshold_type,&__pyx_kp_use_otsu,0}; - __Pyx_SetupRefcountContext("cvThreshold"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[5] = {0,0,0,0,0}; - values[4] = __pyx_k_205; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_threshold); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvThreshold", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_max_value); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_threshold_type); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_use_otsu); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvThreshold") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_threshold = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[2]) { - __pyx_v_max_value = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_max_value = ((double)255); - } - if (values[3]) { - __pyx_v_threshold_type = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_threshold_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_threshold_type = __pyx_k_204; - } - __pyx_v_use_otsu = values[4]; - } else { - __pyx_v_max_value = ((double)255); - __pyx_v_threshold_type = __pyx_k_204; - __pyx_v_use_otsu = __pyx_k_205; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: - __pyx_v_use_otsu = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: - __pyx_v_threshold_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_threshold_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: - __pyx_v_max_value = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_threshold = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvThreshold", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvThreshold"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1892 - * int threshold_type=CV_THRESH_BINARY, use_otsu=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1893 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1894 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8, FLOAT32]) # <<<<<<<<<<<<<< - * - * if use_otsu: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1896 - * assert_dtype(src, [UINT8, FLOAT32]) - * - * if use_otsu: # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * threshold_type += 8 - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_use_otsu); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1897 - * - * if use_otsu: - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * threshold_type += 8 - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1898 - * if use_otsu: - * assert_dtype(src, [UINT8]) - * threshold_type += 8 # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array_like(src) - */ - __pyx_v_threshold_type += 8; - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1900 - * threshold_type += 8 - * - * cdef np.ndarray out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_out = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1904 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1905 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * threshold = c_cvThreshold(&srcimg, &outimg, threshold, max_value, - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1908 - * - * threshold = c_cvThreshold(&srcimg, &outimg, threshold, max_value, - * threshold_type) # <<<<<<<<<<<<<< - * - * if use_otsu: - */ - __pyx_v_threshold = __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvThreshold((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_threshold, __pyx_v_max_value, __pyx_v_threshold_type); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1910 - * threshold_type) - * - * if use_otsu: # <<<<<<<<<<<<<< - * return (out, threshold) - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_use_otsu); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1911 - * - * if use_otsu: - * return (out, threshold) # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_threshold); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_out)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1913 - * return (out, threshold) - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L7:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvThreshold"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1949 - * out : ndarray - * The thresholded image.''') - * def cvAdaptiveThreshold(np.ndarray src, double max_value, # <<<<<<<<<<<<<< - * int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, - * int threshold_type=CV_THRESH_BINARY, - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThreshold(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThreshold(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - double __pyx_v_max_value; - int __pyx_v_adaptive_method; - int __pyx_v_threshold_type; - int __pyx_v_block_size; - double __pyx_v_param1; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_max_value,&__pyx_kp_adaptive_method,&__pyx_kp_threshold_type,&__pyx_kp_block_size,&__pyx_kp_33,0}; - __Pyx_SetupRefcountContext("cvAdaptiveThreshold"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[6] = {0,0,0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_max_value); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvAdaptiveThreshold", 0, 2, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_adaptive_method); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_threshold_type); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_block_size); - if (unlikely(value)) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_33); - if (unlikely(value)) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvAdaptiveThreshold") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_max_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[2]) { - __pyx_v_adaptive_method = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_adaptive_method == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_adaptive_method = __pyx_k_210; - } - if (values[3]) { - __pyx_v_threshold_type = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_threshold_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_threshold_type = __pyx_k_211; - } - if (values[4]) { - __pyx_v_block_size = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_block_size = 3; - } - if (values[5]) { - __pyx_v_param1 = __pyx_PyFloat_AsDouble(values[5]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_param1 = ((double)5); - } - } else { - __pyx_v_adaptive_method = __pyx_k_210; - __pyx_v_threshold_type = __pyx_k_211; - __pyx_v_block_size = 3; - __pyx_v_param1 = ((double)5); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: - __pyx_v_param1 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 5: - __pyx_v_block_size = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 4: - __pyx_v_threshold_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_threshold_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: - __pyx_v_adaptive_method = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_adaptive_method == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_max_value = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvAdaptiveThreshold", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvAdaptiveThreshold"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1954 - * int block_size=3, double param1=5): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1955 - * - * validate_array(src) - * assert_nchannels(src, [1]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1956 - * validate_array(src) - * assert_nchannels(src, [1]) - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * - * if (adaptive_method!=CV_ADAPTIVE_THRESH_MEAN_C and - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1958 - * assert_dtype(src, [UINT8]) - * - * if (adaptive_method!=CV_ADAPTIVE_THRESH_MEAN_C and # <<<<<<<<<<<<<< - * adaptive_method!=CV_ADAPTIVE_THRESH_GAUSSIAN_C): - * raise ValueError('Invalid adaptive method') - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_adaptive_method); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_209); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1959 - * - * if (adaptive_method!=CV_ADAPTIVE_THRESH_MEAN_C and - * adaptive_method!=CV_ADAPTIVE_THRESH_GAUSSIAN_C): # <<<<<<<<<<<<<< - * raise ValueError('Invalid adaptive method') - * - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_adaptive_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_263); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_1, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_4; - } - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1960 - * if (adaptive_method!=CV_ADAPTIVE_THRESH_MEAN_C and - * adaptive_method!=CV_ADAPTIVE_THRESH_GAUSSIAN_C): - * raise ValueError('Invalid adaptive method') # <<<<<<<<<<<<<< - * - * if (threshold_type!=CV_THRESH_BINARY and - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_264); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_264); - __Pyx_GIVEREF(__pyx_kp_264); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1962 - * raise ValueError('Invalid adaptive method') - * - * if (threshold_type!=CV_THRESH_BINARY and # <<<<<<<<<<<<<< - * threshold_type!=CV_THRESH_BINARY_INV): - * raise ValueError('Invalid threshold type') - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_threshold_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_THRESH_BINARY); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_1, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1963 - * - * if (threshold_type!=CV_THRESH_BINARY and - * threshold_type!=CV_THRESH_BINARY_INV): # <<<<<<<<<<<<<< - * raise ValueError('Invalid threshold type') - * - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_threshold_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_265); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_6; - } - if (__pyx_t_5) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1964 - * if (threshold_type!=CV_THRESH_BINARY and - * threshold_type!=CV_THRESH_BINARY_INV): - * raise ValueError('Invalid threshold type') # <<<<<<<<<<<<<< - * - * if (block_size % 2 != 1 or block_size <= 1): - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_266); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_266); - __Pyx_GIVEREF(__pyx_kp_266); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1966 - * raise ValueError('Invalid threshold type') - * - * if (block_size % 2 != 1 or block_size <= 1): # <<<<<<<<<<<<<< - * raise ValueError('block size must be and odd number and greater than 1') - * - */ - if (!((__pyx_v_block_size % 2) != 1)) { - __pyx_t_5 = (__pyx_v_block_size <= 1); - } else { - __pyx_t_5 = ((__pyx_v_block_size % 2) != 1); - } - if (__pyx_t_5) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1967 - * - * if (block_size % 2 != 1 or block_size <= 1): - * raise ValueError('block size must be and odd number and greater than 1') # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array_like(src) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_267); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_267); - __Pyx_GIVEREF(__pyx_kp_267); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1969 - * raise ValueError('block size must be and odd number and greater than 1') - * - * cdef np.ndarray out = new_array_like(src) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like(__pyx_v_src)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1973 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1974 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvAdaptiveThreshold(&srcimg, &outimg, max_value, adaptive_method, - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1977 - * - * c_cvAdaptiveThreshold(&srcimg, &outimg, max_value, adaptive_method, - * threshold_type, block_size, param1) # <<<<<<<<<<<<<< - * - * return out - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvAdaptiveThreshold((&__pyx_v_srcimg), (&__pyx_v_outimg), __pyx_v_max_value, __pyx_v_adaptive_method, __pyx_v_threshold_type, __pyx_v_block_size, __pyx_v_param1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1979 - * threshold_type, block_size, param1) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvAdaptiveThreshold"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2000 - * Downsampled image half the size of the original - * in each dimension.''') - * def cvPyrDown(np.ndarray src): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrDown(PyObject *__pyx_self, PyObject *__pyx_v_src); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrDown(PyObject *__pyx_self, PyObject *__pyx_v_src) { - int __pyx_v_outdim; - npy_intp *__pyx_v_outshape; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("cvPyrDown"); - __pyx_self = __pyx_self; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2002 - * def cvPyrDown(np.ndarray src): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(((PyArrayObject *)__pyx_v_src)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2003 - * - * validate_array(src) - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) # <<<<<<<<<<<<<< - * - * cdef int outdim = src.ndim - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(((PyArrayObject *)__pyx_v_src), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2005 - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) - * - * cdef int outdim = src.ndim # <<<<<<<<<<<<<< - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] + 1) / 2 - */ - __pyx_v_outdim = ((PyArrayObject *)__pyx_v_src)->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2006 - * - * cdef int outdim = src.ndim - * cdef np.npy_intp* outshape = clone_array_shape(src) # <<<<<<<<<<<<<< - * outshape[0] = (src.shape[0] + 1) / 2 - * outshape[1] = (src.shape[1] + 1) / 2 - */ - __pyx_v_outshape = __pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(((PyArrayObject *)__pyx_v_src)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2007 - * cdef int outdim = src.ndim - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] + 1) / 2 # <<<<<<<<<<<<<< - * outshape[1] = (src.shape[1] + 1) / 2 - * - */ - (__pyx_v_outshape[0]) = (((npy_intp)((((PyArrayObject *)__pyx_v_src)->dimensions[0]) + 1)) / 2); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2008 - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] + 1) / 2 - * outshape[1] = (src.shape[1] + 1) / 2 # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array(outdim, outshape, src.dtype) - */ - (__pyx_v_outshape[1]) = (((npy_intp)((((PyArrayObject *)__pyx_v_src)->dimensions[1]) + 1)) / 2); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2010 - * outshape[1] = (src.shape[1] + 1) / 2 - * - * cdef np.ndarray out = new_array(outdim, outshape, src.dtype) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_src, __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_outdim, __pyx_v_outshape, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2014 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(((PyArrayObject *)__pyx_v_src), (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2015 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvPyrDown(&srcimg, &outimg, 7) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2017 - * populate_iplimage(out, &outimg) - * - * c_cvPyrDown(&srcimg, &outimg, 7) # <<<<<<<<<<<<<< - * - * PyMem_Free(outshape) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrDown((&__pyx_v_srcimg), (&__pyx_v_outimg), 7); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2019 - * c_cvPyrDown(&srcimg, &outimg, 7) - * - * PyMem_Free(outshape) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_outshape); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2021 - * PyMem_Free(outshape) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_4); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvPyrDown"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2042 - * Upsampled image twice the size of the original - * in each dimension.''') - * def cvPyrUp(np.ndarray src): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrUp(PyObject *__pyx_self, PyObject *__pyx_v_src); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrUp(PyObject *__pyx_self, PyObject *__pyx_v_src) { - int __pyx_v_outdim; - npy_intp *__pyx_v_outshape; - PyArrayObject *__pyx_v_out = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("cvPyrUp"); - __pyx_self = __pyx_self; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2044 - * def cvPyrUp(np.ndarray src): - * - * validate_array(src) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(((PyArrayObject *)__pyx_v_src)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2045 - * - * validate_array(src) - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) # <<<<<<<<<<<<<< - * - * cdef int outdim = src.ndim - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(((PyArrayObject *)__pyx_v_src), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2047 - * assert_dtype(src, [UINT8, UINT16, FLOAT32, FLOAT64]) - * - * cdef int outdim = src.ndim # <<<<<<<<<<<<<< - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] * 2) - */ - __pyx_v_outdim = ((PyArrayObject *)__pyx_v_src)->nd; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2048 - * - * cdef int outdim = src.ndim - * cdef np.npy_intp* outshape = clone_array_shape(src) # <<<<<<<<<<<<<< - * outshape[0] = (src.shape[0] * 2) - * outshape[1] = (src.shape[1] * 2) - */ - __pyx_v_outshape = __pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape(((PyArrayObject *)__pyx_v_src)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2049 - * cdef int outdim = src.ndim - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] * 2) # <<<<<<<<<<<<<< - * outshape[1] = (src.shape[1] * 2) - * - */ - (__pyx_v_outshape[0]) = ((npy_intp)((((PyArrayObject *)__pyx_v_src)->dimensions[0]) * 2)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2050 - * cdef np.npy_intp* outshape = clone_array_shape(src) - * outshape[0] = (src.shape[0] * 2) - * outshape[1] = (src.shape[1] * 2) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out = new_array(outdim, outshape, src.dtype) - */ - (__pyx_v_outshape[1]) = ((npy_intp)((((PyArrayObject *)__pyx_v_src)->dimensions[1]) * 2)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2052 - * outshape[1] = (src.shape[1] * 2) - * - * cdef np.ndarray out = new_array(outdim, outshape, src.dtype) # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_src, __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(__pyx_v_outdim, __pyx_v_outshape, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_out = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2056 - * cdef IplImage srcimg - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * populate_iplimage(out, &outimg) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(((PyArrayObject *)__pyx_v_src), (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2057 - * cdef IplImage outimg - * populate_iplimage(src, &srcimg) - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * c_cvPyrUp(&srcimg, &outimg, 7) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2059 - * populate_iplimage(out, &outimg) - * - * c_cvPyrUp(&srcimg, &outimg, 7) # <<<<<<<<<<<<<< - * - * PyMem_Free(outshape) - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrUp((&__pyx_v_srcimg), (&__pyx_v_outimg), 7); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2061 - * c_cvPyrUp(&srcimg, &outimg, 7) - * - * PyMem_Free(outshape) # <<<<<<<<<<<<<< - * - * return out - */ - PyMem_Free(__pyx_v_outshape); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2063 - * PyMem_Free(outshape) - * - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_4); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvPyrUp"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2094 - * Intrinsics is the 3x3 camera instrinsics matrix. - * Distortion is the 5-vector of distortion coefficients.''') - * def cvCalibrateCamera2(np.ndarray object_points, np.ndarray image_points, # <<<<<<<<<<<<<< - * np.ndarray point_counts, image_size): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_object_points = 0; - PyArrayObject *__pyx_v_image_points = 0; - PyArrayObject *__pyx_v_point_counts = 0; - PyObject *__pyx_v_image_size = 0; - npy_intp __pyx_v_intrinsics_shape[2]; - PyArrayObject *__pyx_v_intrinsics = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_ipl_intrinsics; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmat_intrinsics; - npy_intp __pyx_v_distortion_shape[2]; - PyArrayObject *__pyx_v_distortion = 0; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_ipl_distortion; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmat_distortion; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_ipl_object_points; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_ipl_image_points; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_ipl_point_counts; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmat_object_points; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmat_image_points; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *__pyx_v_cvmat_point_counts; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize __pyx_v_cv_image_size; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_object_points,&__pyx_kp_image_points,&__pyx_kp_point_counts,&__pyx_kp_image_size,0}; - __Pyx_SetupRefcountContext("cvCalibrateCamera2"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_object_points); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_image_points); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvCalibrateCamera2", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_point_counts); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvCalibrateCamera2", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_image_size); - if (likely(values[3])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvCalibrateCamera2", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvCalibrateCamera2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_object_points = ((PyArrayObject *)values[0]); - __pyx_v_image_points = ((PyArrayObject *)values[1]); - __pyx_v_point_counts = ((PyArrayObject *)values[2]); - __pyx_v_image_size = values[3]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_object_points = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_image_points = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1)); - __pyx_v_point_counts = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2)); - __pyx_v_image_size = PyTuple_GET_ITEM(__pyx_args, 3); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvCalibrateCamera2", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCalibrateCamera2"); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_object_points), __pyx_ptype_5numpy_ndarray, 1, "object_points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_image_points), __pyx_ptype_5numpy_ndarray, 1, "image_points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_point_counts), __pyx_ptype_5numpy_ndarray, 1, "point_counts", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2098 - * - * # Validate input - * validate_array(object_points) # <<<<<<<<<<<<<< - * assert_ndims(object_points, [2]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_object_points); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2099 - * # Validate input - * validate_array(object_points) - * assert_ndims(object_points, [2]) # <<<<<<<<<<<<<< - * - * validate_array(image_points) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_object_points, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2101 - * assert_ndims(object_points, [2]) - * - * validate_array(image_points) # <<<<<<<<<<<<<< - * assert_ndims(image_points, [2]) - * - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_image_points); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2102 - * - * validate_array(image_points) - * assert_ndims(image_points, [2]) # <<<<<<<<<<<<<< - * - * assert_dtype(point_counts, [INT32]) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_image_points, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2104 - * assert_ndims(image_points, [2]) - * - * assert_dtype(point_counts, [INT32]) # <<<<<<<<<<<<<< - * assert_ndims(point_counts, [1]) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_261); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_point_counts, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2105 - * - * assert_dtype(point_counts, [INT32]) - * assert_ndims(point_counts, [1]) # <<<<<<<<<<<<<< - * - * # Allocate a new intrinsics array - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_point_counts, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2109 - * # Allocate a new intrinsics array - * cdef np.npy_intp intrinsics_shape[2] - * intrinsics_shape[0] = 3 # <<<<<<<<<<<<<< - * intrinsics_shape[1] = 3 - * cdef np.ndarray intrinsics = new_array(2, intrinsics_shape, FLOAT64) - */ - (__pyx_v_intrinsics_shape[0]) = ((npy_intp)3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2110 - * cdef np.npy_intp intrinsics_shape[2] - * intrinsics_shape[0] = 3 - * intrinsics_shape[1] = 3 # <<<<<<<<<<<<<< - * cdef np.ndarray intrinsics = new_array(2, intrinsics_shape, FLOAT64) - * cdef IplImage ipl_intrinsics - */ - (__pyx_v_intrinsics_shape[1]) = ((npy_intp)3); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2111 - * intrinsics_shape[0] = 3 - * intrinsics_shape[1] = 3 - * cdef np.ndarray intrinsics = new_array(2, intrinsics_shape, FLOAT64) # <<<<<<<<<<<<<< - * cdef IplImage ipl_intrinsics - * populate_iplimage(intrinsics, &ipl_intrinsics) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_intrinsics_shape, __pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_intrinsics = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2113 - * cdef np.ndarray intrinsics = new_array(2, intrinsics_shape, FLOAT64) - * cdef IplImage ipl_intrinsics - * populate_iplimage(intrinsics, &ipl_intrinsics) # <<<<<<<<<<<<<< - * cdef CvMat* cvmat_intrinsics = cvmat_ptr_from_iplimage(&ipl_intrinsics) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_intrinsics, (&__pyx_v_ipl_intrinsics)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2114 - * cdef IplImage ipl_intrinsics - * populate_iplimage(intrinsics, &ipl_intrinsics) - * cdef CvMat* cvmat_intrinsics = cvmat_ptr_from_iplimage(&ipl_intrinsics) # <<<<<<<<<<<<<< - * - * # Allocate a new distortion array - */ - __pyx_v_cvmat_intrinsics = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_ipl_intrinsics)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2118 - * # Allocate a new distortion array - * cdef np.npy_intp distortion_shape[2] - * distortion_shape[0] = 1 # <<<<<<<<<<<<<< - * distortion_shape[1] = 5 - * cdef np.ndarray distortion = new_array(2, distortion_shape, FLOAT64) - */ - (__pyx_v_distortion_shape[0]) = ((npy_intp)1); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2119 - * cdef np.npy_intp distortion_shape[2] - * distortion_shape[0] = 1 - * distortion_shape[1] = 5 # <<<<<<<<<<<<<< - * cdef np.ndarray distortion = new_array(2, distortion_shape, FLOAT64) - * cdef IplImage ipl_distortion - */ - (__pyx_v_distortion_shape[1]) = ((npy_intp)5); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2120 - * distortion_shape[0] = 1 - * distortion_shape[1] = 5 - * cdef np.ndarray distortion = new_array(2, distortion_shape, FLOAT64) # <<<<<<<<<<<<<< - * cdef IplImage ipl_distortion - * populate_iplimage(distortion, &ipl_distortion) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_260); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_distortion_shape, __pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_distortion = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2122 - * cdef np.ndarray distortion = new_array(2, distortion_shape, FLOAT64) - * cdef IplImage ipl_distortion - * populate_iplimage(distortion, &ipl_distortion) # <<<<<<<<<<<<<< - * cdef CvMat* cvmat_distortion = cvmat_ptr_from_iplimage(&ipl_distortion) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_distortion, (&__pyx_v_ipl_distortion)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2123 - * cdef IplImage ipl_distortion - * populate_iplimage(distortion, &ipl_distortion) - * cdef CvMat* cvmat_distortion = cvmat_ptr_from_iplimage(&ipl_distortion) # <<<<<<<<<<<<<< - * - * # Make the object & image points & npoints accessible for OpenCV - */ - __pyx_v_cvmat_distortion = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_ipl_distortion)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2128 - * cdef IplImage ipl_object_points, ipl_image_points, ipl_point_counts - * cdef CvMat* cvmat_object_points, *cvmat_image_points, *cvmat_point_counts - * populate_iplimage(object_points, &ipl_object_points) # <<<<<<<<<<<<<< - * populate_iplimage(image_points, &ipl_image_points) - * populate_iplimage(point_counts, &ipl_point_counts) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_object_points, (&__pyx_v_ipl_object_points)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2129 - * cdef CvMat* cvmat_object_points, *cvmat_image_points, *cvmat_point_counts - * populate_iplimage(object_points, &ipl_object_points) - * populate_iplimage(image_points, &ipl_image_points) # <<<<<<<<<<<<<< - * populate_iplimage(point_counts, &ipl_point_counts) - * - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_image_points, (&__pyx_v_ipl_image_points)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2130 - * populate_iplimage(object_points, &ipl_object_points) - * populate_iplimage(image_points, &ipl_image_points) - * populate_iplimage(point_counts, &ipl_point_counts) # <<<<<<<<<<<<<< - * - * cvmat_object_points = cvmat_ptr_from_iplimage(&ipl_object_points) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_point_counts, (&__pyx_v_ipl_point_counts)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2132 - * populate_iplimage(point_counts, &ipl_point_counts) - * - * cvmat_object_points = cvmat_ptr_from_iplimage(&ipl_object_points) # <<<<<<<<<<<<<< - * cvmat_image_points = cvmat_ptr_from_iplimage(&ipl_image_points) - * cvmat_point_counts = cvmat_ptr_from_iplimage(&ipl_point_counts) - */ - __pyx_v_cvmat_object_points = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_ipl_object_points)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2133 - * - * cvmat_object_points = cvmat_ptr_from_iplimage(&ipl_object_points) - * cvmat_image_points = cvmat_ptr_from_iplimage(&ipl_image_points) # <<<<<<<<<<<<<< - * cvmat_point_counts = cvmat_ptr_from_iplimage(&ipl_point_counts) - * - */ - __pyx_v_cvmat_image_points = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_ipl_image_points)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2134 - * cvmat_object_points = cvmat_ptr_from_iplimage(&ipl_object_points) - * cvmat_image_points = cvmat_ptr_from_iplimage(&ipl_image_points) - * cvmat_point_counts = cvmat_ptr_from_iplimage(&ipl_point_counts) # <<<<<<<<<<<<<< - * - * # Set image size - */ - __pyx_v_cvmat_point_counts = __pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage((&__pyx_v_ipl_point_counts)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2138 - * # Set image size - * cdef CvSize cv_image_size - * cv_image_size.height = image_size[0] # <<<<<<<<<<<<<< - * cv_image_size.width = image_size[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_image_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_image_size.height = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2139 - * cdef CvSize cv_image_size - * cv_image_size.height = image_size[0] - * cv_image_size.width = image_size[1] # <<<<<<<<<<<<<< - * - * # Call the function - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_image_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cv_image_size.width = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2144 - * c_cvCalibrateCamera2(cvmat_object_points, cvmat_image_points, - * cvmat_point_counts, cv_image_size, cvmat_intrinsics, - * cvmat_distortion, NULL, NULL, 0) # <<<<<<<<<<<<<< - * - * # Convert distortion back into a vector - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCalibrateCamera2(__pyx_v_cvmat_object_points, __pyx_v_cvmat_image_points, __pyx_v_cvmat_point_counts, __pyx_v_cv_image_size, __pyx_v_cvmat_intrinsics, __pyx_v_cvmat_distortion, NULL, NULL, 0); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2147 - * - * # Convert distortion back into a vector - * distortion = np.PyArray_Squeeze(distortion) # <<<<<<<<<<<<<< - * - * PyMem_Free(cvmat_intrinsics) - */ - __pyx_t_2 = PyArray_Squeeze(__pyx_v_distortion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_distortion)); - __pyx_v_distortion = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2149 - * distortion = np.PyArray_Squeeze(distortion) - * - * PyMem_Free(cvmat_intrinsics) # <<<<<<<<<<<<<< - * PyMem_Free(cvmat_distortion) - * PyMem_Free(cvmat_object_points) - */ - PyMem_Free(__pyx_v_cvmat_intrinsics); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2150 - * - * PyMem_Free(cvmat_intrinsics) - * PyMem_Free(cvmat_distortion) # <<<<<<<<<<<<<< - * PyMem_Free(cvmat_object_points) - * PyMem_Free(cvmat_image_points) - */ - PyMem_Free(__pyx_v_cvmat_distortion); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2151 - * PyMem_Free(cvmat_intrinsics) - * PyMem_Free(cvmat_distortion) - * PyMem_Free(cvmat_object_points) # <<<<<<<<<<<<<< - * PyMem_Free(cvmat_image_points) - * PyMem_Free(cvmat_point_counts) - */ - PyMem_Free(__pyx_v_cvmat_object_points); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2152 - * PyMem_Free(cvmat_distortion) - * PyMem_Free(cvmat_object_points) - * PyMem_Free(cvmat_image_points) # <<<<<<<<<<<<<< - * PyMem_Free(cvmat_point_counts) - * - */ - PyMem_Free(__pyx_v_cvmat_image_points); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2153 - * PyMem_Free(cvmat_object_points) - * PyMem_Free(cvmat_image_points) - * PyMem_Free(cvmat_point_counts) # <<<<<<<<<<<<<< - * - * return intrinsics, distortion - */ - PyMem_Free(__pyx_v_cvmat_point_counts); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2155 - * PyMem_Free(cvmat_point_counts) - * - * return intrinsics, distortion # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_v_intrinsics)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_intrinsics)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_intrinsics)); - __Pyx_INCREF(((PyObject *)__pyx_v_distortion)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_distortion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_distortion)); - __pyx_r = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvCalibrateCamera2"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_intrinsics); - __Pyx_XDECREF((PyObject *)__pyx_v_distortion); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2189 - * out : ndarray Nx2 - * An nx2 array of the corners found.''') - * def cvFindChessboardCorners(np.ndarray src, pattern_size, # <<<<<<<<<<<<<< - * int flag=CV_CALIB_CB_ADAPTIVE_THRESH): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCorners(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCorners(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_pattern_size = 0; - int __pyx_v_flag; - npy_intp __pyx_v_outshape[2]; - PyArrayObject *__pyx_v_out; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_v_cvpoints; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize __pyx_v_cvpattern_size; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_srcimg; - int __pyx_v_ncorners_found; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - npy_intp __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_pattern_size,&__pyx_kp_flag,0}; - __Pyx_SetupRefcountContext("cvFindChessboardCorners"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_pattern_size); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvFindChessboardCorners", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flag); - if (unlikely(value)) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvFindChessboardCorners") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_pattern_size = values[1]; - if (values[2]) { - __pyx_v_flag = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_flag = __pyx_k_225; - } - } else { - __pyx_v_flag = __pyx_k_225; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: - __pyx_v_flag = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 2: - __pyx_v_pattern_size = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvFindChessboardCorners", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFindChessboardCorners"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2192 - * int flag=CV_CALIB_CB_ADAPTIVE_THRESH): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * assert_nchannels(src, [1, 3]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2194 - * validate_array(src) - * - * assert_nchannels(src, [1, 3]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2195 - * - * assert_nchannels(src, [1, 3]) - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * - * cdef np.npy_intp outshape[2] - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2198 - * - * cdef np.npy_intp outshape[2] - * outshape[0] = pattern_size[0] * pattern_size[1] # <<<<<<<<<<<<<< - * outshape[1] = 2 - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = __Pyx_PyInt_from_py_npy_intp(__pyx_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = __Pyx_PyInt_to_py_npy_intp(((npy_intp)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = __Pyx_PyInt_from_py_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - (__pyx_v_outshape[0]) = __pyx_t_3; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2199 - * cdef np.npy_intp outshape[2] - * outshape[0] = pattern_size[0] * pattern_size[1] - * outshape[1] = 2 # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - (__pyx_v_outshape[1]) = ((npy_intp)2); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2202 - * - * cdef np.ndarray out - * out = new_array(2, outshape, FLOAT32) # <<<<<<<<<<<<<< - * cdef CvPoint2D32f* cvpoints = array_as_cvPoint2D32f_ptr(out) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = ((PyObject *)__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array(2, __pyx_v_outshape, __pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2203 - * cdef np.ndarray out - * out = new_array(2, outshape, FLOAT32) - * cdef CvPoint2D32f* cvpoints = array_as_cvPoint2D32f_ptr(out) # <<<<<<<<<<<<<< - * - * cdef CvSize cvpattern_size - */ - __pyx_v_cvpoints = __pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(__pyx_v_out); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2206 - * - * cdef CvSize cvpattern_size - * cvpattern_size.height = pattern_size[0] # <<<<<<<<<<<<<< - * cvpattern_size.width = pattern_size[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvpattern_size.height = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2207 - * cdef CvSize cvpattern_size - * cvpattern_size.height = pattern_size[0] - * cvpattern_size.width = pattern_size[1] # <<<<<<<<<<<<<< - * - * cdef IplImage srcimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvpattern_size.width = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2210 - * - * cdef IplImage srcimg - * populate_iplimage(src, &srcimg) # <<<<<<<<<<<<<< - * - * cdef int ncorners_found - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_src, (&__pyx_v_srcimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2214 - * cdef int ncorners_found - * c_cvFindChessboardCorners(&srcimg, cvpattern_size, cvpoints, - * &ncorners_found, flag) # <<<<<<<<<<<<<< - * - * return out[:ncorners_found] - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindChessboardCorners((&__pyx_v_srcimg), __pyx_v_cvpattern_size, __pyx_v_cvpoints, (&__pyx_v_ncorners_found), __pyx_v_flag); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2216 - * &ncorners_found, flag) - * - * return out[:ncorners_found] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_1 = PySequence_GetSlice(((PyObject *)__pyx_v_out), 0, __pyx_v_ncorners_found); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvFindChessboardCorners"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2247 - * Otherwise, the function returns a new image with - * the corners drawn into it.''') - * def cvDrawChessboardCorners(np.ndarray src, pattern_size, np.ndarray corners, # <<<<<<<<<<<<<< - * in_place=False): - * - */ - -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCorners(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCorners(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_src = 0; - PyObject *__pyx_v_pattern_size = 0; - PyArrayObject *__pyx_v_corners = 0; - PyObject *__pyx_v_in_place = 0; - PyArrayObject *__pyx_v_out; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvSize __pyx_v_cvpattern_size; - __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage __pyx_v_outimg; - struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *__pyx_v_cvcorners; - int __pyx_v_ncount; - int __pyx_v_pattern_was_found; - PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_src,&__pyx_kp_pattern_size,&__pyx_kp_corners,&__pyx_kp_in_place,0}; - __Pyx_SetupRefcountContext("cvDrawChessboardCorners"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - values[3] = __pyx_k_229; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_src); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_pattern_size); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvDrawChessboardCorners", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_corners); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cvDrawChessboardCorners", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_in_place); - if (unlikely(value)) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "cvDrawChessboardCorners") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_src = ((PyArrayObject *)values[0]); - __pyx_v_pattern_size = values[1]; - __pyx_v_corners = ((PyArrayObject *)values[2]); - __pyx_v_in_place = values[3]; - } else { - __pyx_v_in_place = __pyx_k_229; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: - __pyx_v_in_place = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: - __pyx_v_corners = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2)); - __pyx_v_pattern_size = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_src = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cvDrawChessboardCorners", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvDrawChessboardCorners"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_5numpy_ndarray, 1, "src", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2250 - * in_place=False): - * - * validate_array(src) # <<<<<<<<<<<<<< - * - * assert_nchannels(src, [3]) - */ - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2252 - * validate_array(src) - * - * assert_nchannels(src, [3]) # <<<<<<<<<<<<<< - * assert_dtype(src, [UINT8]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2253 - * - * assert_nchannels(src, [3]) - * assert_dtype(src, [UINT8]) # <<<<<<<<<<<<<< - * - * assert_ndims(corners, [2]) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_src, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2255 - * assert_dtype(src, [UINT8]) - * - * assert_ndims(corners, [2]) # <<<<<<<<<<<<<< - * assert_dtype(corners, [FLOAT32]) - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims(__pyx_v_corners, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2256 - * - * assert_ndims(corners, [2]) - * assert_dtype(corners, [FLOAT32]) # <<<<<<<<<<<<<< - * - * cdef np.ndarray out - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = __pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype(__pyx_v_corners, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2260 - * cdef np.ndarray out - * - * if not in_place: # <<<<<<<<<<<<<< - * out = src.copy() - * else: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2261 - * - * if not in_place: - * out = src.copy() # <<<<<<<<<<<<<< - * else: - * out = src - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_src), __pyx_kp_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L6; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2263 - * out = src.copy() - * else: - * out = src # <<<<<<<<<<<<<< - * - * cdef CvSize cvpattern_size - */ - __Pyx_INCREF(((PyObject *)__pyx_v_src)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_v_src; - } - __pyx_L6:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2266 - * - * cdef CvSize cvpattern_size - * cvpattern_size.height = pattern_size[0] # <<<<<<<<<<<<<< - * cvpattern_size.width = pattern_size[1] - * - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvpattern_size.height = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2267 - * cdef CvSize cvpattern_size - * cvpattern_size.height = pattern_size[0] - * cvpattern_size.width = pattern_size[1] # <<<<<<<<<<<<<< - * - * cdef IplImage outimg - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cvpattern_size.width = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2270 - * - * cdef IplImage outimg - * populate_iplimage(out, &outimg) # <<<<<<<<<<<<<< - * - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) - */ - __pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage(__pyx_v_out, (&__pyx_v_outimg)); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2272 - * populate_iplimage(out, &outimg) - * - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) # <<<<<<<<<<<<<< - * - * cdef int ncount = pattern_size[0] * pattern_size[1] - */ - __pyx_v_cvcorners = __pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr(__pyx_v_corners); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2274 - * cdef CvPoint2D32f* cvcorners = array_as_cvPoint2D32f_ptr(corners) - * - * cdef int ncount = pattern_size[0] * pattern_size[1] # <<<<<<<<<<<<<< - * - * cdef int pattern_was_found - */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_pattern_size, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetItemInt(__pyx_v_pattern_size, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_5 = PyNumber_Multiply(__pyx_1, __pyx_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_ncount = __pyx_t_1; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2278 - * cdef int pattern_was_found - * - * if corners.shape[0] == ncount: # <<<<<<<<<<<<<< - * pattern_was_found = 1 - * else: - */ - __pyx_t_4 = ((__pyx_v_corners->dimensions[0]) == __pyx_v_ncount); - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2279 - * - * if corners.shape[0] == ncount: - * pattern_was_found = 1 # <<<<<<<<<<<<<< - * else: - * pattern_was_found = 0 - */ - __pyx_v_pattern_was_found = 1; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2281 - * pattern_was_found = 1 - * else: - * pattern_was_found = 0 # <<<<<<<<<<<<<< - * - * c_cvDrawChessboardCorners(&outimg, cvpattern_size, cvcorners, - */ - __pyx_v_pattern_was_found = 0; - } - __pyx_L7:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2284 - * - * c_cvDrawChessboardCorners(&outimg, cvpattern_size, cvcorners, - * ncount, pattern_was_found) # <<<<<<<<<<<<<< - * - * if in_place: - */ - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDrawChessboardCorners((&__pyx_v_outimg), __pyx_v_cvpattern_size, __pyx_v_cvcorners, __pyx_v_ncount, __pyx_v_pattern_was_found); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2286 - * ncount, pattern_was_found) - * - * if in_place: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_in_place); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2287 - * - * if in_place: - * return None # <<<<<<<<<<<<<< - * else: - * return out - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L8; - } - /*else*/ { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2289 - * return None - * else: - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); - goto __pyx_L0; - } - __pyx_L8:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv.cvDrawChessboardCorners"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":152 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - char *__pyx_t_7; - __Pyx_SetupRefcountContext("__getbuffer__"); - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":158 - * # of flags - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":159 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":161 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":163 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":164 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":166 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":168 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") - */ - if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":169 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not C contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":170 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_1); - __Pyx_GIVEREF(__pyx_kp_1); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":172 - * raise ValueError("ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") - */ - if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":173 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not Fortran contiguous") - * - */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":174 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_2); - __Pyx_GIVEREF(__pyx_kp_2); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":176 - * raise ValueError("ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":177 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":178 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - __pyx_t_4 = __pyx_v_copy_shape; - if (__pyx_t_4) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":181 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":182 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":183 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_v_ndim; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":184 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":185 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":187 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":189 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":190 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":191 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * cdef int offset - */ - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":201 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - if ((!__pyx_v_hasfields)) { - __pyx_t_1 = (!__pyx_v_copy_shape); - } else { - __pyx_t_1 = (!__pyx_v_hasfields); - } - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":203 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - */ - if ((__pyx_v_descr->byteorder == '>')) { - __pyx_t_1 = __pyx_v_little_endian; - } else { - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - } - if (!__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":211 - * t = descr.type_num - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - if ((__pyx_v_descr->byteorder == '<')) { - __pyx_t_5 = (!__pyx_v_little_endian); - } else { - __pyx_t_5 = (__pyx_v_descr->byteorder == '<'); - } - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_1; - } - if (__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 - * if ((descr.byteorder == '>' and little_endian) or - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_5); - __Pyx_GIVEREF(__pyx_kp_5); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 - * (descr.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - __pyx_t_6 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_6; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 - * raise ValueError("Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_t_6 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_7; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":215 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_t_6 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_8; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":216 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_t_6 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_9; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_t_6 = (__pyx_v_t == NPY_INT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_10; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_t_6 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_11; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_12; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_t_6 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_13; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_14; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":222 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_t_6 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_15; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_t_6 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_16; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_t_6 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_17; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_t_6 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_18; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_t_6 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_19; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_t_6 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_20; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":228 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_t_6 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_21; - goto __pyx_L14; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":229 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_6 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_6) { - __pyx_v_f = __pyx_k_22; - goto __pyx_L14; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_23, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L14:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":232 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":233 - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":236 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = '^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":240 - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - * &offset) # <<<<<<<<<<<<<< - * f[0] = 0 # Terminate format string - * - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_7; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":241 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = 0; - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":243 - * f[0] = 0 # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; - __Pyx_SetupRefcountContext("__releasebuffer__"); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - - __Pyx_FinishRefcountContext(); -} - -/* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":690 - * ctypedef npy_cdouble complex_t - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields; - PyObject *__pyx_v_childname; - PyObject *__pyx_v_new_offset; - PyObject *__pyx_v_t; - char *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - char *__pyx_t_9; - __Pyx_SetupRefcountContext("_util_dtypestring"); - __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":697 - * cdef int delta_offset - * cdef tuple i - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":698 - * cdef tuple i - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":701 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - for (;;) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - __Pyx_DECREF(__pyx_v_childname); - __pyx_v_childname = __pyx_t_3; - __pyx_t_3 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":702 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - __pyx_1 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (!(likely(PyTuple_CheckExact(__pyx_1)) || (__pyx_1) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_1)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_1); - __pyx_1 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":703 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { - PyObject* tuple = ((PyObject *)__pyx_v_fields); - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((PyArray_Descr *)__pyx_2); - __pyx_2 = 0; - __Pyx_DECREF(__pyx_v_new_offset); - __pyx_v_new_offset = __pyx_3; - __pyx_3 = 0; - } else { - __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":705 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_3 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":706 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == '>' and little_endian) or - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_25); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_25); - __Pyx_GIVEREF(__pyx_kp_25); - __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":708 - * raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") - */ - if ((__pyx_v_child->byteorder == '>')) { - __pyx_t_6 = __pyx_v_little_endian; - } else { - __pyx_t_6 = (__pyx_v_child->byteorder == '>'); - } - if (!__pyx_t_6) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":709 - * - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError("Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - if ((__pyx_v_child->byteorder == '<')) { - __pyx_t_7 = (!__pyx_v_little_endian); - } else { - __pyx_t_7 = (__pyx_v_child->byteorder == '<'); - } - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_6; - } - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":710 - * if ((child.byteorder == '>' and little_endian) or - * (child.byteorder == '<' and not little_endian)): - * raise ValueError("Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_28); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_28); - __Pyx_GIVEREF(__pyx_kp_28); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":720 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_8) break; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":721 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 120; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":722 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f += 1; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":723 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - (__pyx_v_offset[0]) += 1; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":725 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":727 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_8 = (!PyDataType_HASFIELDS(__pyx_v_child)); - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":728 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError("Format string allocated too short.") - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_t); - __pyx_v_t = __pyx_t_4; - __pyx_t_4 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":729 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short.") - * - */ - __pyx_t_8 = ((__pyx_v_end - __pyx_v_f) < 5); - if (__pyx_t_8) { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":730 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_29); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_29); - __Pyx_GIVEREF(__pyx_kp_29); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":733 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 98; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":734 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_4 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 66; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":735 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 104; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":736 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_4 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 72; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":737 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 105; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":738 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_4 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 73; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":739 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 108; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":740 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_4 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 76; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":741 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 113; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":742 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_4 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 81; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":743 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 102; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":744 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_4 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 100; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":745 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 103; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":746 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_4 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":747 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":748 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_4 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - goto __pyx_L11; - } - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":749 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - (__pyx_v_f[0]) = 79; - goto __pyx_L11; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":751 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - __pyx_t_4 = PyNumber_Remainder(__pyx_kp_30, __pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L11:; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":752 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f += 1; - goto __pyx_L9; - } - /*else*/ { - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_9; - } - __pyx_L9:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("numpy._util_dtypestring"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_fields); - __Pyx_DECREF(__pyx_v_childname); - __Pyx_DECREF(__pyx_v_new_offset); - __Pyx_DECREF(__pyx_v_t); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -static struct PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("cvSobel"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSobel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvLaplace"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLaplace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCanny"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCanny, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvPreCornerDetect"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPreCornerDetect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCornerEigenValsAndVecs"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecs, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCornerMinEigenVal"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenVal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCornerHarris"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCornerHarris, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvFindCornerSubPix"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvGoodFeaturesToTrack"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvGetRectSubPix"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvGetQuadrangleSubPix"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvResize"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvResize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvWarpAffine"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpAffine, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvWarpPerspective"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspective, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvLogPolar"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvLogPolar, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvErode"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvErode, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvDilate"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDilate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvMorphologyEx"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvMorphologyEx, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvSmooth"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvSmooth, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvFilter2D"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFilter2D, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvIntegral"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvIntegral, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCvtColor"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCvtColor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvThreshold"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvThreshold, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvAdaptiveThreshold"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThreshold, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvPyrDown"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrDown, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvPyrUp"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvPyrUp, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvCalibrateCamera2"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvFindChessboardCorners"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCorners, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("cvDrawChessboardCorners"), (PyCFunction)__pyx_pf_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCorners, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -char* __pyx_import_star_type_names[] = { - "cvErodePtr", - "IplImage", - "cvFindCornerSubPixPtr", - "va_list", - "cvCornerEigenValsAndVecsPtr", - "_IplConvKernel", - "cvCannyPtr", - "cvResizePtr", - "cvPyrDownPtr", - "cvCvtColorPtr", - "INT8_t", - "cvIntegralPtr", - "cvAdaptiveThresholdPtr", - "Py_complex", - "_IplImage", - "cvGetRectSubPixPtr", - "cvThresholdPtr", - "FILE", - "cvFilter2DPtr", - "cvGoodFeaturesToTrackPtr", - "cvCalibrateCamera2Ptr", - "cvPyrUpPtr", - "_inittab", - "UINT8_t", - "cvWarpAffinePtr", - "cvCornerHarrisPtr", - "cvDilatePtr", - "CvScalar", - "cvSobelPtr", - "INT16_t", - "FLOAT64_t", - "CvMat_uProxy", - "FLOAT32_t", - "IplConvKernel", - "INT32_t", - "PyTypeObject", - "cvLogPolarPtr", - "CvTermCriteria", - "CvMat", - "PyObject", - "cvMorphologyExPtr", - "cvLaplacePtr", - "cvFindChessboardCornersPtr", - "cvCornerMinEigenValPtr", - "cvDrawChessboardCornersPtr", - "cvWarpPerspectivePtr", - "cvGetQuadrangleSubPixPtr", - "CvPoint2D32f", - "CvSize", - "cvPreCorneDetectPtr", - "PY_LONG_LONG", - "CvPoint", - "cvSmoothPtr", - "Py_UNICODE", - 0 -}; - -static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { - char** type_name = __pyx_import_star_type_names; - while (*type_name) { - if (__Pyx_StrEq(name, *type_name)) { - PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name); - goto bad; - } - type_name++; - } - if (0); - else if (__Pyx_StrEq(name, "c_cvSmooth")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvSmooth to scikits.image.opencv.opencv_cv.cvSmoothPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCanny")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCanny to scikits.image.opencv.opencv_cv.cvCannyPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCvtColor")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCvtColor to scikits.image.opencv.opencv_cv.cvCvtColorPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCornerMinEigenVal")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCornerMinEigenVal to scikits.image.opencv.opencv_cv.cvCornerMinEigenValPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvErode")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvErode to scikits.image.opencv.opencv_cv.cvErodePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvFilter2D")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvFilter2D to scikits.image.opencv.opencv_cv.cvFilter2DPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvFindChessboardCorners")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvFindChessboardCorners to scikits.image.opencv.opencv_cv.cvFindChessboardCornersPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvGetRectSubPix")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvGetRectSubPix to scikits.image.opencv.opencv_cv.cvGetRectSubPixPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvResize")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvResize to scikits.image.opencv.opencv_cv.cvResizePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvGoodFeaturesToTrack")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvGoodFeaturesToTrack to scikits.image.opencv.opencv_cv.cvGoodFeaturesToTrackPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCornerEigenValsAndVecs")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCornerEigenValsAndVecs to scikits.image.opencv.opencv_cv.cvCornerEigenValsAndVecsPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvPreCornerDetect")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvPreCornerDetect to scikits.image.opencv.opencv_cv.cvPreCorneDetectPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvPyrDown")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvPyrDown to scikits.image.opencv.opencv_cv.cvPyrDownPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvGetQuadrangleSubPix")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvGetQuadrangleSubPix to scikits.image.opencv.opencv_cv.cvGetQuadrangleSubPixPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvLogPolar")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvLogPolar to scikits.image.opencv.opencv_cv.cvLogPolarPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvThreshold")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvThreshold to scikits.image.opencv.opencv_cv.cvThresholdPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvLaplace")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvLaplace to scikits.image.opencv.opencv_cv.cvLaplacePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvMorphologyEx")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvMorphologyEx to scikits.image.opencv.opencv_cv.cvMorphologyExPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCornerHarris")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCornerHarris to scikits.image.opencv.opencv_cv.cvCornerHarrisPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvWarpAffine")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvWarpAffine to scikits.image.opencv.opencv_cv.cvWarpAffinePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvCalibrateCamera2")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvCalibrateCamera2 to scikits.image.opencv.opencv_cv.cvCalibrateCamera2Ptr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvSobel")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvSobel to scikits.image.opencv.opencv_cv.cvSobelPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvPyrUp")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvPyrUp to scikits.image.opencv.opencv_cv.cvPyrUpPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvDrawChessboardCorners")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvDrawChessboardCorners to scikits.image.opencv.opencv_cv.cvDrawChessboardCornersPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvDilate")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvDilate to scikits.image.opencv.opencv_cv.cvDilatePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvWarpPerspective")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvWarpPerspective to scikits.image.opencv.opencv_cv.cvWarpPerspectivePtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvFindCornerSubPix")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvFindCornerSubPix to scikits.image.opencv.opencv_cv.cvFindCornerSubPixPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvIntegral")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvIntegral to scikits.image.opencv.opencv_cv.cvIntegralPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else if (__Pyx_StrEq(name, "c_cvAdaptiveThreshold")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object c_cvAdaptiveThreshold to scikits.image.opencv.opencv_cv.cvAdaptiveThresholdPtr"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } - else { - if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad; - } - return 0; - __pyx_L2_error:; - __Pyx_AddTraceback("scikits.image.opencv.opencv_cv"); - bad: - Py_DECREF(o); - return -1; -} - - -/* import_all_from is an unexposed function from ceval.c */ - -static int -__Pyx_import_all_from(PyObject *locals, PyObject *v) -{ - PyObject *all = __Pyx_GetAttrString(v, "__all__"); - PyObject *dict, *name, *value; - int skip_leading_underscores = 0; - int pos, err; - - if (all == NULL) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; /* Unexpected error */ - PyErr_Clear(); - dict = __Pyx_GetAttrString(v, "__dict__"); - if (dict == NULL) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; - PyErr_SetString(PyExc_ImportError, - "from-import-* object has no __dict__ and no __all__"); - return -1; - } - all = PyMapping_Keys(dict); - Py_DECREF(dict); - if (all == NULL) - return -1; - skip_leading_underscores = 1; - } - - for (pos = 0, err = 0; ; pos++) { - name = PySequence_GetItem(all, pos); - if (name == NULL) { - if (!PyErr_ExceptionMatches(PyExc_IndexError)) - err = -1; - else - PyErr_Clear(); - break; - } - if (skip_leading_underscores && -#if PY_MAJOR_VERSION < 3 - PyString_Check(name) && - PyString_AS_STRING(name)[0] == '_') -#else - PyUnicode_Check(name) && - PyUnicode_AS_UNICODE(name)[0] == '_') -#endif - { - Py_DECREF(name); - continue; - } - value = PyObject_GetAttr(v, name); - if (value == NULL) - err = -1; - else if (PyDict_CheckExact(locals)) - err = PyDict_SetItem(locals, name, value); - else - err = PyObject_SetItem(locals, name, value); - Py_DECREF(name); - Py_XDECREF(value); - if (err != 0) - break; - } - Py_DECREF(all); - return err; -} - - -static int __pyx_import_star(PyObject* m) { - - int i; - int ret = -1; - char* s; - PyObject *locals = 0; - PyObject *list = 0; - PyObject *name; - PyObject *item; - - locals = PyDict_New(); if (!locals) goto bad; - if (__Pyx_import_all_from(locals, m) < 0) goto bad; - list = PyDict_Items(locals); if (!list) goto bad; - - for(i=0; i= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("opencv_cv"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1}, - {&__pyx_kp_src, __pyx_k_src, sizeof(__pyx_k_src), 1, 1, 1}, - {&__pyx_kp_xorder, __pyx_k_xorder, sizeof(__pyx_k_xorder), 1, 1, 1}, - {&__pyx_kp_yorder, __pyx_k_yorder, sizeof(__pyx_k_yorder), 1, 1, 1}, - {&__pyx_kp_aperture_size, __pyx_k_aperture_size, sizeof(__pyx_k_aperture_size), 1, 1, 1}, - {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 1, 1, 1}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 1, 1, 1}, - {&__pyx_kp_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 1, 1, 1}, - {&__pyx_kp_k, __pyx_k_k, sizeof(__pyx_k_k), 1, 1, 1}, - {&__pyx_kp_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 1, 1, 1}, - {&__pyx_kp_win, __pyx_k_win, sizeof(__pyx_k_win), 1, 1, 1}, - {&__pyx_kp_zero_zone, __pyx_k_zero_zone, sizeof(__pyx_k_zero_zone), 1, 1, 1}, - {&__pyx_kp_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 1, 1, 1}, - {&__pyx_kp_epsilon, __pyx_k_epsilon, sizeof(__pyx_k_epsilon), 1, 1, 1}, - {&__pyx_kp_corner_count, __pyx_k_corner_count, sizeof(__pyx_k_corner_count), 1, 1, 1}, - {&__pyx_kp_quality_level, __pyx_k_quality_level, sizeof(__pyx_k_quality_level), 1, 1, 1}, - {&__pyx_kp_min_distance, __pyx_k_min_distance, sizeof(__pyx_k_min_distance), 1, 1, 1}, - {&__pyx_kp_use_harris, __pyx_k_use_harris, sizeof(__pyx_k_use_harris), 1, 1, 1}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, - {&__pyx_kp_center, __pyx_k_center, sizeof(__pyx_k_center), 1, 1, 1}, - {&__pyx_kp_warpmat, __pyx_k_warpmat, sizeof(__pyx_k_warpmat), 1, 1, 1}, - {&__pyx_kp_float_out, __pyx_k_float_out, sizeof(__pyx_k_float_out), 1, 1, 1}, - {&__pyx_kp_method, __pyx_k_method, sizeof(__pyx_k_method), 1, 1, 1}, - {&__pyx_kp_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 1, 1, 1}, - {&__pyx_kp_fillval, __pyx_k_fillval, sizeof(__pyx_k_fillval), 1, 1, 1}, - {&__pyx_kp_M, __pyx_k_M, sizeof(__pyx_k_M), 1, 1, 1}, - {&__pyx_kp_element, __pyx_k_element, sizeof(__pyx_k_element), 1, 1, 1}, - {&__pyx_kp_anchor, __pyx_k_anchor, sizeof(__pyx_k_anchor), 1, 1, 1}, - {&__pyx_kp_in_place, __pyx_k_in_place, sizeof(__pyx_k_in_place), 1, 1, 1}, - {&__pyx_kp_operation, __pyx_k_operation, sizeof(__pyx_k_operation), 1, 1, 1}, - {&__pyx_kp_smoothtype, __pyx_k_smoothtype, sizeof(__pyx_k_smoothtype), 1, 1, 1}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 1, 1, 1}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 1, 1, 1}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 1, 1, 1}, - {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 1, 1, 1}, - {&__pyx_kp_kernel, __pyx_k_kernel, sizeof(__pyx_k_kernel), 1, 1, 1}, - {&__pyx_kp_square_sum, __pyx_k_square_sum, sizeof(__pyx_k_square_sum), 1, 1, 1}, - {&__pyx_kp_tilted_sum, __pyx_k_tilted_sum, sizeof(__pyx_k_tilted_sum), 1, 1, 1}, - {&__pyx_kp_code, __pyx_k_code, sizeof(__pyx_k_code), 1, 1, 1}, - {&__pyx_kp_threshold, __pyx_k_threshold, sizeof(__pyx_k_threshold), 1, 1, 1}, - {&__pyx_kp_max_value, __pyx_k_max_value, sizeof(__pyx_k_max_value), 1, 1, 1}, - {&__pyx_kp_threshold_type, __pyx_k_threshold_type, sizeof(__pyx_k_threshold_type), 1, 1, 1}, - {&__pyx_kp_use_otsu, __pyx_k_use_otsu, sizeof(__pyx_k_use_otsu), 1, 1, 1}, - {&__pyx_kp_adaptive_method, __pyx_k_adaptive_method, sizeof(__pyx_k_adaptive_method), 1, 1, 1}, - {&__pyx_kp_object_points, __pyx_k_object_points, sizeof(__pyx_k_object_points), 1, 1, 1}, - {&__pyx_kp_image_points, __pyx_k_image_points, sizeof(__pyx_k_image_points), 1, 1, 1}, - {&__pyx_kp_point_counts, __pyx_k_point_counts, sizeof(__pyx_k_point_counts), 1, 1, 1}, - {&__pyx_kp_image_size, __pyx_k_image_size, sizeof(__pyx_k_image_size), 1, 1, 1}, - {&__pyx_kp_pattern_size, __pyx_k_pattern_size, sizeof(__pyx_k_pattern_size), 1, 1, 1}, - {&__pyx_kp_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp_opencv_backend, __pyx_k_opencv_backend, sizeof(__pyx_k_opencv_backend), 1, 1, 1}, - {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 1, 1, 1}, - {&__pyx_kp_opencv_constants, __pyx_k_opencv_constants, sizeof(__pyx_k_opencv_constants), 1, 1, 1}, - {&__pyx_kp_opencv_cv, __pyx_k_opencv_cv, sizeof(__pyx_k_opencv_cv), 1, 1, 1}, - {&__pyx_kp__libimport, __pyx_k__libimport, sizeof(__pyx_k__libimport), 1, 1, 1}, - {&__pyx_kp_cv, __pyx_k_cv, sizeof(__pyx_k_cv), 1, 1, 1}, - {&__pyx_kp__utilities, __pyx_k__utilities, sizeof(__pyx_k__utilities), 1, 1, 1}, - {&__pyx_kp_cvdoc, __pyx_k_cvdoc, sizeof(__pyx_k_cvdoc), 1, 1, 1}, - {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1}, - {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 1, 1, 1}, - {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 1, 1, 1}, - {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 1, 1, 1}, - {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 1, 1, 1}, - {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 1, 1, 1}, - {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 1, 1, 1}, - {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 1, 1, 1}, - {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 1, 1, 1}, - {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 1, 1, 1}, - {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 1, 1, 1}, - {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 1, 1, 1}, - {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 1, 1, 1}, - {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 1, 1, 1}, - {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 1, 1, 1}, - {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 1, 1, 1}, - {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 1, 1, 1}, - {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 1, 1, 1}, - {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 1, 1, 1}, - {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 1, 1, 1}, - {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 1, 1, 1}, - {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 1, 1, 1}, - {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 1, 1, 1}, - {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 1, 1, 1}, - {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 1, 1, 1}, - {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 1, 1, 1}, - {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 1, 1, 1}, - {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 1, 1, 1}, - {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 1, 1, 1}, - {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 1, 1, 1}, - {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 1, 1, 1}, - {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 1, 1, 1}, - {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 1, 1, 1}, - {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 1, 1, 1}, - {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 1, 1, 1}, - {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 1, 1, 1}, - {&__pyx_kp_74, __pyx_k_74, sizeof(__pyx_k_74), 1, 1, 1}, - {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 1, 1, 1}, - {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 1, 1, 1}, - {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 1, 1, 1}, - {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 1, 1, 1}, - {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 1, 1, 1}, - {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 1, 1, 1}, - {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 1, 1, 1}, - {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 1, 1, 1}, - {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 1, 1, 1}, - {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 1, 1, 1}, - {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 1, 1, 1}, - {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 1, 1, 1}, - {&__pyx_kp_87, __pyx_k_87, sizeof(__pyx_k_87), 1, 1, 1}, - {&__pyx_kp_88, __pyx_k_88, sizeof(__pyx_k_88), 1, 1, 1}, - {&__pyx_kp_89, __pyx_k_89, sizeof(__pyx_k_89), 1, 1, 1}, - {&__pyx_kp_90, __pyx_k_90, sizeof(__pyx_k_90), 1, 1, 1}, - {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 1, 1, 1}, - {&__pyx_kp_92, __pyx_k_92, sizeof(__pyx_k_92), 1, 1, 1}, - {&__pyx_kp_93, __pyx_k_93, sizeof(__pyx_k_93), 1, 1, 1}, - {&__pyx_kp_94, __pyx_k_94, sizeof(__pyx_k_94), 1, 1, 1}, - {&__pyx_kp_95, __pyx_k_95, sizeof(__pyx_k_95), 1, 1, 1}, - {&__pyx_kp_96, __pyx_k_96, sizeof(__pyx_k_96), 1, 1, 1}, - {&__pyx_kp_97, __pyx_k_97, sizeof(__pyx_k_97), 1, 1, 1}, - {&__pyx_kp_98, __pyx_k_98, sizeof(__pyx_k_98), 1, 1, 1}, - {&__pyx_kp_99, __pyx_k_99, sizeof(__pyx_k_99), 1, 1, 1}, - {&__pyx_kp_100, __pyx_k_100, sizeof(__pyx_k_100), 1, 1, 1}, - {&__pyx_kp_101, __pyx_k_101, sizeof(__pyx_k_101), 1, 1, 1}, - {&__pyx_kp_102, __pyx_k_102, sizeof(__pyx_k_102), 1, 1, 1}, - {&__pyx_kp_103, __pyx_k_103, sizeof(__pyx_k_103), 1, 1, 1}, - {&__pyx_kp_104, __pyx_k_104, sizeof(__pyx_k_104), 1, 1, 1}, - {&__pyx_kp_105, __pyx_k_105, sizeof(__pyx_k_105), 1, 1, 1}, - {&__pyx_kp_106, __pyx_k_106, sizeof(__pyx_k_106), 1, 1, 1}, - {&__pyx_kp_107, __pyx_k_107, sizeof(__pyx_k_107), 1, 1, 1}, - {&__pyx_kp_108, __pyx_k_108, sizeof(__pyx_k_108), 1, 1, 1}, - {&__pyx_kp_109, __pyx_k_109, sizeof(__pyx_k_109), 1, 1, 1}, - {&__pyx_kp_110, __pyx_k_110, sizeof(__pyx_k_110), 1, 1, 1}, - {&__pyx_kp_111, __pyx_k_111, sizeof(__pyx_k_111), 1, 1, 1}, - {&__pyx_kp_112, __pyx_k_112, sizeof(__pyx_k_112), 1, 1, 1}, - {&__pyx_kp_113, __pyx_k_113, sizeof(__pyx_k_113), 1, 1, 1}, - {&__pyx_kp__cvtcolor_dict, __pyx_k__cvtcolor_dict, sizeof(__pyx_k__cvtcolor_dict), 1, 1, 1}, - {&__pyx_kp_addressof, __pyx_k_addressof, sizeof(__pyx_k_addressof), 1, 1, 1}, - {&__pyx_kp_cvSobel, __pyx_k_cvSobel, sizeof(__pyx_k_cvSobel), 1, 1, 1}, - {&__pyx_kp_cvLaplace, __pyx_k_cvLaplace, sizeof(__pyx_k_cvLaplace), 1, 1, 1}, - {&__pyx_kp_cvCanny, __pyx_k_cvCanny, sizeof(__pyx_k_cvCanny), 1, 1, 1}, - {&__pyx_kp_cvPreCornerDetect, __pyx_k_cvPreCornerDetect, sizeof(__pyx_k_cvPreCornerDetect), 1, 1, 1}, - {&__pyx_kp_114, __pyx_k_114, sizeof(__pyx_k_114), 1, 1, 1}, - {&__pyx_kp_cvCornerMinEigenVal, __pyx_k_cvCornerMinEigenVal, sizeof(__pyx_k_cvCornerMinEigenVal), 1, 1, 1}, - {&__pyx_kp_cvCornerHarris, __pyx_k_cvCornerHarris, sizeof(__pyx_k_cvCornerHarris), 1, 1, 1}, - {&__pyx_kp_cvFindCornerSubPix, __pyx_k_cvFindCornerSubPix, sizeof(__pyx_k_cvFindCornerSubPix), 1, 1, 1}, - {&__pyx_kp_115, __pyx_k_115, sizeof(__pyx_k_115), 1, 1, 1}, - {&__pyx_kp_cvGetRectSubPix, __pyx_k_cvGetRectSubPix, sizeof(__pyx_k_cvGetRectSubPix), 1, 1, 1}, - {&__pyx_kp_116, __pyx_k_116, sizeof(__pyx_k_116), 1, 1, 1}, - {&__pyx_kp_cvResize, __pyx_k_cvResize, sizeof(__pyx_k_cvResize), 1, 1, 1}, - {&__pyx_kp_cvWarpAffine, __pyx_k_cvWarpAffine, sizeof(__pyx_k_cvWarpAffine), 1, 1, 1}, - {&__pyx_kp_cvWarpPerspective, __pyx_k_cvWarpPerspective, sizeof(__pyx_k_cvWarpPerspective), 1, 1, 1}, - {&__pyx_kp_cvLogPolar, __pyx_k_cvLogPolar, sizeof(__pyx_k_cvLogPolar), 1, 1, 1}, - {&__pyx_kp_cvErode, __pyx_k_cvErode, sizeof(__pyx_k_cvErode), 1, 1, 1}, - {&__pyx_kp_cvDilate, __pyx_k_cvDilate, sizeof(__pyx_k_cvDilate), 1, 1, 1}, - {&__pyx_kp_cvMorphologyEx, __pyx_k_cvMorphologyEx, sizeof(__pyx_k_cvMorphologyEx), 1, 1, 1}, - {&__pyx_kp_cvSmooth, __pyx_k_cvSmooth, sizeof(__pyx_k_cvSmooth), 1, 1, 1}, - {&__pyx_kp_117, __pyx_k_117, sizeof(__pyx_k_117), 1, 1, 1}, - {&__pyx_kp_cvIntegral, __pyx_k_cvIntegral, sizeof(__pyx_k_cvIntegral), 1, 1, 1}, - {&__pyx_kp_cvCvtColor, __pyx_k_cvCvtColor, sizeof(__pyx_k_cvCvtColor), 1, 1, 1}, - {&__pyx_kp_cvThreshold, __pyx_k_cvThreshold, sizeof(__pyx_k_cvThreshold), 1, 1, 1}, - {&__pyx_kp_cvAdaptiveThreshold, __pyx_k_cvAdaptiveThreshold, sizeof(__pyx_k_cvAdaptiveThreshold), 1, 1, 1}, - {&__pyx_kp_cvPyrDown, __pyx_k_cvPyrDown, sizeof(__pyx_k_cvPyrDown), 1, 1, 1}, - {&__pyx_kp_cvPyrUp, __pyx_k_cvPyrUp, sizeof(__pyx_k_cvPyrUp), 1, 1, 1}, - {&__pyx_kp_118, __pyx_k_118, sizeof(__pyx_k_118), 1, 1, 1}, - {&__pyx_kp_119, __pyx_k_119, sizeof(__pyx_k_119), 1, 1, 1}, - {&__pyx_kp_120, __pyx_k_120, sizeof(__pyx_k_120), 1, 1, 1}, - {&__pyx_kp_package, __pyx_k_package, sizeof(__pyx_k_package), 1, 1, 1}, - {&__pyx_kp_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 1, 0}, - {&__pyx_kp_group, __pyx_k_group, sizeof(__pyx_k_group), 1, 1, 1}, - {&__pyx_kp_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 1, 0}, - {&__pyx_kp_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 1, 1, 1}, - {&__pyx_kp_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 1, 0}, - {&__pyx_kp_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 1, 0}, - {&__pyx_kp_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 1, 0}, - {&__pyx_kp_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 1, 0}, - {&__pyx_kp_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 1, 0}, - {&__pyx_kp_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 1, 0}, - {&__pyx_kp_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 1, 0}, - {&__pyx_kp_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 1, 0}, - {&__pyx_kp_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 1, 0}, - {&__pyx_kp_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 1, 0}, - {&__pyx_kp_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 1, 0}, - {&__pyx_kp_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 1, 0}, - {&__pyx_kp_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 1, 0}, - {&__pyx_kp_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 1, 0}, - {&__pyx_kp_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 1, 0}, - {&__pyx_kp_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 1, 0}, - {&__pyx_kp_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 1, 0}, - {&__pyx_kp_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 1, 0}, - {&__pyx_kp_153, __pyx_k_153, sizeof(__pyx_k_153), 0, 1, 0}, - {&__pyx_kp_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 1, 0}, - {&__pyx_kp_CV_INTER_LINEAR, __pyx_k_CV_INTER_LINEAR, sizeof(__pyx_k_CV_INTER_LINEAR), 1, 1, 1}, - {&__pyx_kp_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 1, 0}, - {&__pyx_kp_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 1, 0}, - {&__pyx_kp_160, __pyx_k_160, sizeof(__pyx_k_160), 1, 1, 1}, - {&__pyx_kp_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 1, 0}, - {&__pyx_kp_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 1, 0}, - {&__pyx_kp_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 1, 0}, - {&__pyx_kp_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 1, 0}, - {&__pyx_kp_172, __pyx_k_172, sizeof(__pyx_k_172), 0, 1, 0}, - {&__pyx_kp_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 1, 0}, - {&__pyx_kp_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 1, 0}, - {&__pyx_kp_177, __pyx_k_177, sizeof(__pyx_k_177), 0, 1, 0}, - {&__pyx_kp_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 1, 0}, - {&__pyx_kp_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 1, 0}, - {&__pyx_kp_184, __pyx_k_184, sizeof(__pyx_k_184), 0, 1, 0}, - {&__pyx_kp_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 1, 0}, - {&__pyx_kp_CV_GAUSSIAN, __pyx_k_CV_GAUSSIAN, sizeof(__pyx_k_CV_GAUSSIAN), 1, 1, 1}, - {&__pyx_kp_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 1, 0}, - {&__pyx_kp_190, __pyx_k_190, sizeof(__pyx_k_190), 0, 1, 0}, - {&__pyx_kp_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 1, 0}, - {&__pyx_kp_194, __pyx_k_194, sizeof(__pyx_k_194), 0, 1, 0}, - {&__pyx_kp_198, __pyx_k_198, sizeof(__pyx_k_198), 0, 1, 0}, - {&__pyx_kp_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 1, 0}, - {&__pyx_kp_201, __pyx_k_201, sizeof(__pyx_k_201), 0, 1, 0}, - {&__pyx_kp_202, __pyx_k_202, sizeof(__pyx_k_202), 0, 1, 0}, - {&__pyx_kp_CV_THRESH_BINARY, __pyx_k_CV_THRESH_BINARY, sizeof(__pyx_k_CV_THRESH_BINARY), 1, 1, 1}, - {&__pyx_kp_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 1, 0}, - {&__pyx_kp_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 1, 0}, - {&__pyx_kp_209, __pyx_k_209, sizeof(__pyx_k_209), 1, 1, 1}, - {&__pyx_kp_212, __pyx_k_212, sizeof(__pyx_k_212), 0, 1, 0}, - {&__pyx_kp_213, __pyx_k_213, sizeof(__pyx_k_213), 0, 1, 0}, - {&__pyx_kp_215, __pyx_k_215, sizeof(__pyx_k_215), 0, 1, 0}, - {&__pyx_kp_216, __pyx_k_216, sizeof(__pyx_k_216), 0, 1, 0}, - {&__pyx_kp_218, __pyx_k_218, sizeof(__pyx_k_218), 0, 1, 0}, - {&__pyx_kp_219, __pyx_k_219, sizeof(__pyx_k_219), 0, 1, 0}, - {&__pyx_kp_221, __pyx_k_221, sizeof(__pyx_k_221), 0, 1, 0}, - {&__pyx_kp_222, __pyx_k_222, sizeof(__pyx_k_222), 0, 1, 0}, - {&__pyx_kp_224, __pyx_k_224, sizeof(__pyx_k_224), 1, 1, 1}, - {&__pyx_kp_226, __pyx_k_226, sizeof(__pyx_k_226), 0, 1, 0}, - {&__pyx_kp_227, __pyx_k_227, sizeof(__pyx_k_227), 0, 1, 0}, - {&__pyx_kp_230, __pyx_k_230, sizeof(__pyx_k_230), 0, 1, 0}, - {&__pyx_kp_231, __pyx_k_231, sizeof(__pyx_k_231), 0, 1, 0}, - {&__pyx_kp_233, __pyx_k_233, sizeof(__pyx_k_233), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1}, - {&__pyx_kp_235, __pyx_k_235, sizeof(__pyx_k_235), 1, 1, 1}, - {&__pyx_kp_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 1, 1, 1}, - {&__pyx_kp_CV_INTER_NN, __pyx_k_CV_INTER_NN, sizeof(__pyx_k_CV_INTER_NN), 1, 1, 1}, - {&__pyx_kp_CV_INTER_AREA, __pyx_k_CV_INTER_AREA, sizeof(__pyx_k_CV_INTER_AREA), 1, 1, 1}, - {&__pyx_kp_CV_INTER_CUBIC, __pyx_k_CV_INTER_CUBIC, sizeof(__pyx_k_CV_INTER_CUBIC), 1, 1, 1}, - {&__pyx_kp_range, __pyx_k_range, sizeof(__pyx_k_range), 1, 1, 1}, - {&__pyx_kp_CV_MOP_OPEN, __pyx_k_CV_MOP_OPEN, sizeof(__pyx_k_CV_MOP_OPEN), 1, 1, 1}, - {&__pyx_kp_CV_MOP_CLOSE, __pyx_k_CV_MOP_CLOSE, sizeof(__pyx_k_CV_MOP_CLOSE), 1, 1, 1}, - {&__pyx_kp_CV_MOP_GRADIENT, __pyx_k_CV_MOP_GRADIENT, sizeof(__pyx_k_CV_MOP_GRADIENT), 1, 1, 1}, - {&__pyx_kp_CV_MOP_TOPHAT, __pyx_k_CV_MOP_TOPHAT, sizeof(__pyx_k_CV_MOP_TOPHAT), 1, 1, 1}, - {&__pyx_kp_CV_MOP_BLACKHAT, __pyx_k_CV_MOP_BLACKHAT, sizeof(__pyx_k_CV_MOP_BLACKHAT), 1, 1, 1}, - {&__pyx_kp_CV_BLUR_NO_SCALE, __pyx_k_CV_BLUR_NO_SCALE, sizeof(__pyx_k_CV_BLUR_NO_SCALE), 1, 1, 1}, - {&__pyx_kp_CV_BLUR, __pyx_k_CV_BLUR, sizeof(__pyx_k_CV_BLUR), 1, 1, 1}, - {&__pyx_kp_260, __pyx_k_260, sizeof(__pyx_k_260), 1, 1, 1}, - {&__pyx_kp_261, __pyx_k_261, sizeof(__pyx_k_261), 1, 1, 1}, - {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, - {&__pyx_kp_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 1, 1, 1}, - {&__pyx_kp_263, __pyx_k_263, sizeof(__pyx_k_263), 1, 1, 1}, - {&__pyx_kp_265, __pyx_k_265, sizeof(__pyx_k_265), 1, 1, 1}, - {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1}, - {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 0}, - {&__pyx_kp_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 0}, - {&__pyx_kp_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 0}, - {&__pyx_kp_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 0}, - {&__pyx_kp_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 0}, - {&__pyx_kp_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 0}, - {&__pyx_kp_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 0}, - {&__pyx_kp_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 0}, - {&__pyx_kp_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 0}, - {&__pyx_kp_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 0}, - {&__pyx_kp_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 0}, - {&__pyx_kp_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 0}, - {&__pyx_kp_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 0}, - {&__pyx_kp_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 0}, - {&__pyx_kp_170, __pyx_k_170, sizeof(__pyx_k_170), 0, 0, 0}, - {&__pyx_kp_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 0}, - {&__pyx_kp_178, __pyx_k_178, sizeof(__pyx_k_178), 0, 0, 0}, - {&__pyx_kp_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 0, 0}, - {&__pyx_kp_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 0, 0}, - {&__pyx_kp_191, __pyx_k_191, sizeof(__pyx_k_191), 0, 0, 0}, - {&__pyx_kp_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 0, 0}, - {&__pyx_kp_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 0}, - {&__pyx_kp_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 0, 0}, - {&__pyx_kp_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 0, 0}, - {&__pyx_kp_214, __pyx_k_214, sizeof(__pyx_k_214), 0, 0, 0}, - {&__pyx_kp_217, __pyx_k_217, sizeof(__pyx_k_217), 0, 0, 0}, - {&__pyx_kp_220, __pyx_k_220, sizeof(__pyx_k_220), 0, 0, 0}, - {&__pyx_kp_223, __pyx_k_223, sizeof(__pyx_k_223), 0, 0, 0}, - {&__pyx_kp_228, __pyx_k_228, sizeof(__pyx_k_228), 0, 0, 0}, - {&__pyx_kp_232, __pyx_k_232, sizeof(__pyx_k_232), 0, 0, 0}, - {&__pyx_kp_234, __pyx_k_234, sizeof(__pyx_k_234), 0, 0, 0}, - {&__pyx_kp_236, __pyx_k_236, sizeof(__pyx_k_236), 0, 0, 0}, - {&__pyx_kp_237, __pyx_k_237, sizeof(__pyx_k_237), 0, 0, 0}, - {&__pyx_kp_238, __pyx_k_238, sizeof(__pyx_k_238), 0, 0, 0}, - {&__pyx_kp_239, __pyx_k_239, sizeof(__pyx_k_239), 0, 0, 0}, - {&__pyx_kp_240, __pyx_k_240, sizeof(__pyx_k_240), 0, 0, 0}, - {&__pyx_kp_241, __pyx_k_241, sizeof(__pyx_k_241), 0, 0, 0}, - {&__pyx_kp_242, __pyx_k_242, sizeof(__pyx_k_242), 0, 0, 0}, - {&__pyx_kp_243, __pyx_k_243, sizeof(__pyx_k_243), 0, 0, 0}, - {&__pyx_kp_244, __pyx_k_244, sizeof(__pyx_k_244), 0, 0, 0}, - {&__pyx_kp_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 0, 0}, - {&__pyx_kp_246, __pyx_k_246, sizeof(__pyx_k_246), 0, 0, 0}, - {&__pyx_kp_247, __pyx_k_247, sizeof(__pyx_k_247), 0, 0, 0}, - {&__pyx_kp_248, __pyx_k_248, sizeof(__pyx_k_248), 0, 0, 0}, - {&__pyx_kp_249, __pyx_k_249, sizeof(__pyx_k_249), 0, 0, 0}, - {&__pyx_kp_250, __pyx_k_250, sizeof(__pyx_k_250), 0, 0, 0}, - {&__pyx_kp_251, __pyx_k_251, sizeof(__pyx_k_251), 0, 0, 0}, - {&__pyx_kp_252, __pyx_k_252, sizeof(__pyx_k_252), 0, 0, 0}, - {&__pyx_kp_253, __pyx_k_253, sizeof(__pyx_k_253), 0, 0, 0}, - {&__pyx_kp_254, __pyx_k_254, sizeof(__pyx_k_254), 0, 0, 0}, - {&__pyx_kp_255, __pyx_k_255, sizeof(__pyx_k_255), 0, 0, 0}, - {&__pyx_kp_256, __pyx_k_256, sizeof(__pyx_k_256), 0, 0, 0}, - {&__pyx_kp_257, __pyx_k_257, sizeof(__pyx_k_257), 0, 0, 0}, - {&__pyx_kp_258, __pyx_k_258, sizeof(__pyx_k_258), 0, 0, 0}, - {&__pyx_kp_259, __pyx_k_259, sizeof(__pyx_k_259), 0, 0, 0}, - {&__pyx_kp_262, __pyx_k_262, sizeof(__pyx_k_262), 0, 0, 0}, - {&__pyx_kp_264, __pyx_k_264, sizeof(__pyx_k_264), 0, 0, 0}, - {&__pyx_kp_266, __pyx_k_266, sizeof(__pyx_k_266), 0, 0, 0}, - {&__pyx_kp_267, __pyx_k_267, sizeof(__pyx_k_267), 0, 0, 0}, - {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1}, - {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1}, - {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1}, - {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, - {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0}, - {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0}, - {&__pyx_kp_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 0}, - {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 0}, - {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 0}, - {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_kp_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_kp_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initopencv_cv(void); /*proto*/ -PyMODINIT_FUNC initopencv_cv(void) -#else -PyMODINIT_FUNC PyInit_opencv_cv(void); /*proto*/ -PyMODINIT_FUNC PyInit_opencv_cv(void) -#endif -{ - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __pyx_init_filenames(); - #ifdef CYTHON_REFNANNY - void* __pyx_refchk = NULL; - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); - if (!__Pyx_Refnanny) { - PyErr_Clear(); - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); - if (!__Pyx_Refnanny) - Py_FatalError("failed to import refnanny module"); - } - __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_opencv_cv(void)", __LINE__, __FILE__); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("opencv_cv"), __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__pyx_module_is_main_scikits__image__opencv__opencv_cv) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - __pyx_4 = __Pyx_ImportModule("scikits.image.opencv.opencv_backend"); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "populate_iplimage", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_populate_iplimage, "void (PyArrayObject *, __pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "cvmat_ptr_from_iplimage", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_cvmat_ptr_from_iplimage, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvMat *(__pyx_t_7scikits_5image_6opencv_11opencv_type_IplImage *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "validate_array", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_validate_array, "int (PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_dtype", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_dtype, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_ndims", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_ndims, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_nchannels", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_nchannels, "int (PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_same_dtype", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_dtype, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_same_shape", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_shape, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_same_width_and_height", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_same_width_and_height, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_like", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_like, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "assert_not_sharing_data", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_assert_not_sharing_data, "int (PyArrayObject *, PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "new_array", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array, "PyArrayObject *(int, npy_intp *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "new_array_like", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like, "PyArrayObject *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "new_array_like_diff_dtype", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_new_array_like_diff_dtype, "PyArrayObject *(PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "get_array_nbytes", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_array_nbytes, "npy_intp (PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "clone_array_shape", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_clone_array_shape, "npy_intp *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "array_as_cvPoint2D32f_ptr", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_array_as_cvPoint2D32f_ptr, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvPoint2D32f *(PyArrayObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "get_cvTermCriteria", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_cvTermCriteria, "struct __pyx_t_7scikits_5image_6opencv_11opencv_type_CvTermCriteria (int, double)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "get_IplConvKernel_ptr_from_array", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_get_IplConvKernel_ptr_from_array, "__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *(PyArrayObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ImportFunction(__pyx_4, "free_IplConvKernel", (void (**)(void))&__pyx_f_7scikits_5image_6opencv_14opencv_backend_free_IplConvKernel, "void (__pyx_t_7scikits_5image_6opencv_11opencv_type_IplConvKernel *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - /*--- Execution code ---*/ - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1 - * import ctypes # <<<<<<<<<<<<<< - * import numpy as np - * - */ - __pyx_1 = __Pyx_Import(__pyx_kp_ctypes, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_ctypes, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2 - * import ctypes - * import numpy as np # <<<<<<<<<<<<<< - * - * cimport numpy as np - */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":8 - * from stdlib cimport * - * from opencv_type cimport * - * from opencv_backend import * # <<<<<<<<<<<<<< - * from opencv_backend cimport * - * from opencv_constants import * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_37); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_37); - __Pyx_GIVEREF(__pyx_kp_37); - __pyx_1 = __Pyx_Import(__pyx_kp_opencv_backend, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":10 - * from opencv_backend import * - * from opencv_backend cimport * - * from opencv_constants import * # <<<<<<<<<<<<<< - * - * from opencv_constants import * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_37); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_37); - __Pyx_GIVEREF(__pyx_kp_37); - __pyx_1 = __Pyx_Import(__pyx_kp_opencv_constants, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":12 - * from opencv_constants import * - * - * from opencv_constants import * # <<<<<<<<<<<<<< - * from opencv_cv import * - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_37); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_37); - __Pyx_GIVEREF(__pyx_kp_37); - __pyx_1 = __Pyx_Import(__pyx_kp_opencv_constants, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":13 - * - * from opencv_constants import * - * from opencv_cv import * # <<<<<<<<<<<<<< - * - * from _libimport import cv - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_37); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_37); - __Pyx_GIVEREF(__pyx_kp_37); - __pyx_1 = __Pyx_Import(__pyx_kp_opencv_cv, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (__pyx_import_star(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":15 - * from opencv_cv import * - * - * from _libimport import cv # <<<<<<<<<<<<<< - * from _utilities import cvdoc - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_cv); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_cv); - __Pyx_GIVEREF(__pyx_kp_cv); - __pyx_1 = __Pyx_Import(__pyx_kp__libimport, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cv, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":16 - * - * from _libimport import cv - * from _utilities import cvdoc # <<<<<<<<<<<<<< - * - * if cv is None: - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_cvdoc); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_cvdoc); - __Pyx_GIVEREF(__pyx_kp_cvdoc); - __pyx_1 = __Pyx_Import(__pyx_kp__utilities, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvdoc, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":18 - * from _utilities import cvdoc - * - * if cv is None: # <<<<<<<<<<<<<< - * raise RuntimeError("Could not load libcv") - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = (__pyx_1 == Py_None); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_t_2) { - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":19 - * - * if cv is None: - * raise RuntimeError("Could not load libcv") # <<<<<<<<<<<<<< - * - * # setup numpy tables for this module - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_38); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_38); - __Pyx_GIVEREF(__pyx_kp_38); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L2; - } - __pyx_L2:; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":22 - * - * # setup numpy tables for this module - * np.import_array() # <<<<<<<<<<<<<< - * - * #------------------------------------------------------------------------------- - */ - import_array(); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":35 - * # out type is always the same as in type - * - * _cvtcolor_dict = {CV_BGR2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_39); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":36 - * - * _cvtcolor_dict = {CV_BGR2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGB2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGRA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_43); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":37 - * _cvtcolor_dict = {CV_BGR2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGB2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGBA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_44); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":38 - * CV_RGB2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_45); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":39 - * CV_BGRA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_46); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":40 - * CV_RGBA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGBA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_47); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":41 - * CV_BGR2RGBA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGRA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_48); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":42 - * CV_RGB2BGRA: [3, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_49); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":43 - * CV_RGBA2BGR: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGBA: [4, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_50); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":44 - * CV_BGRA2RGB: [4, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGRA2RGBA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGRA: [4, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_51); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":45 - * CV_BGR2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGBA: [4, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGBA2BGRA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGR2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_52); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":46 - * CV_RGB2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2RGBA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGRA: [4, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGB2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_53); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":47 - * CV_BGRA2RGBA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2BGRA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGR2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGR: [1, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_54); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":48 - * CV_RGBA2BGRA: [4, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGR2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGB2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_GRAY2BGR: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGB: [1, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_55); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":49 - * CV_BGR2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGB2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGR: [1, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_GRAY2RGB: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGRA: [1, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_56); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":50 - * CV_RGB2GRAY: [3, 1, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGR: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGB: [1, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_GRAY2BGRA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGBA: [1, 4, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_57); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":51 - * CV_GRAY2BGR: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGB: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGRA: [1, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_GRAY2RGBA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_58); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":52 - * CV_GRAY2RGB: [1, 3, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2BGRA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGBA: [1, 4, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGRA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_59); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":53 - * CV_GRAY2BGRA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_GRAY2RGBA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGBA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_BGR2BGR565: [3, 2, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_60); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":54 - * CV_GRAY2RGBA: [1, 4, [UINT8, UINT16, FLOAT32]], - * CV_BGRA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2BGR565: [3, 2, [UINT8]], - * CV_RGB2BGR565: [3, 2, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_61); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":55 - * CV_BGRA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_RGBA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_BGR2BGR565: [3, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_RGB2BGR565: [3, 2, [UINT8]], - * CV_BGR5652BGR: [2, 3, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_62); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":56 - * CV_RGBA2GRAY: [4, 1, [UINT8, UINT16, FLOAT32]], - * CV_BGR2BGR565: [3, 2, [UINT8]], - * CV_RGB2BGR565: [3, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5652BGR: [2, 3, [UINT8]], - * CV_BGR5652RGB: [2, 3, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_63); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":57 - * CV_BGR2BGR565: [3, 2, [UINT8]], - * CV_RGB2BGR565: [3, 2, [UINT8]], - * CV_BGR5652BGR: [2, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5652RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR565: [4, 2, [UINT8]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_64); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":58 - * CV_RGB2BGR565: [3, 2, [UINT8]], - * CV_BGR5652BGR: [2, 3, [UINT8]], - * CV_BGR5652RGB: [2, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGRA2BGR565: [4, 2, [UINT8]], - * CV_RGBA2BGR565: [4, 2, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_65); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":59 - * CV_BGR5652BGR: [2, 3, [UINT8]], - * CV_BGR5652RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR565: [4, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_RGBA2BGR565: [4, 2, [UINT8]], - * CV_BGR5652BGRA: [2, 4, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_66); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":60 - * CV_BGR5652RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR565: [4, 2, [UINT8]], - * CV_RGBA2BGR565: [4, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5652BGRA: [2, 4, [UINT8]], - * CV_BGR5652RGBA: [2, 4, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_67); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":61 - * CV_BGRA2BGR565: [4, 2, [UINT8]], - * CV_RGBA2BGR565: [4, 2, [UINT8]], - * CV_BGR5652BGRA: [2, 4, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5652RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR565: [1, 2, [UINT8]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_68); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":62 - * CV_RGBA2BGR565: [4, 2, [UINT8]], - * CV_BGR5652BGRA: [2, 4, [UINT8]], - * CV_BGR5652RGBA: [2, 4, [UINT8]], # <<<<<<<<<<<<<< - * CV_GRAY2BGR565: [1, 2, [UINT8]], - * CV_BGR5652GRAY: [2, 1, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_69); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":63 - * CV_BGR5652BGRA: [2, 4, [UINT8]], - * CV_BGR5652RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR565: [1, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5652GRAY: [2, 1, [UINT8]], - * CV_BGR2BGR555: [3, 2, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_70); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":64 - * CV_BGR5652RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR565: [1, 2, [UINT8]], - * CV_BGR5652GRAY: [2, 1, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR2BGR555: [3, 2, [UINT8]], - * CV_RGB2BGR555: [3, 2, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_71); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":65 - * CV_GRAY2BGR565: [1, 2, [UINT8]], - * CV_BGR5652GRAY: [2, 1, [UINT8]], - * CV_BGR2BGR555: [3, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_RGB2BGR555: [3, 2, [UINT8]], - * CV_BGR5552BGR: [2, 3, [UINT8]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_72); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":66 - * CV_BGR5652GRAY: [2, 1, [UINT8]], - * CV_BGR2BGR555: [3, 2, [UINT8]], - * CV_RGB2BGR555: [3, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5552BGR: [2, 3, [UINT8]], - * CV_BGR5552RGB: [2, 3, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":67 - * CV_BGR2BGR555: [3, 2, [UINT8]], - * CV_RGB2BGR555: [3, 2, [UINT8]], - * CV_BGR5552BGR: [2, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5552RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR555: [4, 2, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_74); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":68 - * CV_RGB2BGR555: [3, 2, [UINT8]], - * CV_BGR5552BGR: [2, 3, [UINT8]], - * CV_BGR5552RGB: [2, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGRA2BGR555: [4, 2, [UINT8]], - * CV_RGBA2BGR555: [4, 2, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_75); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":69 - * CV_BGR5552BGR: [2, 3, [UINT8]], - * CV_BGR5552RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR555: [4, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_RGBA2BGR555: [4, 2, [UINT8]], - * CV_BGR5552BGRA: [2, 4, [UINT8]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_76); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":70 - * CV_BGR5552RGB: [2, 3, [UINT8]], - * CV_BGRA2BGR555: [4, 2, [UINT8]], - * CV_RGBA2BGR555: [4, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5552BGRA: [2, 4, [UINT8]], - * CV_BGR5552RGBA: [2, 4, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_77); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":71 - * CV_BGRA2BGR555: [4, 2, [UINT8]], - * CV_RGBA2BGR555: [4, 2, [UINT8]], - * CV_BGR5552BGRA: [2, 4, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5552RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR555: [1, 2, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_78); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":72 - * CV_RGBA2BGR555: [4, 2, [UINT8]], - * CV_BGR5552BGRA: [2, 4, [UINT8]], - * CV_BGR5552RGBA: [2, 4, [UINT8]], # <<<<<<<<<<<<<< - * CV_GRAY2BGR555: [1, 2, [UINT8]], - * CV_BGR5552GRAY: [2, 1, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_79); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_4); - __Pyx_GIVEREF(__pyx_int_4); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":73 - * CV_BGR5552BGRA: [2, 4, [UINT8]], - * CV_BGR5552RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR555: [1, 2, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR5552GRAY: [2, 1, [UINT8]], - * CV_BGR2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_80); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":74 - * CV_BGR5552RGBA: [2, 4, [UINT8]], - * CV_GRAY2BGR555: [1, 2, [UINT8]], - * CV_BGR5552GRAY: [2, 1, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_81); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_2); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":75 - * CV_GRAY2BGR555: [1, 2, [UINT8]], - * CV_BGR5552GRAY: [2, 1, [UINT8]], - * CV_BGR2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_82); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":76 - * CV_BGR5552GRAY: [2, 1, [UINT8]], - * CV_BGR2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_XYZ2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_83); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":77 - * CV_BGR2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_XYZ2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_84); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":78 - * CV_RGB2XYZ: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":79 - * CV_XYZ2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_XYZ2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":80 - * CV_XYZ2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_YCrCb2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_87); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_4 = 0; - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":81 - * CV_BGR2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_RGB2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_YCrCb2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2HSV: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_88); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_5 = 0; - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":82 - * CV_RGB2YCrCb: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HSV: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_89); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_41); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_1 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":83 - * CV_YCrCb2BGR: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_YCrCb2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2HSV: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2Lab: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_90); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":84 - * CV_YCrCb2RGB: [3, 3, [UINT8, UINT16, FLOAT32]], - * CV_BGR2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HSV: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Lab: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_91); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":85 - * CV_BGR2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2Lab: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_BayerBG2BGR: [1, 3, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_92); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":86 - * CV_RGB2HSV: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Lab: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BayerBG2BGR: [1, 3, [UINT8]], - * CV_BayerGB2BGR: [1, 3, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_93); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":87 - * CV_BGR2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_BayerBG2BGR: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerGB2BGR: [1, 3, [UINT8]], - * CV_BayerRG2BGR: [1, 3, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_94); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":88 - * CV_RGB2Lab: [3, 3, [UINT8, FLOAT32]], - * CV_BayerBG2BGR: [1, 3, [UINT8]], - * CV_BayerGB2BGR: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerRG2BGR: [1, 3, [UINT8]], - * CV_BayerGR2BGR: [1, 3, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_95); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":89 - * CV_BayerBG2BGR: [1, 3, [UINT8]], - * CV_BayerGB2BGR: [1, 3, [UINT8]], - * CV_BayerRG2BGR: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerGR2BGR: [1, 3, [UINT8]], - * CV_BayerBG2RGB: [1, 3, [UINT8]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_96); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":90 - * CV_BayerGB2BGR: [1, 3, [UINT8]], - * CV_BayerRG2BGR: [1, 3, [UINT8]], - * CV_BayerGR2BGR: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerBG2RGB: [1, 3, [UINT8]], - * CV_BayerGB2RGB: [1, 3, [UINT8]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_97); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":91 - * CV_BayerRG2BGR: [1, 3, [UINT8]], - * CV_BayerGR2BGR: [1, 3, [UINT8]], - * CV_BayerBG2RGB: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerGB2RGB: [1, 3, [UINT8]], - * CV_BayerRG2RGB: [1, 3, [UINT8]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_98); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":92 - * CV_BayerGR2BGR: [1, 3, [UINT8]], - * CV_BayerBG2RGB: [1, 3, [UINT8]], - * CV_BayerGB2RGB: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerRG2RGB: [1, 3, [UINT8]], - * CV_BayerGR2RGB: [1, 3, [UINT8]], - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_99); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_4, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":93 - * CV_BayerBG2RGB: [1, 3, [UINT8]], - * CV_BayerGB2RGB: [1, 3, [UINT8]], - * CV_BayerRG2RGB: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BayerGR2RGB: [1, 3, [UINT8]], - * CV_BGR2Luv: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_100); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_3, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":94 - * CV_BayerGB2RGB: [1, 3, [UINT8]], - * CV_BayerRG2RGB: [1, 3, [UINT8]], - * CV_BayerGR2RGB: [1, 3, [UINT8]], # <<<<<<<<<<<<<< - * CV_BGR2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Luv: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_1); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":95 - * CV_BayerRG2RGB: [1, 3, [UINT8]], - * CV_BayerGR2RGB: [1, 3, [UINT8]], - * CV_BGR2Luv: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2HLS: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_102); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":96 - * CV_BayerGR2RGB: [1, 3, [UINT8]], - * CV_BGR2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Luv: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_BGR2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HLS: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_103); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":97 - * CV_BGR2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2HLS: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_RGB2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2BGR: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_104); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":98 - * CV_RGB2Luv: [3, 3, [UINT8, FLOAT32]], - * CV_BGR2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HLS: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_HSV2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2RGB: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_105); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":99 - * CV_BGR2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_RGB2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2BGR: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_HSV2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2BGR: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_106); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":100 - * CV_RGB2HLS: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2RGB: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_Lab2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2RGB: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_107); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":101 - * CV_HSV2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_HSV2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2BGR: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_Lab2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2BGR: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_108); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":102 - * CV_HSV2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2RGB: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_Luv2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2RGB: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_109); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":103 - * CV_Lab2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Lab2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2BGR: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_Luv2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_HLS2BGR: [3, 3, [UINT8, FLOAT32]], - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_110); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":104 - * CV_Lab2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2RGB: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_HLS2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_HLS2RGB: [3, 3, [UINT8, FLOAT32]]} - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_111); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":105 - * CV_Luv2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_Luv2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_HLS2BGR: [3, 3, [UINT8, FLOAT32]], # <<<<<<<<<<<<<< - * CV_HLS2RGB: [3, 3, [UINT8, FLOAT32]]} - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_112); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_1, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":106 - * CV_Luv2RGB: [3, 3, [UINT8, FLOAT32]], - * CV_HLS2BGR: [3, 3, [UINT8, FLOAT32]], - * CV_HLS2RGB: [3, 3, [UINT8, FLOAT32]]} # <<<<<<<<<<<<<< - * - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_113); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_40); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_42); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - __Pyx_INCREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_3); - __Pyx_GIVEREF(__pyx_int_3); - PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_2, __pyx_5, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp__cvtcolor_dict, ((PyObject *)__pyx_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":116 - * ctypedef void (*cvSobelPtr)(IplImage*, IplImage*, int, int, int) - * cdef cvSobelPtr c_cvSobel - * c_cvSobel = (ctypes.addressof(cv.cvSobel))[0] # <<<<<<<<<<<<<< - * - * # cvLaplace - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_cvSobel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSobel = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSobelPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":121 - * ctypedef void (*cvLaplacePtr)(IplImage*, IplImage*, int) - * cdef cvLaplacePtr c_cvLaplace - * c_cvLaplace = (ctypes.addressof(cv.cvLaplace))[0] # <<<<<<<<<<<<<< - * - * # cvCanny - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_5, __pyx_kp_cvLaplace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLaplace = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLaplacePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":126 - * ctypedef void (*cvCannyPtr)(IplImage*, IplImage*, double, double, int) - * cdef cvCannyPtr c_cvCanny - * c_cvCanny = (ctypes.addressof(cv.cvCanny))[0] # <<<<<<<<<<<<<< - * - * # cvPreCornerDetect - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvCanny); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCanny = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCannyPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":132 - * cdef cvPreCorneDetectPtr c_cvPreCornerDetect - * c_cvPreCornerDetect = ( - * ctypes.addressof(cv.cvPreCornerDetect))[0] # <<<<<<<<<<<<<< - * - * # cvCornerEigenValsAndVecs - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_4, __pyx_kp_cvPreCornerDetect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPreCornerDetect = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPreCorneDetectPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":138 - * cdef cvCornerEigenValsAndVecsPtr c_cvCornerEigenValsAndVecs - * c_cvCornerEigenValsAndVecs = ( - * ctypes.addressof(cv.cvCornerEigenValsAndVecs))[0] # <<<<<<<<<<<<<< - * - * # cvCornerMinEigenVal - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_5, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_114); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerEigenValsAndVecs = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerEigenValsAndVecsPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":144 - * cdef cvCornerMinEigenValPtr c_cvCornerMinEigenVal - * c_cvCornerMinEigenVal = ( - * ctypes.addressof(cv.cvCornerMinEigenVal))[0] # <<<<<<<<<<<<<< - * - * # cvCornerHarris - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyObject_GetAttr(__pyx_3, __pyx_kp_cvCornerMinEigenVal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerMinEigenVal = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerMinEigenValPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":150 - * cdef cvCornerHarrisPtr c_cvCornerHarris - * c_cvCornerHarris = ( - * ctypes.addressof(cv.cvCornerHarris))[0] # <<<<<<<<<<<<<< - * - * # cvFindCornerSubPix - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_5, __pyx_kp_cvCornerHarris); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCornerHarris = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCornerHarrisPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":157 - * cdef cvFindCornerSubPixPtr c_cvFindCornerSubPix - * c_cvFindCornerSubPix = ( - * ctypes.addressof(cv.cvFindCornerSubPix))[0] # <<<<<<<<<<<<<< - * - * # cvGoodFeaturesToTrack - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvFindCornerSubPix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindCornerSubPix = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindCornerSubPixPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":165 - * cdef cvGoodFeaturesToTrackPtr c_cvGoodFeaturesToTrack - * c_cvGoodFeaturesToTrack = ( - * ctypes.addressof(cv.cvGoodFeaturesToTrack))[0] # <<<<<<<<<<<<<< - * - * # cvGetRectSubPix - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_115); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGoodFeaturesToTrack = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGoodFeaturesToTrackPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":171 - * cdef cvGetRectSubPixPtr c_cvGetRectSubPix - * c_cvGetRectSubPix = ( - * ctypes.addressof(cv.cvGetRectSubPix))[0] # <<<<<<<<<<<<<< - * - * # cvGetQuadrangleSubPix - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_cvGetRectSubPix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetRectSubPix = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetRectSubPixPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":177 - * cdef cvGetQuadrangleSubPixPtr c_cvGetQuadrangleSubPix - * c_cvGetQuadrangleSubPix = ( - * ctypes.addressof(cv.cvGetQuadrangleSubPix))[0] # <<<<<<<<<<<<<< - * - * # cvResize - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_116); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvGetQuadrangleSubPix = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvGetQuadrangleSubPixPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":182 - * ctypedef void (*cvResizePtr)(IplImage*, IplImage*, int) - * cdef cvResizePtr c_cvResize - * c_cvResize = (ctypes.addressof(cv.cvResize))[0] # <<<<<<<<<<<<<< - * - * # cvWarpAffine - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_4 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_cvResize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvResize = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvResizePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":188 - * cdef cvWarpAffinePtr c_cvWarpAffine - * c_cvWarpAffine = ( - * ctypes.addressof(cv.cvWarpAffine))[0] # <<<<<<<<<<<<<< - * - * # cvWarpPerspective - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvWarpAffine); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpAffine = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpAffinePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":195 - * cdef cvWarpPerspectivePtr c_cvWarpPerspective - * c_cvWarpPerspective = ( - * ctypes.addressof(cv.cvWarpPerspective))[0] # <<<<<<<<<<<<<< - * - * # cvLogPolar - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_4 = PyObject_GetAttr(__pyx_4, __pyx_kp_cvWarpPerspective); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvWarpPerspective = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvWarpPerspectivePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":200 - * ctypedef void (*cvLogPolarPtr)(IplImage*, IplImage*, CvPoint2D32f, double, int) - * cdef cvLogPolarPtr c_cvLogPolar - * c_cvLogPolar = (ctypes.addressof(cv.cvLogPolar))[0] # <<<<<<<<<<<<<< - * - * # cvErode - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_5, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_cvLogPolar); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvLogPolar = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvLogPolarPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":205 - * ctypedef void (*cvErodePtr)(IplImage*, IplImage*, IplConvKernel*, int) - * cdef cvErodePtr c_cvErode - * c_cvErode = (ctypes.addressof(cv.cvErode))[0] # <<<<<<<<<<<<<< - * - * # cvDilate - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_cvErode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvErode = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvErodePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":210 - * ctypedef void (*cvDilatePtr)(IplImage*, IplImage*, IplConvKernel*, int) - * cdef cvDilatePtr c_cvDilate - * c_cvDilate = (ctypes.addressof(cv.cvDilate))[0] # <<<<<<<<<<<<<< - * - * # cvMorphologyEx - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_5, __pyx_kp_cvDilate); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDilate = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDilatePtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":217 - * cdef cvMorphologyExPtr c_cvMorphologyEx - * c_cvMorphologyEx = ( - * ctypes.addressof(cv.cvMorphologyEx))[0] # <<<<<<<<<<<<<< - * - * # cvSmooth - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvMorphologyEx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvMorphologyEx = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvMorphologyExPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":223 - * int, double, double) - * cdef cvSmoothPtr c_cvSmooth - * c_cvSmooth = (ctypes.addressof(cv.cvSmooth))[0] # <<<<<<<<<<<<<< - * - * # cvFilter2D - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_4, __pyx_kp_cvSmooth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvSmooth = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvSmoothPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":228 - * ctypedef void (*cvFilter2DPtr)(IplImage*, IplImage*, CvMat*, CvPoint) - * cdef cvFilter2DPtr c_cvFilter2D - * c_cvFilter2D = (ctypes.addressof(cv.cvFilter2D))[0] # <<<<<<<<<<<<<< - * - * # cvIntegral - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_5, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_117); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFilter2D = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFilter2DPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":233 - * ctypedef void (*cvIntegralPtr)(IplImage*, IplImage*, IplImage*, IplImage*) - * cdef cvIntegralPtr c_cvIntegral - * c_cvIntegral = (ctypes.addressof(cv.cvIntegral))[0] # <<<<<<<<<<<<<< - * - * # cvCvtColor - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyObject_GetAttr(__pyx_3, __pyx_kp_cvIntegral); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvIntegral = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvIntegralPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":238 - * ctypedef void (*cvCvtColorPtr)(IplImage*, IplImage*, int) - * cdef cvCvtColorPtr c_cvCvtColor - * c_cvCvtColor = (ctypes.addressof(cv.cvCvtColor))[0] # <<<<<<<<<<<<<< - * - * # cvThreshold - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_5, __pyx_kp_cvCvtColor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCvtColor = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCvtColorPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":243 - * ctypedef double (*cvThresholdPtr)(IplImage*, IplImage*, double, double, int) - * cdef cvThresholdPtr c_cvThreshold - * c_cvThreshold = (ctypes.addressof(cv.cvThreshold))[0] # <<<<<<<<<<<<<< - * - * # cvAdaptiveThreshold - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_cvThreshold); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvThreshold = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvThresholdPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":250 - * cdef cvAdaptiveThresholdPtr c_cvAdaptiveThreshold - * c_cvAdaptiveThreshold = ( - * ctypes.addressof(cv.cvAdaptiveThreshold))[0] # <<<<<<<<<<<<<< - * - * # cvPyrDown - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_cvAdaptiveThreshold); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvAdaptiveThreshold = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvAdaptiveThresholdPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":255 - * ctypedef void (*cvPyrDownPtr)(IplImage*, IplImage*, int) - * cdef cvPyrDownPtr c_cvPyrDown - * c_cvPyrDown = (ctypes.addressof(cv.cvPyrDown))[0] # <<<<<<<<<<<<<< - * - * # cvPyrUp - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_cvPyrDown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrDown = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrDownPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":260 - * ctypedef void (*cvPyrUpPtr)(IplImage*, IplImage*, int) - * cdef cvPyrUpPtr c_cvPyrUp - * c_cvPyrUp = (ctypes.addressof(cv.cvPyrUp))[0] # <<<<<<<<<<<<<< - * - * # cvCalibrateCamera2 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_cvPyrUp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvPyrUp = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvPyrUpPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":267 - * cdef cvCalibrateCamera2Ptr c_cvCalibrateCamera2 - * c_cvCalibrateCamera2 = ( - * ctypes.addressof(cv.cvCalibrateCamera2))[0] # <<<<<<<<<<<<<< - * - * # cvFindChessboardCorners - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_4 = PyObject_GetAttr(__pyx_4, __pyx_kp_addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_118); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvCalibrateCamera2 = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvCalibrateCamera2Ptr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":274 - * cdef cvFindChessboardCornersPtr c_cvFindChessboardCorners - * c_cvFindChessboardCorners = ( - * ctypes.addressof(cv.cvFindChessboardCorners))[0] # <<<<<<<<<<<<<< - * - * # cvDrawChessboardCorners - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_addressof); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvFindChessboardCorners = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvFindChessboardCornersPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":281 - * cdef cvDrawChessboardCornersPtr c_cvDrawChessboardCorners - * c_cvDrawChessboardCorners = ( - * ctypes.addressof(cv.cvDrawChessboardCorners))[0] # <<<<<<<<<<<<<< - * - * #------------------------------------------------------------------------------- - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ctypes); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_addressof); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cv); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_4 = PyObject_GetAttr(__pyx_4, __pyx_kp_120); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_7scikits_5image_6opencv_9opencv_cv_c_cvDrawChessboardCorners = (((__pyx_t_7scikits_5image_6opencv_9opencv_cv_cvDrawChessboardCornersPtr *)((size_t)__pyx_t_5))[0]); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":291 - * #-------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvSobel(src, xorder=1, yorder=0, aperture_size=3) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_121) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_122) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":292 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvSobel(src, xorder=1, yorder=0, aperture_size=3) # <<<<<<<<<<<<<< - * - * Apply the Sobel operator to the input image. - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_123) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":312 - * A new which is the result of applying the Sobel - * operator to src.''') - * def cvSobel(np.ndarray src, int xorder=1, int yorder=0, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvSobel); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvSobel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":344 - * #---------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvLaplace(src, aperture_size=3) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_124) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_125) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":345 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvLaplace(src, aperture_size=3) # <<<<<<<<<<<<<< - * - * Apply the Laplace operator to the input image. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_126) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":361 - * A new which is the result of applying the Laplace - * operator to src.''') - * def cvLaplace(np.ndarray src, int aperture_size=3): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvLaplace); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvLaplace, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":392 - * #-------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvCanny(src, threshold1=10, threshold2=50, aperture_size=3) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_package, __pyx_kp_127) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_group, __pyx_kp_128) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":393 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvCanny(src, threshold1=10, threshold2=50, aperture_size=3) # <<<<<<<<<<<<<< - * - * Apply Canny edge detection to the input image. - */ - if (PyDict_SetItem(__pyx_1, __pyx_kp_doc, __pyx_kp_129) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":413 - * A new which is the result of applying Canny - * edge detection to src.''') - * def cvCanny(np.ndarray src, double threshold1=10, double threshold2=50, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvCanny); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvCanny, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":440 - * #------------------ - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvPreCornerDetect(src, aperture_size=3) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_130) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_131) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":441 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvPreCornerDetect(src, aperture_size=3) # <<<<<<<<<<<<<< - * - * Calculate the feature map for corner detection. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_132) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":456 - * out : ndarray - * A new array of the corner candidates.''') - * def cvPreCornerDetect(np.ndarray src, int aperture_size=3): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvPreCornerDetect); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvPreCornerDetect, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":482 - * #------------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvCornerEigenValsAndVecs(src, block_size=3, aperture_size=3) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_3)); - if (PyDict_SetItem(__pyx_3, __pyx_kp_package, __pyx_kp_133) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_3, __pyx_kp_group, __pyx_kp_134) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":483 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvCornerEigenValsAndVecs(src, block_size=3, aperture_size=3) # <<<<<<<<<<<<<< - * - * Calculates the eigenvalues and eigenvectors of image - */ - if (PyDict_SetItem(__pyx_3, __pyx_kp_doc, __pyx_kp_135) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":505 - * Where height and width are the same as that - * of src.''') - * def cvCornerEigenValsAndVecs(np.ndarray src, int block_size=3, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_114); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_114, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":536 - * #-------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvCornerMinEigenVal(src, block_size=3, aperture_size=3) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_136) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_137) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":537 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvCornerMinEigenVal(src, block_size=3, aperture_size=3) # <<<<<<<<<<<<<< - * - * Calculates the minimum eigenvalues of gradient matrices - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_138) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":556 - * out : ndarray - * A new array of the eigenvalues.''') - * def cvCornerMinEigenVal(np.ndarray src, int block_size=3, # <<<<<<<<<<<<<< - * int aperture_size=3): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvCornerMinEigenVal); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvCornerMinEigenVal, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":583 - * #--------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvCornerHarris(src, block_size=3, aperture_size=3, k=0.04) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_139) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_140) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":584 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvCornerHarris(src, block_size=3, aperture_size=3, k=0.04) # <<<<<<<<<<<<<< - * - * Applies the Harris edge detector to the input image. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_141) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":613 - * to the output image. Corners in the image can be found as the - * local maxima of the output image.''') - * def cvCornerHarris(np.ndarray src, int block_size=3, int aperture_size=3, # <<<<<<<<<<<<<< - * double k=0.04): - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvCornerHarris); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvCornerHarris, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":672 - * None. The array 'corners' is modified in place.''') - * def cvFindCornerSubPix(np.ndarray src, np.ndarray corners, win, - * zero_zone=(-1, -1), int iterations=0, # <<<<<<<<<<<<<< - * double epsilon=1e-5): - * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_k_142 = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_142); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":640 - * #------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvFindCornerSubPix(src, corners, win, zero_zone=(-1, -1), iterations=0, epsilon=1e-5) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_package, __pyx_kp_143) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_group, __pyx_kp_144) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":641 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvFindCornerSubPix(src, corners, win, zero_zone=(-1, -1), iterations=0, epsilon=1e-5) # <<<<<<<<<<<<<< - * - * Refines corner locations to sub-pixel accuracy. - */ - if (PyDict_SetItem(__pyx_1, __pyx_kp_doc, __pyx_kp_145) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":671 - * ------- - * None. The array 'corners' is modified in place.''') - * def cvFindCornerSubPix(np.ndarray src, np.ndarray corners, win, # <<<<<<<<<<<<<< - * zero_zone=(-1, -1), int iterations=0, - * double epsilon=1e-5): - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvFindCornerSubPix); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvFindCornerSubPix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":716 - * #---------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvGoodFeaturesToTrack(src, corner_count, quality_level, min_distance, block_size=3, use_harris=0, k=0.04) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_146) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_147) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":717 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvGoodFeaturesToTrack(src, corner_count, quality_level, min_distance, block_size=3, use_harris=0, k=0.04) # <<<<<<<<<<<<<< - * - * Determines strong corners in an image. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_148) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":756 - * algorithm. It also insures that features are distanced - * from one another by at least min_distance.''') - * def cvGoodFeaturesToTrack(np.ndarray src, int corner_count, # <<<<<<<<<<<<<< - * double quality_level, double min_distance, - * int block_size=3, int use_harris=0, double k=0.04): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_115); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_115, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":801 - * #---------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvGetRectSubPix(src, size, center) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_3)); - if (PyDict_SetItem(__pyx_3, __pyx_kp_package, __pyx_kp_149) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_3, __pyx_kp_group, __pyx_kp_150) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":802 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvGetRectSubPix(src, size, center) # <<<<<<<<<<<<<< - * - * Retrieves the pixel rectangle from an image with - */ - if (PyDict_SetItem(__pyx_3, __pyx_kp_doc, __pyx_kp_151) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":829 - * may extend beyond the image. Border replication is used - * to fill in missing pixels.''') - * def cvGetRectSubPix(np.ndarray src, size, center): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvGetRectSubPix); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvGetRectSubPix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":893 - * and should be used unless specific feature of that - * function are required.''') - * def cvGetQuadrangleSubPix(np.ndarray src, np.ndarray warpmat, float_out=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_k_152 = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_k_152); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":859 - * #---------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvGetQuadrangleSubPix(src, warpmat, float_out=False) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_153) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_154) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":860 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvGetQuadrangleSubPix(src, warpmat, float_out=False) # <<<<<<<<<<<<<< - * - * Retrieves the pixel quandrangle from an image with - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_155) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":893 - * and should be used unless specific feature of that - * function are required.''') - * def cvGetQuadrangleSubPix(np.ndarray src, np.ndarray warpmat, float_out=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_116); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_116, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":957 - * out : ndarray - * The resized image.''') - * def cvResize(np.ndarray src, size, int method=CV_INTER_LINEAR): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_LINEAR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_k_156 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":934 - * #--------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvResize(src, size, method=CV_INTER_LINEAR) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_157) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_158) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":935 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvResize(src, size, method=CV_INTER_LINEAR) # <<<<<<<<<<<<<< - * - * Resize an to the given size. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_159) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":957 - * out : ndarray - * The resized image.''') - * def cvResize(np.ndarray src, size, int method=CV_INTER_LINEAR): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvResize); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvResize, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1037 - * features of this function are needed.''') - * def cvWarpAffine(np.ndarray src, np.ndarray warpmat, - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, # <<<<<<<<<<<<<< - * fillval=(0., 0., 0., 0.)): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_LINEAR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_160); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_4 = PyNumber_Add(__pyx_1, __pyx_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_k_161 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1038 - * def cvWarpAffine(np.ndarray src, np.ndarray warpmat, - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_1 = 0; - __pyx_t_7 = 0; - __pyx_k_162 = ((PyObject *)__pyx_t_8); - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_162); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":992 - * #------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvWarpAffine(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.)) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_163) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_164) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":993 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvWarpAffine(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.)) # <<<<<<<<<<<<<< - * - * Applies an affine transformation to the image. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_165) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1036 - * and that function should be used instead, unless specific - * features of this function are needed.''') - * def cvWarpAffine(np.ndarray src, np.ndarray warpmat, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvWarpAffine); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvWarpAffine, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1124 - * the inverse transform from warpmat.''') - * def cvWarpPerspective(np.ndarray src, np.ndarray warpmat, - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, # <<<<<<<<<<<<<< - * fillval=(0., 0., 0., 0.)): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_LINEAR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_160); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_1 = PyNumber_Add(__pyx_1, __pyx_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_k_166 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1125 - * def cvWarpPerspective(np.ndarray src, np.ndarray warpmat, - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_3 = 0; - __pyx_k_167 = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_k_167); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1083 - * #------------------ - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvWarpPerspective(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.)) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_168) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_169) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1084 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvWarpPerspective(src, warpmat, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0., 0., 0., 0.)) # <<<<<<<<<<<<<< - * - * Applies a perspective transformation to an image. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_170) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1123 - * directly for pixel interpolation. Otherwise, the function finds - * the inverse transform from warpmat.''') - * def cvWarpPerspective(np.ndarray src, np.ndarray warpmat, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, - * fillval=(0., 0., 0., 0.)): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvWarpPerspective); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvWarpPerspective, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1211 - * for object tracking and so forth.''') - * def cvLogPolar(np.ndarray src, center, double M, - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_INTER_LINEAR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_160); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_8 = PyNumber_Add(__pyx_1, __pyx_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_k_171 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1168 - * #----------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvLogPolar(src, center, M, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_172) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_173) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1169 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvLogPolar(src, center, M, flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS) # <<<<<<<<<<<<<< - * - * Remaps and image to Log-Polar space. - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_174) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1210 - * for fast scale and rotation-invariant template matching, - * for object tracking and so forth.''') - * def cvLogPolar(np.ndarray src, center, double M, # <<<<<<<<<<<<<< - * int flag=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS): - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvLogPolar); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvLogPolar, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1270 - * Otherwise, this function returns None.''') - * def cvErode(np.ndarray src, np.ndarray element=None, int iterations=1, - * anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_k_175 = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_k_175); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1240 - * #-------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvErode(src, element=None, iterations=1, anchor=None, in_place=False) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_3)); - if (PyDict_SetItem(__pyx_3, __pyx_kp_package, __pyx_kp_176) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_3, __pyx_kp_group, __pyx_kp_177) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1241 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvErode(src, element=None, iterations=1, anchor=None, in_place=False) # <<<<<<<<<<<<<< - * - * Erode the source image with the given element. - */ - if (PyDict_SetItem(__pyx_3, __pyx_kp_doc, __pyx_kp_178) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1269 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvErode(np.ndarray src, np.ndarray element=None, int iterations=1, # <<<<<<<<<<<<<< - * anchor=None, in_place=False): - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvErode); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvErode, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1336 - * Otherwise, this function returns None.''') - * def cvDilate(np.ndarray src, np.ndarray element=None, int iterations=1, - * anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_k_179 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_179); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1306 - * #--------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvDilate(src, element=None, iterations=1, anchor=None, in_place=False) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_180) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_181) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1307 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvDilate(src, element=None, iterations=1, anchor=None, in_place=False) # <<<<<<<<<<<<<< - * - * Dilate the source image with the given element. - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_182) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1335 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvDilate(np.ndarray src, np.ndarray element=None, int iterations=1, # <<<<<<<<<<<<<< - * anchor=None, in_place=False): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvDilate); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvDilate, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1409 - * Otherwise, this function returns None.''') - * def cvMorphologyEx(np.ndarray src, np.ndarray element, int operation, - * int iterations=1, anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_k_183 = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_k_183); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1372 - * #--------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvMorphologyEx(src, element, operation, iterations=1, anchor=None, in_place=False) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_184) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_185) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1373 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvMorphologyEx(src, element, operation, iterations=1, anchor=None, in_place=False) # <<<<<<<<<<<<<< - * - * Apply a morphological operation to the image. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_186) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1408 - * An new array is returned only if in_place=False. - * Otherwise, this function returns None.''') - * def cvMorphologyEx(np.ndarray src, np.ndarray element, int operation, # <<<<<<<<<<<<<< - * int iterations=1, anchor=None, in_place=False): - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvMorphologyEx); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvMorphologyEx, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1541 - * Using standard sigma for small kernels (3x3 to 7x7) - * gives better speed.''') - * def cvSmooth(np.ndarray src, int smoothtype=CV_GAUSSIAN, int param1=3, # <<<<<<<<<<<<<< - * int param2=0, double param3=0, double param4=0, - * bool in_place=False): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_GAUSSIAN); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_k_187 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1543 - * def cvSmooth(np.ndarray src, int smoothtype=CV_GAUSSIAN, int param1=3, - * int param2=0, double param3=0, double param4=0, - * bool in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (!(likely(PyBool_Check(__pyx_t_8)) || (__pyx_t_8) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected bool, got %s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_188 = ((PyObject *)__pyx_t_8); - __Pyx_GIVEREF(__pyx_k_188); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1462 - * #--------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvSmooth(src, smoothtype=CV_GAUSSIAN, param1=3, param2=0, param3=0., param4=0., in_place=False) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_3)); - if (PyDict_SetItem(__pyx_3, __pyx_kp_package, __pyx_kp_189) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_3, __pyx_kp_group, __pyx_kp_190) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1463 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvSmooth(src, smoothtype=CV_GAUSSIAN, param1=3, param2=0, param3=0., param4=0., in_place=False) # <<<<<<<<<<<<<< - * - * Smooth an image with the specified filter. - */ - if (PyDict_SetItem(__pyx_3, __pyx_kp_doc, __pyx_kp_191) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1541 - * Using standard sigma for small kernels (3x3 to 7x7) - * gives better speed.''') - * def cvSmooth(np.ndarray src, int smoothtype=CV_GAUSSIAN, int param1=3, # <<<<<<<<<<<<<< - * int param2=0, double param3=0, double param4=0, - * bool in_place=False): - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvSmooth); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_4); - __Pyx_GIVEREF(__pyx_4); - __pyx_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvSmooth, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1634 - * whether it will faster to do the convolution in the spatial - * or the frequency domain, and behaves accordingly.''') - * def cvFilter2D(np.ndarray src, np.ndarray kernel, anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_k_192 = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_k_192); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1605 - * #----------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvFilter2D(src, kernel, anchor=None, in_place=False) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_193) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_194) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1606 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvFilter2D(src, kernel, anchor=None, in_place=False) # <<<<<<<<<<<<<< - * - * Convolve an image with the given kernel. - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_195) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1634 - * whether it will faster to do the convolution in the spatial - * or the frequency domain, and behaves accordingly.''') - * def cvFilter2D(np.ndarray src, np.ndarray kernel, anchor=None, in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_117); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_117, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1707 - * out3: the titled sum image, - * or any combination of these two.''') - * def cvIntegral(np.ndarray src, square_sum=False, tilted_sum=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_k_196 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_196); - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_k_197 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_197); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1685 - * #----------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvIntegral(src, square_sum=False, titled_sum=False) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_198) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_199) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1686 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvIntegral(src, square_sum=False, titled_sum=False) # <<<<<<<<<<<<<< - * - * Calculate the integral of an image. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_200) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1707 - * out3: the titled sum image, - * or any combination of these two.''') - * def cvIntegral(np.ndarray src, square_sum=False, tilted_sum=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvIntegral); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvIntegral, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1766 - * #----------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvCvtColor(src, code) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_package, __pyx_kp_201) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_group, __pyx_kp_202) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1767 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvCvtColor(src, code) # <<<<<<<<<<<<<< - * - * Convert an image to another color space. - */ - if (PyDict_SetItem(__pyx_1, __pyx_kp_doc, __pyx_kp_203) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1809 - * See the OpenCV documentation for more details - * about the specific color conversions.''') - * def cvCvtColor(np.ndarray src, int code): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvCvtColor); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvCvtColor, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1890 - * just the thresholded image is returned.''') - * def cvThreshold(np.ndarray src, double threshold, double max_value=255, - * int threshold_type=CV_THRESH_BINARY, use_otsu=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_THRESH_BINARY); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_k_204 = __pyx_t_6; - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_k_205 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_205); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1858 - * #------------ - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvThreshold(src, threshold, max_value=255, threshold_type=CV_THRESH_BINARY, use_otsu=False) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_206) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_207) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1859 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvThreshold(src, threshold, max_value=255, threshold_type=CV_THRESH_BINARY, use_otsu=False) # <<<<<<<<<<<<<< - * - * Threshold an image. - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_208) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1889 - * returned in addition to the thresholded image. Otherwise - * just the thresholded image is returned.''') - * def cvThreshold(np.ndarray src, double threshold, double max_value=255, # <<<<<<<<<<<<<< - * int threshold_type=CV_THRESH_BINARY, use_otsu=False): - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvThreshold); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvThreshold, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1950 - * The thresholded image.''') - * def cvAdaptiveThreshold(np.ndarray src, double max_value, - * int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, # <<<<<<<<<<<<<< - * int threshold_type=CV_THRESH_BINARY, - * int block_size=3, double param1=5): - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_209); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_k_210 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1951 - * def cvAdaptiveThreshold(np.ndarray src, double max_value, - * int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, - * int threshold_type=CV_THRESH_BINARY, # <<<<<<<<<<<<<< - * int block_size=3, double param1=5): - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_CV_THRESH_BINARY); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_k_211 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1920 - * #-------------------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvAdaptiveThreshold(src, max_value, adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, threshold_type=CV_THRESH_BINARY, block_size=3, param1=5) - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_2)); - if (PyDict_SetItem(__pyx_2, __pyx_kp_package, __pyx_kp_212) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_2, __pyx_kp_group, __pyx_kp_213) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1921 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvAdaptiveThreshold(src, max_value, adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, threshold_type=CV_THRESH_BINARY, block_size=3, param1=5) # <<<<<<<<<<<<<< - * - * Apply an adaptive threshold to an image. - */ - if (PyDict_SetItem(__pyx_2, __pyx_kp_doc, __pyx_kp_214) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1949 - * out : ndarray - * The thresholded image.''') - * def cvAdaptiveThreshold(np.ndarray src, double max_value, # <<<<<<<<<<<<<< - * int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, - * int threshold_type=CV_THRESH_BINARY, - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_cvAdaptiveThreshold); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvAdaptiveThreshold, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1986 - * #---------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvPyrDown(src) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_215) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_216) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":1987 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvPyrDown(src) # <<<<<<<<<<<<<< - * - * Downsample an image. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_217) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2000 - * Downsampled image half the size of the original - * in each dimension.''') - * def cvPyrDown(np.ndarray src): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_cvPyrDown); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvPyrDown, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2028 - * #-------- - * - * @cvdoc(package='cv', group='image', doc=\ # <<<<<<<<<<<<<< - * '''cvPyrUp(src) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_package, __pyx_kp_218) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_group, __pyx_kp_219) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2029 - * - * @cvdoc(package='cv', group='image', doc=\ - * '''cvPyrUp(src) # <<<<<<<<<<<<<< - * - * Upsample an image. - */ - if (PyDict_SetItem(__pyx_1, __pyx_kp_doc, __pyx_kp_220) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2042 - * Upsampled image twice the size of the original - * in each dimension.''') - * def cvPyrUp(np.ndarray src): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvPyrUp); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_cvPyrUp, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2070 - * #------------------- - * - * @cvdoc(package='cv', group='calibration', doc=\ # <<<<<<<<<<<<<< - * '''cvCalibrateCamera2(object_points, image_points, point_counts, image_size) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_5)); - if (PyDict_SetItem(__pyx_5, __pyx_kp_package, __pyx_kp_221) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_5, __pyx_kp_group, __pyx_kp_222) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2071 - * - * @cvdoc(package='cv', group='calibration', doc=\ - * '''cvCalibrateCamera2(object_points, image_points, point_counts, image_size) # <<<<<<<<<<<<<< - * - * Finds the intrinsic and extrinsic camera parameters - */ - if (PyDict_SetItem(__pyx_5, __pyx_kp_doc, __pyx_kp_223) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2094 - * Intrinsics is the 3x3 camera instrinsics matrix. - * Distortion is the 5-vector of distortion coefficients.''') - * def cvCalibrateCamera2(np.ndarray object_points, np.ndarray image_points, # <<<<<<<<<<<<<< - * np.ndarray point_counts, image_size): - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_118); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_2 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_118, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2190 - * An nx2 array of the corners found.''') - * def cvFindChessboardCorners(np.ndarray src, pattern_size, - * int flag=CV_CALIB_CB_ADAPTIVE_THRESH): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_224); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_k_225 = __pyx_t_6; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2162 - * #------------------------ - * - * @cvdoc(package='cv', group='calibration', doc=\ # <<<<<<<<<<<<<< - * '''cvFindChessboardCorners(src, pattern_size, flag=CV_CALIB_CB_ADAPTIVE_THRESH) - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_4)); - if (PyDict_SetItem(__pyx_4, __pyx_kp_package, __pyx_kp_226) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_4, __pyx_kp_group, __pyx_kp_227) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2163 - * - * @cvdoc(package='cv', group='calibration', doc=\ - * '''cvFindChessboardCorners(src, pattern_size, flag=CV_CALIB_CB_ADAPTIVE_THRESH) # <<<<<<<<<<<<<< - * - * Finds the position of the internal corners of a chessboard. - */ - if (PyDict_SetItem(__pyx_4, __pyx_kp_doc, __pyx_kp_228) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2189 - * out : ndarray Nx2 - * An nx2 array of the corners found.''') - * def cvFindChessboardCorners(np.ndarray src, pattern_size, # <<<<<<<<<<<<<< - * int flag=CV_CALIB_CB_ADAPTIVE_THRESH): - * - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_119); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_5); - __Pyx_GIVEREF(__pyx_5); - __pyx_5 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_119, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2248 - * the corners drawn into it.''') - * def cvDrawChessboardCorners(np.ndarray src, pattern_size, np.ndarray corners, - * in_place=False): # <<<<<<<<<<<<<< - * - * validate_array(src) - */ - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_k_229 = __pyx_t_8; - __pyx_t_8 = 0; - __Pyx_GIVEREF(__pyx_k_229); - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2223 - * #------------------------ - * - * @cvdoc(package='cv', group='calibration', doc=\ # <<<<<<<<<<<<<< - * '''cvDrawChessboardCorners(src, pattern_size, corners, in_place=False) - * - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_cvdoc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_package, __pyx_kp_230) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_group, __pyx_kp_231) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2224 - * - * @cvdoc(package='cv', group='calibration', doc=\ - * '''cvDrawChessboardCorners(src, pattern_size, corners, in_place=False) # <<<<<<<<<<<<<< - * - * Renders found chessboard corners into an image. - */ - if (PyDict_SetItem(__pyx_1, __pyx_kp_doc, __pyx_kp_232) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/home/brucewayne/scikits_image/scikits.image/scikits/image/opencv/opencv_cv.pyx":2247 - * Otherwise, the function returns a new image with - * the corners drawn into it.''') - * def cvDrawChessboardCorners(np.ndarray src, pattern_size, np.ndarray corners, # <<<<<<<<<<<<<< - * in_place=False): - * - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_120); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - __Pyx_GIVEREF(__pyx_3); - __pyx_3 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_120, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "/usr/local/lib/python2.6/dist-packages/Cython-0.11.3-py2.6-linux-x86_64.egg/Cython/Includes/python_mem.pxd":1 - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * - * ##################################################################### - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_4); - __Pyx_XDECREF(__pyx_5); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - if (__pyx_m) { - __Pyx_AddTraceback("init scikits.image.opencv.opencv_cv"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.image.opencv.opencv_cv"); - } - __pyx_L0:; - __Pyx_FinishRefcountContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -static const char *__pyx_filenames[] = { - "opencv_cv.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - PyErr_NormalizeException(type, value, tb); - if (PyErr_Occurred()) - goto bad; - Py_INCREF(*type); - Py_INCREF(*value); - Py_INCREF(*tb); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - Py_XDECREF(*type); - Py_XDECREF(*value); - Py_XDECREF(*tb); - return -1; -} - - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); -} - -static INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); -} - -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(); - } -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunctionObjArgs(__import__, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - -#if PY_MAJOR_VERSION >= 3 - /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */ - if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) { - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - PyErr_NormalizeException(&type, &value, &tb); - PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb); - tstate->exc_type = 0; - tstate->exc_value = 0; - tstate->exc_traceback = 0; - PyException_SetContext(value, tmp_value); - Py_DECREF(tmp_type); - Py_XDECREF(tmp_tb); - } -#endif - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { - /**/ if (sizeof(npy_intp) < sizeof(long)) - return PyInt_FromLong((long)val); - else if (sizeof(npy_intp) == sizeof(long)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - PyInt_FromLong((long)val) : - PyLong_FromUnsignedLong((unsigned long)val); - else /* (sizeof(npy_intp) > sizeof(long)) */ - return (((npy_intp)-1) < ((npy_intp)0)) ? - PyLong_FromLongLong((PY_LONG_LONG)val) : - PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); -} - -static INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject* x) { - /**/ if (sizeof(npy_intp) == sizeof(char)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedChar(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedChar(x); - else if (sizeof(npy_intp) == sizeof(short)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedShort(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedShort(x); - else if (sizeof(npy_intp) == sizeof(int)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedInt(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedInt(x); - else if (sizeof(npy_intp) == sizeof(long)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedLong(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedLong(x); - else if (sizeof(npy_intp) == sizeof(PY_LONG_LONG)) - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedLongLong(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedLongLong(x); -#if 0 - else if (sizeof(npy_intp) > sizeof(short) && - sizeof(npy_intp) < sizeof(int)) /* __int32 ILP64 ? */ - return (((npy_intp)-1) < ((npy_intp)0)) ? - (npy_intp)__Pyx_PyInt_AsSignedInt(x) : - (npy_intp)__Pyx_PyInt_AsUnsignedInt(x); -#endif - PyErr_SetString(PyExc_TypeError, "npy_intp"); - return (npy_intp)-1; -} - -#if PY_MAJOR_VERSION < 3 -static PyObject *__Pyx_GetStdout(void) { - PyObject *f = PySys_GetObject((char *)"stdout"); - if (!f) { - PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); - } - return f; -} - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; - PyObject* v; - int i; - - if (!(f = __Pyx_GetStdout())) - return -1; - for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { - if (PyFile_SoftSpace(f, 1)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - v = PyTuple_GET_ITEM(arg_tuple, i); - if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) - return -1; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); - Py_ssize_t len = PyString_Size(v); - if (len > 0 && - isspace(Py_CHARMASK(s[len-1])) && - s[len-1] != ' ') - PyFile_SoftSpace(f, 0); - } - } - if (newline) { - if (PyFile_WriteString("\n", f) < 0) - return -1; - PyFile_SoftSpace(f, 0); - } - return 0; -} - -#else /* Python 3 has a print function */ - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject* kwargs = 0; - PyObject* result = 0; - PyObject* end_string; - if (!__pyx_print) { - __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); - if (!__pyx_print) - return -1; - } - if (!newline) { - if (!__pyx_print_kwargs) { - __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) - return -1; - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) - return -1; - if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { - Py_DECREF(end_string); - return -1; - } - Py_DECREF(end_string); - } - kwargs = __pyx_print_kwargs; - } - result = PyObject_Call(__pyx_print, arg_tuple, kwargs); - if (!result) - return -1; - Py_DECREF(result); - return 0; -} - -#endif - -#if PY_MAJOR_VERSION < 3 - -static int __Pyx_PrintOne(PyObject *o) { - PyObject *f; - if (!(f = __Pyx_GetStdout())) - return -1; - if (PyFile_SoftSpace(f, 0)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) - return -1; - if (PyFile_WriteString("\n", f) < 0) - return -1; - return 0; - /* the line below is just to avoid compiler - * compiler warnings about unused functions */ - return __Pyx_Print(NULL, 0); -} - -#else /* Python 3 has a print function */ - -static int __Pyx_PrintOne(PyObject *o) { - int res; - PyObject* arg_tuple = PyTuple_New(1); - if (unlikely(!arg_tuple)) - return -1; - Py_INCREF(o); - PyTuple_SET_ITEM(arg_tuple, 0, o); - res = __Pyx_Print(arg_tuple, 1); - Py_DECREF(arg_tuple); - return res; -} - -#endif - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((char)-1) > ((char)0) && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((short)-1) > ((short)0) && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((int)-1) > ((int)0) && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (((unsigned long)-1) < ((unsigned long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((long)-1) > ((long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (((long)-1) < ((long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (((signed long)-1) < ((signed long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE int __Pyx_StrEq(const char *s1, const char *s2) { - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - return *s1 == *s2; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { -#if PY_VERSION_HEX < 0x02050000 - char *api = (char *)"__pyx_capi__"; -#else - const char *api = "__pyx_capi__"; -#endif - PyObject *d = 0; - PyObject *cobj = 0; - const char *desc; - const char *s1, *s2; - union { - void (*fp)(void); - void *p; - } tmp; - - d = PyObject_GetAttrString(module, api); - if (!d) - goto bad; - cobj = PyDict_GetItemString(d, funcname); - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%s does not export expected C function %s", - PyModule_GetName(module), funcname); - goto bad; - } - desc = (const char *)PyCObject_GetDesc(cobj); - if (!desc) - goto bad; - s1 = desc; s2 = sig; - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - if (*s1 != *s2) { - PyErr_Format(PyExc_TypeError, - "C function %s.%s has wrong signature (expected %s, got %s)", - PyModule_GetName(module), funcname, sig, desc); - goto bad; - } - tmp.p = PyCObject_AsVoidPtr(cobj); - *f = tmp.fp; - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(d); - return -1; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */