CImage:SubDarkOpt
The SubDarkOpt method corrects the thermal image signature by subtracting a statistically scaled dark frame from the current image. The scaling and subtraction are iterated until the random noise is minimized in the corrected image. The result replaces the current image.
bResult = CImage:SubDarkOpt( Dark, pixel_type=nil ) |
Dark is the CImage containing the thermal dark frame.
The optional pixel_type specifies the output pixel type as a number or string.
On success, this method returns true.
On failure, false. is returned.
This method adjusts the dark frame signal level by iteratively adjusting its signal level to minimize the residual noise after dark subtraction. The image header is automatically updated 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.
The following script loads an image and subtracts an optimized 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:
|
-- 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 correct image |
|
-- remove the image from memory |
|
-- remove the thermal frame from memory |
CImage class, SubDarkFrame, SubDarkScaled
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.