Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # parabolas: skipped
- s = numpy.ndarray((801), numpy.dtype("float32"))
- for y in range(401):
- p = (y/90.0)**2
- s[400 - y] = p
- s[400 + y] = p
- # s[0] == s[800] == 19.7531
- # for some reason grey_dilation() does not work in 1D, so I use grey_erosion with an inverted structure element
- grey_dilate = scipy.ndimage.grey_erosion(inputarray, structure = -1.0*s)
- median_filtered = scipy.ndimage.median_filter(inputarray, size = 300)
- (median_filtered - inputarray).max()
- >>> 4.0
- median_filtered2 = median_filtered - 4.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement