Ask Your Question

wennho's profile - activity

2014-02-27 16:08:20 -0600 asked a question Apply transformation matrix to pixels in OpenCV image

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?