home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
demo
/
wit4711
/
lib
/
help
/
point
/
lutgen.
/
lutgen.bin
Wrap
Text File
|
1995-12-09
|
2KB
|
77 lines
OPERATOR
lutGen --- generate a lookup table
DESCRIPTION
The lutGen operator sources a lookup table by parsing a C expression
representing the desired mapping function. The indexes to the look-up table
range between the parameters lo and hi inclusively. In other words, the lut
provides a mapping between integers x contained in the range [lo..hi] and the
function f(x) as defined by the parameter expression . The userConstant parameter
allows the user to specify a constant for use within the expression. For
more on the syntax and usage of expression see calc .
In versions prior to WIT 4.0, the variable z was used within the expression
string to reference the values within the range [lo..hi]. In versions 4.0 and
onward, the user is encouraged to use the variable A instead of z .
Similarly, the variable Z was used to reference the user constant and now the
user is encouraged to use the variable k instead.
With the above components, any of the common mapping functions can be
constructed. Refer to the table below for a list of the most useful.
Function Equation
digital negative
f(A) = k-A k-A
where k=maximum pixel value
thresholding
f(A) = k if A > threshold, (A > threshold) ? k : 0
otherwise 0
slicing with background
f(A) = k if r1<=A<=r2, (A <= r2) ? ((A >= r1) ? k : A) : A
otherwise A
slicing without background
f(A) = k if r1<=A<=r2, (A <= r2) ? ((A >= r1) ? k : 0) : 0
otherwise 0
range compression
f(A) = c*log10(1+abs(A)) (k/log10(1+k))*log10(1+abs(A))
where c = k/log10(1+k)
bit removal, msb
f(A) = 2*A%(k+1) 2*A%(k+1)
bit removal, lsb
f(A) = 2*(A/2) 2*(A/2)
bit extraction
f(A) = k*(i-2*j) k*(((A/2)**(8-n))-2*((A/2)**(8-(n-1))))
where i = A/2**(B-n) and
j = A/2**(B-(n-1))
B = number of bits
per image
n = nth most significant
bit to extract