@preserve_shape<EOL>def add_fog(img, fog_coef, alpha_coef, haze_list):
non_rgb_warning(img)<EOL>input_dtype = img.dtype<EOL>needs_float = False<EOL>if input_dtype == np.float32:<EOL><INDENT>img = from_float(img, dtype=np.dtype('<STR_LIT>'))<EOL>needs_float = True<EOL><DEDENT>elif input_dtype not in (np.uint8, np.float32):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(input_dtype))<EOL><DEDENT>height, width = img.shape[:<NUM_LIT:2>]<EOL>hw = max(int(width // <NUM_LIT:3> * fog_coef), <NUM_LIT:10>)<EOL>for haze_points in haze_list:<EOL><INDENT>x, y = haze_points<EOL>overlay = img.copy()<EOL>output = img.copy()<EOL>alpha = alpha_coef * fog_coef<EOL>rad = hw // <NUM_LIT:2><EOL>point = (x + hw // <NUM_LIT:2>, y + hw // <NUM_LIT:2>)<EOL>cv2.circle(overlay, point, int(rad), (<NUM_LIT:255>, <NUM_LIT:255>, <NUM_LIT:255>), -<NUM_LIT:1>)<EOL>cv2.addWeighted(overlay, alpha, output, <NUM_LIT:1> - alpha, <NUM_LIT:0>, output)<EOL>img = output.copy()<EOL><DEDENT>image_rgb = cv2.blur(img, (hw // <NUM_LIT:10>, hw // <NUM_LIT:10>))<EOL>if needs_float:<EOL><INDENT>image_rgb = to_float(image_rgb, max_value=<NUM_LIT:255>)<EOL><DEDENT>return image_rgb<EOL>
Add fog to the image.

    From https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library

    Args:
        img (np.array):
        fog_coef (float):
        alpha_coef (float):
        haze_list (list):
    Returns: