I\'d like to optimize this piece of code :
public void PopulatePixelValueMatrices(GenericImage image,int Width, int Height) { for (int x = 0;
matrix's addition complexity is O(n^2), in number of additions.
O(n^2)
However, since there are no intermediate results, you can parallelize the additions using threads: