Masks the thermal image by retaining only pixels that fall within a specified
temperature window. Pixels outside this range are set to NA (background).
Arguments
- img_obj
A 'BioThermR' object.
- threshold
Numeric vector of length 2, e.g.,
c(22, 38). Defines the inclusive temperature range[min, max]to keep. UseInffor open upper bounds (e.g.,c(25, Inf)keeps everything above 25 degrees Celsius).- use_processed
Logical.
If
FALSE(default): The filter is applied to the raw matrix, discarding any previous masks.If
TRUE: The filter is applied to the processed matrix, allowing for cumulative masking (e.g., refining an Otsu segmentation).
Details
This is the most fundamental segmentation method for thermal images.
Since animals are typically warmer than their environment, a simple low-pass filter
(e.g., keep > 22 degrees Celsius) is often sufficient to separate the subject from the cage.
Open boundaries can be defined using Inf or -Inf.