lazyslide_models.tile_prediction.cv_features.Canny

Contents

lazyslide_models.tile_prediction.cv_features.Canny#

class Canny(low_threshold=100, high_threshold=200)#

Bases: _CVFeatures

canny Fraction of pixels on a Canny edge

Calculate the Canny edge density of a tile.

The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. The score is the fraction of pixels that lie on an edge, between 0 and 1.

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

Parameters:
low_thresholdint

Lower threshold for the hysteresis procedure in Canny edge detection.

high_thresholdint

Higher threshold for the hysteresis procedure in Canny edge detection.

columns = ('canny',)#

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.