### How to calculate the color pixel value in each row and column

I am working with an example of how to calculate the value of each pixel in each row and column using the following formula using Python. Formula is where M represents image matrix dimension N represents total number of pixels and P(i, j) is the color pixel value at ith row and jth column

Details