Please enable JavaScript to view this site.

uEye .NET Manual 4.97

The Lut class provides methods for setting the hardware or software LUT for uEye cameras. This LUT will be applied to the image in the camera. A number of predefined LUTs are available. Alternatively, you define your own LUT. It is possible to define a LUT without enabling it at the same time.

Each lookup table (LUT) for the uEye contains modification values for the image brightness and contrast parameters. When a LUT is used, each brightness value in the image will be replaced by a value from the table. LUTs are typically used to enhance the image contrast or the gamma curve. The values must be in the range between 0.0 and 1.0. A linear LUT containing 64 equidistant values between 0.0 and 1.0 has no effect on the image.

The following class and methods exist:

Preset

Raw

Methods

Method

Description

GetEnable

Enables/disables the LUT.

GetMode

Returns the current set LUT mode.

GetState

Returns the current state of the LUT.

GetStateInfo

Returns current state information of the LUT.

GetSupportedInfo

Returns the current support information of the LUT

GetValuesComplete

Returns the LUT values set by the user after the gamma, contrast and brightness values have been taken into account.

GetValuesPreset

Returns the predefined LUT.

GetValuesUser

Returns the LUT values set by the user without modifications.

Load

Loads and sets the LUT from a file.

Save

Saves a set LUT into a file.

SetEnable

Enables/disables the LUT.

SetMode

Sets the LUT calculation mode.

SetPreset

Sets a predefined LUT.

SetValuesUser

Sets the LUT values of the user.

Example 1

// Enable the last set LUT
hCam.Lut.Enabled = true;

Example 2

// Force LUT and gamma to be included in software (former gamma behavior for cameras with USB 3)
hCam.Lut.SetMode(uEye.Defines.LutMode.ForceSoftware);

Example 3

// Readout the current LUT state
uEye.Defines.LutState state;
hCam.Lut.GetState(out state);
 
// Readout the current LUT support information
uEye.Types.LutState stateInfo;
hCam.Lut.GetStateInfo(out stateInfo);

Example 4

// Set sigmoid function as user-defined LUT (scaled in x from [-6.0,6.0] to [0.0,1.0]
// Sigmoid function is S(x) = 1 / (1 + e^(-x))
double[] rgbLutConf = new double[64];
rgbLutConf[0] = 0.0;
for (int i = 0; i < rgbLutConf.Length; i += 2)
{
// Start point of the next linear apporiximation segment is the end point of the previous segment.
if (i > 0)
{
  rgbLutConf[i] = rgbLutConf.[i - 1];
}
// Calculate the value used in the scaled interval [0.0, 1.0]
double dXPosWideRange = (((i + 1) / 64.0) - 0.5) * 12.0; /* Current position in the interval [0.0,1.0] stretched to [-6.0,6.0] */
rgbLutConf[i + 1] = 1.0 / (1.0 + Math.Exp(-dXPosWideRange));
}
rgbLutConf[63] = 1.0; /* Set end value to 1.0 */
 
// Set the calculated LUT
hCam.Lut.SetValuesUser(rgbLutConf, rgbLutConf, rgbLutConf);

Example 5

// Readout of the set LUT
// User-defined LUT (without included gamma)
double[] rLutConfUser;
double[] gLutConfUser;
double[] bLutConfUser;
uEye.Defines.Status state = hCam.Lut.GetValuesUser(out rLutConf, out gLutConf, out bLutConf);
 
// Complet LUT (with included gamma)
double[] rLutConfComplete;
double[] gLutConfComplete;
double[] bLutConfComplete;
hCam.Lut.GetValuesComplete(out rLutConfComplete, out gLutConfComplete, out bLutConfComplete);

Example 6

// Set predefined LUT "Glow1"
// Firstly load GLOW1
double[] rLutConf;
double[] gLutConf;
double[] bLutConf;
uEye.Defines.Status state = hCam.Lut.GetValuesPreset(uEye.Defines.LutPreset.Glow1, out rLutConf, out gLutConf, out bLutConf);
 
// Secondly set GLOW1
if (state == uEye.Defines.Status.SUCCESS)
{
hCam.Lut.SetValuesUser(rLutConf, gLutConf, bLutConf);
}

Example 7

// Load the "lutFile.xml" file and set LUT
hCam.Lut.Load("lutFile.xml");
 
// Save the current set LUT into the "lutFile2.xml" file
hCam.Lut.Save("lutFile2.xml");