lazyslide_models.tile_prediction.cv_features.Sobel

Contents

lazyslide_models.tile_prediction.cv_features.Sobel#

class Sobel(ksize=3)#

Bases: _CVFeatures

sobel

Calculate the sobel of a tile.

Sobel is calculated as the variance of the Sobel of the pixel values.

The Sobel operator calculates the gradient of the image intensity at each pixel, giving the direction of the largest possible increase from light to dark and the rate of change in that direction.

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