Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Operations among channels

Hi all,

I want to apply a CCM to my Pelscope application, what I need to do is, Given a 2D input Mat of CV_8UC3(for color B, G, R), I want to apply a 3x3 CCM matrix to the input:

V00, V01, V02
V10, V11, V12
V20, V21, V22,

and for output each item(i, j) in each channel is:

Output[i, j](b channel) = V00*Input[i,j](b channel) + V01*Input[i,j](g channel) + V02*input[i,j](r channel)
Output[i, j](g channel) = V10*Input[i,j](b channel) + V11*Input[i,j](g channel) + V12*input[i,j](r channel)
Output[i, j](r channel) =  V20*Input[i,j](b channel) + V21*Input[i,j](g channel) + V22*input[i,j](r channel)

Is there an API for this purpose? thanks.