lazyslide_models.tile_prediction.cv_features.Entropy

lazyslide_models.tile_prediction.cv_features.Entropy#

class Entropy#

Bases: _CVFeatures

entropy Shannon entropy of the gray-level histogram, in bits

Calculate the entropy of a tile.

The Shannon entropy, in bits, of the tile’s 256-bin gray-level histogram: higher means the intensities are spread over more levels. It depends on the histogram alone, not on where the pixels are, so shuffling a tile leaves it unchanged; for texture, use HaralickTexture.

The tile can be in shape (H, W, C) for a single image or (B, C, H, W) for a batch of images.

columns = ('entropy',)#

Subclasses whose _func returns a dict set this explicitly; for the rest it is derived below from the class name, which is the same rule _process_batch uses to key its result.