aws.osml.gdal.dynamic_range_adjustment module
- class aws.osml.gdal.dynamic_range_adjustment.DRAParameters(suggested_min_value: float, suggested_max_value: float, actual_min_value: float, actual_max_value: float)[source]
Bases:
object
This class manages a set of parameters used to perform a Dynamic Range Adjustment that is applied when converting imagery pixel values (e.g. 11-bit per pixel panchromatic imagery to an 8-bit per pixel grayscale).
- static from_counts(counts: List[float], first_bucket_value: float | None = None, last_bucket_value: float | None = None, min_percentage: float = 0.02, max_percentage: float = 0.98, a: float = 0.2, b: float = 0.4) DRAParameters [source]
This static factory method computes a new set of DRA parameters given a histogram of pixel values.
- Parameters:
counts – histogram of the pixel values
first_bucket_value – pixel value of the first bucket, defaults to 0
last_bucket_value – pixel value of the last bucket, defaults to bucket index
min_percentage – set point for low intensity pixels that may be outliers
max_percentage – set point for high intensity pixels that may be outliers
a – weighting factor for the low intensity range
b – weighting factor for the high intensity range
- Returns:
a set of DRA parameters containing recommended and actual ranges of values