lazyslide.models.tile_prediction.Contrast

Contents

lazyslide.models.tile_prediction.Contrast#

class Contrast(lower_percentile=1, upper_percentile=99)#

Bases: _CVFeatures

Calculate the contrast of a tile.

Contrast is calculated as the standard deviation of the pixel values.

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.