Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

medfilt1 calculates median for dim1 only, then copies this to all other dims #231

Open
AndyP103 opened this issue Jun 17, 2020 · 0 comments

Comments

@AndyP103
Copy link

In arrayfire previously, I've used medfilt1 to apply a median filter to multiple dimensions. However, in the python binding the output from dim1 is copied to all other dims.

For example:
import arrayfire as af
data = af.randn(10, 10)
filt_data = af.medfilt1(data, 3)

filt_data.to_ndarray()
array([[ 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ,
0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ],
[ 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ,
0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ],
[ 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ,
0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 , 0.3926208 ],
[-0.2309244 , -0.2309244 , -0.2309244 , -0.2309244 , -0.2309244 ,
-0.2309244 , -0.2309244 , -0.2309244 , -0.2309244 , -0.2309244 ],
[ 0.43086785, 0.43086785, 0.43086785, 0.43086785, 0.43086785,
0.43086785, 0.43086785, 0.43086785, 0.43086785, 0.43086785],
[-0.24984777, -0.24984777, -0.24984777, -0.24984777, -0.24984777,
-0.24984777, -0.24984777, -0.24984777, -0.24984777, -0.24984777],
[ 0.43086785, 0.43086785, 0.43086785, 0.43086785, 0.43086785,
0.43086785, 0.43086785, 0.43086785, 0.43086785, 0.43086785],
[-0.82585084, -0.82585084, -0.82585084, -0.82585084, -0.82585084,
-0.82585084, -0.82585084, -0.82585084, -0.82585084, -0.82585084],
[ 0.26141813, 0.26141813, 0.26141813, 0.26141813, 0.26141813,
0.26141813, 0.26141813, 0.26141813, 0.26141813, 0.26141813],
[ 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ]],
dtype=float32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant