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

bSuccess = CImage:PolyFitImage( ct, rt )

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

bSuccess = CImage:PolyFitImage( 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 region 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 evaluated at each pixel location and inserted into the entire image. 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 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

PolyFitSub

PolyFitDiv

CImage class