Now, I have a cropland map. It's only one band, 1=cropland,0=Non-cropland. So how to calculate how many pixels=1 in a 3*3 kernel? and then get a map of contain the numbers.
eg:
[1,0,1],
[1,0,1],
[1,1,0]
stand for 9 pixels. how to get the number of '1' =6?