def filter_bboxes_by_visibility(original_shape, bboxes, transformed_shape, transformed_bboxes,<EOL>threshold=<NUM_LIT:0.>, min_area=<NUM_LIT:0.>):
img_height, img_width = original_shape[:<NUM_LIT:2>]<EOL>transformed_img_height, transformed_img_width = transformed_shape[:<NUM_LIT:2>]<EOL>visible_bboxes = []<EOL>for bbox, transformed_bbox in zip(bboxes, transformed_bboxes):<EOL><INDENT>if not all(<NUM_LIT:0.0> <= value <= <NUM_LIT:1.0> for value in transformed_bbox[:<NUM_LIT:4>]):<EOL><INDENT>continue<EOL><DEDENT>bbox_area = calculate_bbox_area(bbox, img_height, img_width)<EOL>transformed_bbox_area = calculate_bbox_area(transformed_bbox, transformed_img_height, transformed_img_width)<EOL>if transformed_bbox_area < min_area:<EOL><INDENT>continue<EOL><DEDENT>visibility = transformed_bbox_area / bbox_area<EOL>if visibility >= threshold:<EOL><INDENT>visible_bboxes.append(transformed_bbox)<EOL><DEDENT><DEDENT>return visible_bboxes<EOL>
Filter bounding boxes and return only those boxes whose visibility after transformation is above
    the threshold and minimal area of bounding box in pixels is more then min_area.

    Args:
        original_shape (tuple): original image shape
        bboxes (list): original bounding boxes
        transformed_shape(tuple): transformed image
        transformed_bboxes (list): transformed bounding boxes
        threshold (float): visibility threshold. Should be a value in the range [0.0, 1.0].
        min_area (float): Minimal area threshold.