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

Calculate the canny edge detection score 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 calculated as the variance of the edge-detected image.

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.