测试发现NIvision中实际使用的公式是:
int brightness=199;
float contrast=61.38;
float gamma=0.52;
uchar lut[256];
float k = tan(contrast*CV_PI / 180);
for (int i = 0; i < 256; i++)
{
lut[i] = saturate_cast<uchar>(k*(pow(i, gamma)/ pow(255, gamma) * 255 - 128) + 128 + (brightness- 128));
}
与Nivsion Vision Assistant 界面上显示的LookUp Table可能不一致