User Manual - twentynine
8.2.7
Matrix Multiplication 3x3
N-by-N matrices are commonly used to transform RGB colors, scale them and control hue, saturation and
contrast. The
CameraSuite SDK
provides a configurable 3-by-3 matrix for various applications, modifying
color images using matrix multiplication operations.
Note
For these operations to be correct, they must be operated on linear brightness values.
If the input image is in a non-linear brightness space, RGB colors must be transformed
into a linear space before these matrix operations are used.
Figure 111 shows how the matrix multiplication is done, where m
x x
are the matrix elements, R
i
/ G
i
/ B
i
are the input original values for the red, green and blue channel and R
o
/ G
o
/ B
o
are the output color
values for the red, green and blue channel.
m
00
m
01
m
02
m
10
m
11
m
12
m
20
m
21
m
22
×
R
i
G
i
B
i
=
R
o
G
o
B
o
Figure 111: Matrix Multi RGB parameters and results
In effect, this calculates:
R
o
=
m
00
·
R
i
+
m
01
·
G
i
+
m
02
·
B
i
G
o
=
m
10
·
R
i
+
m
11
·
G
i
+
m
12
·
B
i
B
o
=
m
20
·
R
i
+
m
21
·
G
i
+
m
22
·
B
i
Common applications for the 3x3 matrix operation are for example color correction, color balancing and the
conversion from color to luminance.
Matrix Multiplication 3x3 in the CameraSuite SDK
In the
CameraSuite SDK
the
ImageProcAPI
provides the programming interface to configure and execute
the 3x3 matrix multiplication algorithm. The bit depths and image types supported are shown in Table 59.
Supported bit depth
Supported image input
8 bit per channel
16 bit per channel
Monochrome
X
X
Raw Bayer
X
X
Color RGB
X
X
Table 59: Matrix Multiplication - supported bit depth and image type
134
SMARTEK Vision | User Manual - twentynine | Doc. v1.0.2