相关文章推荐
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

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, 2014 at 20:20

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.