Filter 2D array and return co-ordinates from intermediate
问题 I have a 2D array of zeros with some positive integers at (1,6) and (2,7): [[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 2. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 2. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]] And I want to filter the array by a custom kernel: [[1 0 1] [0 1 0] [0 1 0]] I want to filter the array with this kernel and when 2 or 3 of the ones in this kernel are multiplied by a positive integer, I want