Skip to content

PercentileNormalization

Bases: ImageOnlyTransform

__init__

__init__(lower: float = 0.01, upper: float = 99.99, p: float = 1.0, copy: bool = False, **kwargs) -> None

Percentile normalization. Normalizes to percentile range [lower, upper].

Parameters:

Name Type Description Default
lower float, default=0.01

Lower percentile.

0.01
upper float, default=99.99

Clamp max value. No clamping performed if None.

99.99
p float, default=1.0

Probability of applying the transformation.

1.0
copy bool, default=False

If True, normalize the copy of the input.

False

apply

apply(image: ndarray, **kwargs) -> np.ndarray

Apply percentile normalization to input image.

Parameters:

Name Type Description Default
image ndarray

Input image to be normalized. Shape (H, W, C)|(H, W).

required

Returns:

Type Description
ndarray

np.ndarray: Normalized image. Same shape as input. dtype: float32.

get_transform_init_args_names

get_transform_init_args_names()

Get the names of the transformation arguments.