I want to change the color basis of an image from RGB to something else. I have a matrix M that I want to apply to each pixel's RGB, which we can define as xij.
I am currently iterating over each pixel of the NumPy image and calculating Mxij manually. I can't even vectorize it over the rows, because the RGB is a 1x3 instead of a 3x1 array.
Is there a better way to do this? Maybe a function in OpenCV or NumPy?