You flatten you matrix from 150x150 and got array with size 22500.

Flatten work like this:

Matrix 3x3

1 2 3

4 5 6

7 8 9

you flatten it and got array [1,2,3,4,5,6,7,8,9]

then you run argmax and got value 8(index of array)

x = 8 // 3 = 2

y = 8 % 3 = 2

thus you get matrix[2][2] == 9