BinarizeByQuantile
- class hybrid_learning.datasets.transforms.image_transforms.BinarizeByQuantile(quantile=None, num_pixels=None)[source]
Bases:
ImageTransformSet all but the given highest number of pixels / q-th quantile in an image to zero, rest to 1. Mind for RGB images: A pixel here means a pixel in one channel.
Public Data Attributes:
Settings to reproduce the instance.
Inherited from : py: class:Transform
IDENTITY_CLASSThe identity class or classes for composition / addition.
Settings to reproduce the instance.
Public Methods:
apply_to(img)Binarize
imgby setting a quantile or number of pixels to one, the rest to 0.Inherited from : py: class:ImageTransform
apply_to(img)Binarize
imgby setting a quantile or number of pixels to one, the rest to 0.Inherited from : py: class:Transform
apply_to(img)Binarize
imgby setting a quantile or number of pixels to one, the rest to 0.Special Methods:
__init__([quantile, num_pixels])Init.
Inherited from : py: class:ImageTransform
__call__(img)Application of transformation.
Inherited from : py: class:Transform
__repr__()Return repr(self).
__eq__(other)Return self==value.
__copy__()Return a shallow copy of self using settings.
__add__(other)Return a flat composition of
selfwithother.__radd__(other)Return a flat composition of
otherandself.__call__(img)Application of transformation.
- apply_to(img)[source]
Binarize
imgby setting a quantile or number of pixels to one, the rest to 0. Seequantilerespectivelynum_pixels.
- quantile: float
Quantile of pixels to set to one, rest is set to 0; overridden by
num_pixels