Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- arr = np.random.randint(0, 256, (200, 200), dtype=np.uint8)
- def func(arr1d):
- kernel = np.ones(3) / 3
- return np.convolve(arr1d, kernel, mode='same')
- first_pass = np.apply_along_axis(func, axis=0, arr=arr)
- final_result = np.apply_along_axis(func, axis=1, arr=first_pass)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement