[python-arrayfire] 33/250: FEAT: Adding vision functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:28 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 5082e0064b4f6994f2e028b730e7a2a7821d3c32
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Wed Jul 15 17:54:07 2015 -0400

    FEAT: Adding vision functions
---
 arrayfire/__init__.py |  1 +
 arrayfire/vision.py   | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/arrayfire/__init__.py b/arrayfire/__init__.py
index 12e0a3e..39d38ec 100644
--- a/arrayfire/__init__.py
+++ b/arrayfire/__init__.py
@@ -19,3 +19,4 @@ from .lapack     import *
 from .signal     import *
 from .image      import *
 from .features   import *
+from .vision     import *
diff --git a/arrayfire/vision.py b/arrayfire/vision.py
new file mode 100644
index 0000000..3f340e1
--- /dev/null
+++ b/arrayfire/vision.py
@@ -0,0 +1,39 @@
+#######################################################
+# 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 *
+from .features import *
+
+def fast(image, threshold=20.0, arc_length=9, non_max=True, feature_ratio=0.05, edge=3):
+    out = features()
+    safe_call(clib.af_fast(pointer(out.feat),\
+                           image.arr, c_float(threshold), c_uint(arc_length), non_max, \
+                           c_float(feature_ratio), c_uint(edge)))
+    return out
+
+def orb(image, threshold=20.0, max_features=400, scale = 1.5, num_levels = 4, blur_image = False):
+    feat = features()
+    desc = array()
+    safe_call(clib.af_orb(pointer(feat.feat), pointer(desc.arr),\
+                          c_float(threshold), c_uint(max_features),\
+                          c_float(scale), c_uint(num_levels), blur_image))
+    return feat, desc
+
+def hamming_matcher(query, database, dim = 0, num_nearest = 1):
+    index = array()
+    dist = array()
+    safe_call(clib.af_hamming_matcher(pointer(idx.arr), pointer(dist.arr),\
+                                      query.arr, database.arr, \
+                                      c_longlong(dim), c_longlong(num_nearest)))
+    return index, dist
+
+def match_template(image, template, match_type = AF_SAD):
+    out = array()
+    safe_call(clib.af_match_template(pointer(out.arr), image.arr, template.arr, match_type))
+    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