Counting of adjacent cells in a numpy array

后端 未结 2 1516
执念已碎
执念已碎 2020-12-19 14:19

Past midnight and maybe someone has an idea how to tackle a problem of mine. I want to count the number of adjacent cells (which means the number of array fields with other

2条回答
  •  感动是毒
    2020-12-19 14:35

    I think you already got it. after dilation, the number of 1 is 19, minus 5 of the starting shape, you have 14. which is the number of zeros surrounding your shape. Your total of 24 has overlaps.

提交回复
热议问题