# Pixel-wise matrix multiplication

I want to multiply every pixel in an image with a 3x3 matrix, treating every pixel as a 3D-vector of colors. In mathematical terms the operation would be something like:

**u** = **M** **v**

where **u** is the resulting pixel value, **M** the (3x3) matrix, and **v** the original pixel value.

I have searched the documentation but have not been able to find a way to do this in OpenCV. Does anybody have any suggestions?