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.
bResult = CImage:SubDarkFrame( Dark, datatype=nil ) |
This method applies a dark frame correction to the image and updates the image header with the appropriate history and other keywords. The data 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 data types between the source image and the dark frame.
The following script fragment loads an image and subtracts a dark frame. The output data 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:
|
-- create a new CImage |
|
-- load the image from file sPath |
|
-- create a new CImage |
|
-- load the dark frame from sDarkName |
|
-- remove the dark frame from image I |
|
-- save the image |
|
-- delete the image from memory |
|
-- delete the thermal frame from memory |