import numpy as np
import matplotlib.image as img;
C = 1.0-np.mean(img.imread('circle.png'),axis=2);
C /= np.sum(C);
The image has 256 X 256 pixels. The resulting array C
appears to be a 256 X 256 array containing probabilities of each pixel (color, depth, I don't know what the probability is of due to my lack of knowledge of what matplotlib.image.imread
does.
I understand the 4th line of code to mean probability values (real data normalized by their sum, so that they sum to 1), but what is the meaning of the formula on the 3rd line of the code, in and outside of the image context, i.e. statistical intuition?
Ultimately, I would like to apply the above probability transformation to a single time series of real data, so I'm wondering if the formula 1.0-np.mean()
would still apply for my (non-computer vision, but distributional) application