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.

Syntax

bResult = CImage:PolyFitImage( ct, rt, bConserve=true, CRect=nil )

bullet.gif    ct is the number of column fit terms, 1 to 10.

bullet.gif    rt is the number of row direction fit terms, 1 to 10.

bullet.gif    bConserve preserves the central sigma level, defaults to true.

bullet.gif    CRect defines a CRect region to be excluded from the fit. If omitted or nil, the entire image is fit.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

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.

Example

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:

I = new_image()

-- create a new CImage

I:Open( sPath )

-- load the image

I:PolyFitImage(7,4)

-- perform the operation on image I

I:Display()

 

I:delete()

 

Related Topics

CImage class, PolyFitSub, PolyFitDiv


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.