CImage:PolyFitSub
The PolyFitSub method fits a 2-D polynomial of intensity versus position and subtracts it from the image.
bResult = CImage:PolyFitSub( ct, rt, bConserve=true, CRect=nil ) |
ct is the number of column fit terms, 1 to 10.
rt is the number of row direction fit terms, 1 to 10.
bConserve preserves the central sigma level, defaults to true.
CRect defines a CRect region to be excluded from the fit. If omitted or nil, the entire image is fit.
On success, this method returns true.
On failure, this method returns false.
This method fits a polynomial to the image intensity as a function of (x,y) position. The polynomial is then subtracted from every image pixel as a function of position.
After subtracting the polynomial, the signal level can drop below the minimum allowed for some integer pixel types such as "byte" or "ushort". To avoid this problem, Mira automatically promotes the pixel type during the processing. If you want more numerical significance in the result for an integer type image, you can use SetPixelType before calling this method to change the image to a float or double type.
The following script loads an image from file sPath and subtracts a 3 x 2 term polynomial. Since no CRect is specified, the entire image is fit:
|
-- create a new CImage |
|
-- load the image |
|
-- perform the operation on image I |
|
|
|
|
CImage class, PolyFitDiv, PolyFitImage
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.