CImage:PolyFitSub


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

Syntax

bResult = CImage:PolyFitSub( 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 subtracted from every image pixel as a function of position.

After subtracting the polynomial, the signal level can drop below the minimum allowed for some integer pixel types such as "byte" or "ushort". To avoid this problem, Mira automatically promotes the pixel type during the processing. If you want more numerical significance in the result for an integer type image, you can use SetPixelType before calling this method to change the image to a float or double type.

Example

The following script loads an image from file sPath and subtracts a 3 x 2 term polynomial. Since no CRect is specified, the entire image is fit:

I = new_image()

-- 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

CImage class, PolyFitDiv, PolyFitImage


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