[SciPy-User] Focal Majority
Nyberg, Bjorn Johan
Mon Feb 20 16:14:29 CST 2012
I have an interesting problem and I was hoping I could get some ideas here. I want to apply a focal majority within a moving 3 x 3 window whereby if there is a majority (any type of majority i.e. more than 5 cells having the same value), assign the center cell a value of 1 otherwise assign a value of 0. Now I realize in scipy and numpy there are options with convolutions methods but I am not entirely certain of how to apply a condition statement that I would require into the window calculations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User