3

I am using scipy.ndimage.filters.maximum_filter to find out the local maxima with the code like this:

neighborhood = ndimage.morphology.generate_binary_structure(2,2)
fore_ground=scipy.ndimage.filters.maximum_filter(iobrcbr,neighborhood)

However, when I running in python it has error:"sequence argument must have length equal to input rank". Could you please help me to fix this error? I am new in scipy.

Thanks so much.

Kind regards,

Lotus

user30985
  • 573
  • 1
  • 6
  • 19
  • 5
    I think you need to specify that `neighborhood` is the `footprint` argument of `maximum_filter`. The second positional argument is `size`. Try `maximum_filter(iobrcbr, footprint=neighborhood)`. – Warren Weckesser Dec 22 '14 at 20:20

0 Answers0