Hello,
as far as I passed through your code, i found two possible mistakes:
1.) The most inner for-loop of your mean calculations does produce
arrays with all elements the same value. I guess this loop is
maybe not nessessary, because it is not nessesary to walk though each
cell/element. The Mean function handles Arrays.
2.) The use of the Shiftregisters for checking changes in row 1 and 2
is comparing neigbor elements in the array, i'm not shure, if
this was your goal.
To determine changes in row 1 and 2, you need a buffer which remembers
somehow the old values of the rows 1 and 2. You can realize a buffer by
using shiftregisters in the most outer for-loop or with a local or
global variable.
You should also use own SubVIs, if possible, to keep your code more readable and keep a better overview.
I recommend you to read the "LabVIEW developer Guidelines", the include very helpfull tipps.
best regards,
Karlos