code: def filter_bboxes(
      bboxes: Sequence[BoxType],
      rows: int,
      cols: int,
      min_area: float = 0.0,
      min_visibility: float = 0.0,
      min_width: float = 0.0,
      min_height: float = 0.0,
  ) -> List[BoxType]:
      """Remove bounding boxes that either lie outside of the visible area by more then min_visibility
      or whose area in pixels is under the threshold set by `min_area`. Also it crops boxes to final image size.
  
      Args:
          bboxes: List of albumentation bounding box `(x_min, y_min, x_max, y_max)`.
          rows: Image height.
          cols: Image width.
          min_area: Minimum area of a bounding box. All bounding boxes whose visible area in pixels.
              is less than this value will be removed. Default: 0.0.
          min_visibility: Minimum fraction of area for a bounding box to remain this box in list. Default: 0.0.
          min_width: Minimum width of a bounding box. All bounding boxes whose width is
              less than this value will be removed. Default: 0.0.
          min_height: Minimum height of a bounding box. All bounding boxes whose height is
              less than this value will be removed. Default: 0.0.
  
      Returns:
          List of bounding boxes.
  
      """
      resulting_boxes: List[BoxType] = []
      for bbox in bboxes:
          # Calculate areas of bounding box before and after clipping.
          transformed_box_area = calculate_bbox_area(bbox, rows, cols)
          bbox, tail = cast(
              BoxType, tuple(np.clip(bbox[:4], 0, 1.0))
          ), tuple(bbox[4:])
          clipped_box_area = calculate_bbox_area(bbox, rows, cols)
  
          # Calculate width and height of the clipped bounding box.
          x_min, y_min, x_max, y_max = denormalize_bbox(
              bbox, rows, cols
          )[:4]
          clipped_width, clipped_height = x_max - x_min, y_max - y_min
  
          if (
              clipped_box_area
              != 0  # to ensure transformed_box_area!=0 and to handle min_area=0 or min_visibility=0
              and clipped_box_area >= min_area
              and clipped_box_area / transformed_box_area
              >= min_visibility
              and clipped_width >= min_width
              and clipped_height >= min_height
          ):
              resulting_boxes.append(cast(BoxType, bbox + tail))
      return resulting_boxes
  
imports: from __future__ import division
  from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, cast
  import numpy
  from .transforms_interface import BoxInternalType, BoxType
  from .utils import DataProcessor, Params
label_desc: Use image node_id 13 for calling a global function with example usage: filter_bboxes(bboxes, rows, cols, min_area, min_visibility, min_width, min_height) and returns: resulting_boxes