¡@

Home 

python Programming Glossary: filtsize

Using strides for an efficient moving average filter

http://stackoverflow.com/questions/4936620/using-strides-for-an-efficient-moving-average-filter

value to the pixel in the new image. import numpy scipy filtsize 3 a numpy.arange 100 .reshape 10 10 b numpy.lib.stride_tricks.as_strided.. 10 10 b numpy.lib.stride_tricks.as_strided a shape a.size filtsize strides a.itemsize a.itemsize for i in range 0 filtsize 1 if.. filtsize strides a.itemsize a.itemsize for i in range 0 filtsize 1 if i 0 b numpy.roll b pow filtsize 2 1 i 0 filtered numpy.sum..