BinarizeByQuantile
- class hybrid_learning.datasets.transforms.image_transforms.BinarizeByQuantile(quantile=None, num_pixels=None)[source]
Bases:
ImageTransform
Set 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_CLASS
The identity class or classes for composition / addition.
Settings to reproduce the instance.
Public Methods:
apply_to
(img)Binarize
img
by setting a quantile or number of pixels to one, the rest to 0.Inherited from : py: class:ImageTransform
apply_to
(img)Binarize
img
by setting a quantile or number of pixels to one, the rest to 0.Inherited from : py: class:Transform
apply_to
(img)Binarize
img
by 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
self
withother
.__radd__
(other)Return a flat composition of
other
andself
.__call__
(img)Application of transformation.
- apply_to(img)[source]
Binarize
img
by setting a quantile or number of pixels to one, the rest to 0. Seequantile
respectivelynum_pixels
.
- quantile: float
Quantile of pixels to set to one, rest is set to 0; overridden by
num_pixels