Reduce acumulation matrix to fit the size of the original image