CImage:PolyFitDiv


The PolyFitDiv method fits a 2-D polynomial of intensity versus position and divides it into the image.

Syntax

bResult = CImage:PolyFitDiv( 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 divided into every pixel as a function of position.

When applying this method to integer pixel types, the resulting image will have very low signal to noise ratio because all the mathematical significance will be truncated to values near 1. To avoid this problem, Mira automatically promotes the pixel type to float or double as part of the processing.

Example

The following script loads an image from file sPath and divides a 3 x 2 term polynomial. A dark defect exists in the region (300:350, 200:300). This is omitted from the fit by specifying the region to a CRect R:

I = new_image()

-- create a new CImage

I:Open( sPath )

-- load the image

R = new_rect(300,350,200,300)

-- omit a dark defect from the fit

I:PolyFitDiv(3,2,true,R)

-- perform the operation on image I

I:Display()

 

I:delete()

 

R:delete()

 

Related Topics

CImage class, PolyFitSub, PolyFitImage


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