2.6.1.7 imgFuncLUT(Pro)

Menu Information

Image: Adjustments: Function LUT

Brief Information

Apply lookup table function to image

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. imgFuncLUT img:=1 fact:=10 oimg:=2;

2. imgFuncLUT img:=[Mbook1]Msheet1!mat(1) fact:=50 func:=ln channel:=green;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix img

Input

Image

<active>

Specifies the input image. The default is the active image.

Factor fact

Input

int

0

Specifies the factor used to create the lookup table.

Function func

Input

int

exp

Specifies the function used to create the lookup table.
Option list

  • E:Exp
    Exponential function
  • L:Ln
    Ln function
  • S:Sigmoid
    Sigmoid function
Channel channel

Input

int

rgb

Specifies the color channel to apply the lookup table function.
Option list

  • RGB:RGB
    All channels
  • R:Red
    Red channel
  • G:Green
    Green channel
  • B:Blue
    Blue channel
Output Image oimg

Output

Image

<input>

Specifies the output image. By default, the output image is the input image. See the syntax here.

Look Up Table lut

Output

vector

<new>

Specifies the lookup table output, which is a single-column table that contains the lookup values.


Description

This X-Function can be used to change the color values in a specified color channel (RGB, R, G, or B) so as to enhance the color of the input image. The color change is based on a lookup table, which maps the original color values into new color values. The lookup table is generated using a function and a factor specified by user. Currently, three functions are available:

  • Exponential
  • Ln
  • Sigmoid

Additionally, the Lookup Table includes an option to save the lookup table data.

Dailog of Lookup Table options.png


Examples

In the following example, we use 50 as Factor and select Ln Function to apply the LUT function to the green channel:

  1. When the input image is active, choose Image: Adjustments: Function LUT from the menu. This opens the dialog of the X-Function.
  2. In the X-Function dialog, change the settings as the screenshot below and click OK to close the dialog.
    ImgFuncLUT help English files image002.jpg
We can see that the input image is replaced by the modified image and many features in the green channel are improved.
ImgFuncLUT help English files image004.jpg
ImgFuncLUT help English files image006.jpg
Original image
Output image


OriginPro includes the ability to automatically recalculate the analysis results of the Lookup Table operation any time you change the parameters or update your source data. In addition, the settings for this analysis routine can be saved to an analysis theme for use later with similar data.

Algorithm

When different functions are chosen, the lookup tables are generated in different ways.

If the exponential function is selected, the lookup table is calculated with the following equation:

ImgFuncLUT help English files image008.gif

where

ImgFuncLUT help English files image010.gif

If the Ln function is selected, the lookup table is calculated with the following equation:

ImgFuncLUT help English files image012.gif

where:

ImgFuncLUT help English files image014.gif

If the sigmoid function is selected, the lookup table is calculated with the following equation:

ImgFuncLUT help English files image016.gif

where:

ImgFuncLUT help English files image018.gif

The creation of the LUT uses L_GetFunctionalLookupTable() function from LEADTOOLS Main API. And the remapping of the intensities is based on L_RemapBitmapIntensity() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_GetFunctionalLookupTable topic and the L_RemapBitmapIntensity topic for more information.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgHue, imgColorReplace, imgSaturation, imgGamma