[python-arrayfire] 32/250: FEAT: adding features class

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.

commit 9d1380f453a3bb63a9f585912cdd1a2cf305f5a2
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Wed Jul 15 17:53:47 2015 -0400

    FEAT: adding features class
---
 arrayfire/__init__.py |  1 +
 arrayfire/features.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/arrayfire/__init__.py b/arrayfire/__init__.py
index 7bd60f3..12e0a3e 100644
--- a/arrayfire/__init__.py
+++ b/arrayfire/__init__.py
@@ -18,3 +18,4 @@ from .statistics import *
 from .lapack     import *
 from .signal     import *
 from .image      import *
+from .features   import *
diff --git a/arrayfire/features.py b/arrayfire/features.py
new file mode 100644
index 0000000..c020aae
--- /dev/null
+++ b/arrayfire/features.py
@@ -0,0 +1,49 @@
+#######################################################
+# Copyright (c) 2015, ArrayFire
+# All rights reserved.
+#
+# This file is distributed under 3-clause BSD license.
+# The complete license agreement can be obtained at:
+# http://arrayfire.com/licenses/BSD-3-Clause
+########################################################
+from .library import *
+from .array import *
+import numbers
+
+class features(object):
+
+    def __init__(self, num=None):
+        self.feat = c_longlong(0)
+        if num is not None:
+            assert(isinstance(num, numbers.Number))
+            safe_call(clib.af_create_features(pointer(self.feat), c_longlong(num)))
+
+    def num_features():
+        num = c_longlong(0)
+        safe_call(clib.af_get_features_num(pointer(num), self.feat))
+        return num
+
+    def get_xpos():
+        out = array()
+        safe_call(clib.af_get_features_xpos(pointer(out.arr), self.feat))
+        return out
+
+    def get_ypos():
+        out = array()
+        safe_call(clib.af_get_features_ypos(pointer(out.arr), self.feat))
+        return out
+
+    def get_score():
+        out = array()
+        safe_call(clib.af_get_features_score(pointer(out.arr), self.feat))
+        return out
+
+    def get_orientation():
+        out = array()
+        safe_call(clib.af_get_features_orientation(pointer(out.arr), self.feat))
+        return out
+
+    def get_size():
+        out = array()
+        safe_call(clib.af_get_features_size(pointer(out.arr), self.feat))
+        return out

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git



More information about the debian-science-commits mailing list