CImage:PolyFitDiv CImage:PolyFitSub

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 )

    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.

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 data 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 data type as part of the processing.

Example

The following script fragment 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 = CImage:new()

-- 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, PolyFitSub, PolyFitDiv