CImage:SubDarkFrame


The SubDarkFrame method corrects the thermal image signature by subtracting a dark frame from the current image. The result replaces the current image.

Syntax

bResult = CImage:SubDarkFrame( Dark, pixel_type=nil )

bullet.gif    Dark is the CImage containing the thermal dark frame.

bullet.gif    The optional pixel_type specifies the output pixel type as a number or string.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, false. is returned.

Remarks

This method applies a dark frame correction to the image and updates the image header with the appropriate history and other keywords. The pixel type of the image may be changed as part of the correction, for example, to increase the precision of the dark correction. Mira automatically handles mixing different pixel types between the source image and the dark frame.

Example

The following script loads an image and subtracts a dark frame. The output pixel type is changed to "float" to maintain precision of the correction process. In practice you might maintain the dark frame in memory across a loop to process many images:

I = new_image()

-- create a new CImage

I:Open( sPath )

-- load the image from file sPath

Dark = new_image()

-- create a new CImage

Dark:Open( sDarkName )

-- load the dark frame from sDarkName

I:SubDarkFrame(Dark,"float")

-- remove the dark frame from image I

I:Save()

 -- save the image

I:delete()

 -- delete the image from memory

Dark:delete()

 -- delete the thermal frame from memory

Related Topics

CImage class, SubDarkScaled, SubDarkOpt


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