CImage:PolyFitSub


The PolyFitSub method fits a 2-D polynomial of intensity versus position and subtracts it from the image.

Syntax

bSuccess = CImage:PolyFitSub( ct, rt )

bSuccess = CImage:PolyFitSub( ct, rt, bConserve )

bSuccess = CImage:PolyFitSub( ct, rt, bConserve, CRect )

where

    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 rectangle to be excluded from the fit. If omitted or nil, the entire image is fit.

    bSuccess is the returned success code. On success it is true, otherwise 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. To preserve dynamic range, Mira automatically promotes the data type to a floating point format.

Example

The following script 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()

 

Related Topics

PolyFitDiv

PolyFitImage

CImage class