135 / 177
Copyright © 2018 - 2020 Toshiba Teli Corporation, All rights reserved.
https://www.toshiba-teli.co.jp/en/
DAA00195C
GenICam function API
Control ColorCorrectionMatrix using GenICam API.
ColorCorrectionMatrix
1. Select a row element of color correction matrix by ‘
ColorCorrectionMatrixSelectorI
’.
Select a column element of color correction matrix by ‘
ColorCorrectionMatrixSelectorJ
’.
Integer value and string value of Enumeration are as follows.
Integer
String
0
R
1
G
2
B
The correspondence of ‘
ColorCorrectionMatrixSelectorI
’ and ‘
ColorCorrectionMatrixSelectorJ
’ to color
correction matrix element is as follows.
SelectorJ=R
SelectorJ=G
SelectorJ=B
SelectorI=R
SelectorI=G
SelectorI=B
mask_rg
mask_rb
mask_gr
mask_gb
mask_bg
mask_br
Corresponding elements of color correction matrix
2. Set a coefficient of color correction matrix by ‘ColorCorrectionMatrix’.
// GenICam node handle
CAM_NODE_HANDLE hSelectorI = NULL;
CAM_NODE_HANDLE hSelectorJ = NULL;
CAM_NODE_HANDLE hNode = NULL;
// Retrieve GenICam node.
Nd_GetNode(s_hCam, “ColorCorrectionMatrixSelectorI”, &hSelectorI);
Nd_GetNode(s_hCam, “ColorCorrectionMatrixSelectorJ”, &hSelectorJ);
Nd_GetNode(s_hCam, “ColorCorrectionMatrix”, &hNode);
float64_t dCoefficient[] = { 0.0,-0.2, 0.2,
-0.3,0.0,-0.4,
-0.1,-0.5,0.0 }; // 3x3 matrix
for(int64_t i=0; i<3; i++)
{
for(int64_t j=0; j<3; j++)
{
if(i != j)
{
// 1.Select a color correction matrix element
Nd_SetEnumIntValue(s_hCam, hSelectorI, i);
Nd_SetEnumIntValue(s_hCam, hSelectorJ, j);
// 2.Set a coefficient of color correction matrix.
Nd_SetFloatValue(s_hCam, hNode, dCoefficient);
}
}
}