The average of some values is sum of values divided by number of values.
At best this code is weird:
ptrResult[0] = (byte)(((ptr1[0] + ptr2[0] + ptr3[0]) + (2 - 1) * ptr4[0] * ptr5[0]) / average);
replacing with
ptrResult[0] = (byte)((ptr1[0] + ptr2[0] + ptr3[0] + ptr4[0] + ptr5[0]) / 5);
should be better.