lazyslide_models.tile_prediction.cv_features.Contrast#
- class Contrast(lower_percentile=1, upper_percentile=99)#
Bases:
_CVFeaturescontrast Spread between the 1st and 99th gray-level percentiles
Calculate the contrast of a tile.
Contrast is the gray-level range between
lower_percentileandupper_percentile, as a fraction of the dtype range.The tile can be in shape (H, W, C) for a single image or (B, C, H, W) for a batch of images.
- Parameters:
- lower_percentilefloat
Lower percentile for contrast calculation.
- upper_percentilefloat
Upper percentile for contrast calculation.
- columns = ('contrast',)#
Subclasses whose
_funcreturns a dict set this explicitly; for the rest it is derived below from the class name, which is the same rule_process_batchuses to key its result.