title: Fastest way to apply color matrix to RGB image using OpenCV 3.0?
body: <p>I have a color image represented as an OpenCV Mat object  (C++, image type CV_32FC3). I have a color correction matrix that I want to apply to each pixel of the RGB color image (or BGR using OpenCV convention, doesn't matter here). The color correction matrix is 3x3. </p>
  
  <p>I could easily iterate over the pixels and create a vector v (3x1) representing RGB, and then compute M*v, but this would be too slow for my real-time video application.</p>
  
  <p>The cv::cvtColor function is fast, but does not seem to allow for custom color transformations. 
  <a href="http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor" rel="nofollow noreferrer">http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor</a></p>
  
  <p>Similar to the following, but I am using OpenCV for C++, not Python.
  <a href="https://stackoverflow.com/questions/22081423/apply-transformation-matrix-to-pixels-in-opencv-image">Apply transformation matrix to pixels in OpenCV image</a></p>