CImage:PolyFitImage
The PolyFitImage method fits a 2-D polynomial of intensity versus position and evaluates it in the image. Thee evaluated fit replaces all pixels of the original image.
bResult = CImage:PolyFitImage( 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 evaluated at each pixel location and inserted into the image. The result is a very smooth image. Unless the input image has very high dynamic range or is in a floating point pixel type, the output image can have serious Mach banding. If the image is not a color form, Mira avoids this problem by automatically promoting the image pixel type as part of the processing.
The following script loads an image from file sPath and fits a 7 x 4 term polynomial. The evaluated polynomial is replaced into the image. Since no CRect is specified, the entire image is fit:
|
-- create a new CImage |
|
-- load the image |
|
-- perform the operation on image I |
|
|
|
|
fitpoly1d function
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.