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 data types such as "byte" or "ushort". To avoid this problem, Mira automatically promotes the data type during the processing. If you want more numerical significance in the result for an integer type image, you can use SetDatatype before calling this method to change the image to a float or double type.
The following script fragment loads an image from file sPath and subtracts a 3 x 2 term polynomial from it. Since no CRect is specified, the entire image is fit:
I = CImage:new() |
-- create a new CImage |
I:Open( sPath ) |
-- load the image |
I:PolyFitSub(3,2) |
-- perform the operation on image I |
I:Display() |
|
I:delete() |
|