def adjust_contrast_linear(arr, alpha):
<EOL>if arr.dtype.name == "<STR_LIT>":<EOL><INDENT>min_value, center_value, max_value = iadt.get_value_range_of_dtype(arr.dtype)<EOL>value_range = np.arange(<NUM_LIT:0>, <NUM_LIT>, dtype=np.float32)<EOL>alpha = np.float32(alpha)<EOL>table = center_value + alpha * (value_range - center_value)<EOL>arr_aug = cv2.LUT(arr, np.clip(table, min_value, max_value).astype(arr.dtype))<EOL>if arr.ndim == <NUM_LIT:3> and arr_aug.ndim == <NUM_LIT:2>:<EOL><INDENT>return arr_aug[..., np.newaxis]<EOL><DEDENT>return arr_aug<EOL><DEDENT>else:<EOL><INDENT>input_dtype = arr.dtype<EOL>_min_value, center_value, _max_value = iadt.get_value_range_of_dtype(input_dtype)<EOL>if input_dtype.kind in ["<STR_LIT:u>", "<STR_LIT:i>"]:<EOL><INDENT>center_value = int(center_value)<EOL><DEDENT>image_aug = center_value + alpha * (arr.astype(np.float64)-center_value)<EOL>image_aug = iadt.restore_dtypes_(image_aug, input_dtype)<EOL>return image_aug<EOL><DEDENT>
Adjust contrast by scaling each pixel value to ``127 + alpha*(I_ij-127)``.

    dtype support::

        * ``uint8``: yes; fully tested (1) (2)
        * ``uint16``: yes; tested (2)
        * ``uint32``: yes; tested (2)
        * ``uint64``: no (3)
        * ``int8``: yes; tested (2)
        * ``int16``: yes; tested (2)
        * ``int32``: yes; tested (2)
        * ``int64``: no (2)
        * ``float16``: yes; tested (2)
        * ``float32``: yes; tested (2)
        * ``float64``: yes; tested (2)
        * ``float128``: no (2)
        * ``bool``: no (4)

        - (1) Handled by ``cv2``. Other dtypes are handled by raw ``numpy``.
        - (2) Only tested for reasonable alphas with up to a value of around 100.
        - (3) Conversion to ``float64`` is done during augmentation, hence ``uint64``, ``int64``,
              and ``float128`` support cannot be guaranteed.
        - (4) Does not make sense for contrast adjustments.

    Parameters
    ----------
    arr : numpy.ndarray
        Array for which to adjust the contrast. Dtype ``uint8`` is fastest.

    alpha : number
        Multiplier to linearly pronounce (>1.0), dampen (0.0 to 1.0) or invert (<0.0) the
        difference between each pixel value and the center value, e.g. ``127`` for ``uint8``.

    Returns
    -------
    numpy.ndarray
        Array with adjusted contrast.