[python-arrayfire] 171/250: FEAT: Adding separable convolution for 2D images
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:45 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 764238e23b6d1a80225842dab60aa8702c75646b
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Wed Dec 9 19:19:05 2015 -0500
FEAT: Adding separable convolution for 2D images
---
arrayfire/signal.py | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/arrayfire/signal.py b/arrayfire/signal.py
index fa50385..b663869 100644
--- a/arrayfire/signal.py
+++ b/arrayfire/signal.py
@@ -923,6 +923,37 @@ def convolve2(signal, kernel, conv_mode = CONV_MODE.DEFAULT, conv_domain = CONV_
conv_mode.value, conv_domain.value))
return output
+def convolve2_separable(col_kernel, row_kernel, signal, conv_mode = CONV_MODE.DEFAULT):
+ """
+ Convolution: 2D separable convolution
+
+ Parameters
+ -----------
+
+ col_kernel: af.Array
+ - A column vector to be applied along each column of `signal`
+
+ row_kernel: af.Array
+ - A row vector to be applied along each row of `signal`
+
+ signal: af.Array
+ - A 2 dimensional signal or batch of 2 dimensional signals.
+
+ conv_mode: optional: af.CONV_MODE. default: af.CONV_MODE.DEFAULT.
+ - Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or
+ maintains the same size as input (af.CONV_MODE.DEFAULT).
+ Returns
+ --------
+
+ output: af.Array
+ - Output of 2D sepearable convolution.
+ """
+ output = Array()
+ safe_call(backend.get().af_convolve2_sep(ct.pointer(output.arr),
+ col_kernel.arr, row_kernel.arr,signal.arr,
+ conv_mode.value))
+ return output
+
def convolve3(signal, kernel, conv_mode = CONV_MODE.DEFAULT, conv_domain = CONV_DOMAIN.AUTO):
"""
Convolution: 3D
--
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