Operations among channels

asked 2015-03-23 12:13:45 -0600

Pelscope gravatar image

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.

edit retag flag offensive close merge delete

Comments

what is a CCM ?

are you looking for transform ?

berak gravatar imageberak ( 2015-03-23 12:18:58 -0600 )edit

CCM stands for Color Correlated Matrix, an operation in Camera AWB. It is a kind of transform, but its calculation is among all the Mat channels, not within the same channel.

Pelscope gravatar imagePelscope ( 2015-03-23 15:35:07 -0600 )edit