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

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store