|
CImage:ScalePolyVal
The ScalePolyVal method applies a 1-D
polynomial function of pixel value. The polynomial is independent
of image coordinate.
Syntax
|
bResult = CImage:ScalePolyVal(
CPolynomial )
|
The
CPolynomial is the set of polynomial
coefficients.
On success,
this method returns
true.
On failure,
this method returns
false.
Remarks
This method applies a polynomial function of pixel
value, independent of position in the image. One application of
this method is in applying a linearity correction.
When applying this method to by the
pixel type, Mira handles value overflow by truncating
the output pixel value at the limits for the pixel type. For
example, applying this method to a short type image may
result in pixel values outside the range [-32768, 32767]. Although
Mira automatically truncates the result to this range, you may need
to retain the values that fall outside the pixel type limits. To
avoid the truncation, you may wish to call
SetPixelType to promote the current image to a
"larger" pixel type, such as long or float, before
performing the ScalePolyVal operation.
Example
Assume that a CPolynomial P contains coefficients that correct non-linear
signal response in the image. The following script loads an image
from files sPath, applies the linearity
correction, and displays the result:
|
I = new_image()
|
|
|
I:Open( sPath )
|
|
|
if I:GetPixelType() <=
3 then
|
|
|
I:SetPixelType("float")
|
|
|
end
|
|
|
I:ScalePolyVal(
P )
|
|
|
I:Display()
|
|
|
I:delete()
|
|
Related Topics
CImage class
ScaleLinVal
PolyFitSub
PolyFitDiv
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|