1 | initial version |
no, unfortunately you cannot define your own colorspace.
an efficient way to do so will be quite advanced, just look at imgproc/src/color.cpp, to get an impression.
i can only offer an "easy to use" solution with transform
Mat bgr = ... // input
Mat ycgco; // output
Mat_<float> m(3,3); // values taken from wikipedia
m << .25, .5, .25,
-.25, .5, -.25,
.5, 0, -.5;
transform(bgr, ycgco, m);