def _validate_window_size(axis_sizes):
    """Ensure all sizes in ``axis_sizes`` are odd.

    Parameters
    ----------
    axis_sizes : iterable of int

    Raises
    ------
    ValueError
        If any given axis size is even.
    """
    for axis_size in axis_sizes:
        if axis_size % 2 == 0:
            msg = (
                'Window size for `threshold_sauvola` or `threshold_niblack` must not be even on any dimension. Got {}'
                .format(axis_sizes))
            raise ValueError(msg)
