dabble.zone_count

Description

Counts the number of detected objects within a boundary.

class Node(config=None, **kwargs)[source]

Uses the bottom midpoints of all detected bounding boxes and outputs the number of object counts in each specified zone.

Given the bottom mid-points of all detected objects, this node checks if the points fall within the area of the specified zones. The zone counting detections depend on the configuration set in the object detection models, such as the type of object to detect.

Inputs

btm_midpoint (List[Tuple[int, int]]): A list of tuples each representing the \((x, y)\) coordinates of the bottom middle of a bounding box for use in zone analytics. The order corresponds to bboxes.

Outputs

zones (List[List[Tuple[float, ...]]]): A nested list of \(Z\) zones. Each zone is described by \(3\) or more points which contains the \((x, y)\) coordinates forming the boundary of a zone. The order corresponds to zone_count.

zone_count (List[int]): A list of integers representing the count of a pre-selected object class (for example, “person”) detected in each specified zone. The order corresponds to zones.

Configs
  • resolution (List[int]) – default = [1280, 720].
    Resolution of input array to calculate pixel coordinates of zone points.

  • zones (List[List[List[Union[int, float]]]]) –
    default = [
        [[0, 0], [640, 0], [640, 720], [0, 720]],
        [[0.5, 0], [1, 0], [1, 1], [0.5, 1]]
    ]
    Used for creation of specific zones with either the absolute pixel values or % of resolution as a fraction between [0, 1].