Focal Majority - yes, really, majority

860
1
02-19-2012 03:46 PM
curtvprice
MVP Esteemed Contributor
Reposting:

Hi Everyone,
I have an interesting problem that I was hoping that I could get some ideas here on the forums. I want to apply a technique similar to that of the focal statistics majority method however, instead of assigning the value of the center cell that of the majority value I want to assign a predefined number. In other words, if in a 3x3 window, 5 cells that have a value of 4 assign the center cell a value of 1, 5 cells have a value of 8 assign the center cell a value of 1, however if there is no majority (i.e greater than 50%) assign a value of 0. I've heard that Focal Statistics or a moving window might be possible in Numpy? Any ideas on where to start?

Thanks
0 Kudos
1 Reply
JohanL
by
New Contributor
Thanks @curtvprice for the repost.

Yes, any help would be most appreciated... currently exploring options in numpy.
0 Kudos