dabble.check_nearby_objs

Description

Checks if detected objects are near each other.

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

Checks if any objects are near each other.

It does so by comparing the 3D locations of all objects to see which ones are near each other. If the distance between two objects is below the minimum threshold, both would be flagged as near with tag_msg. These flags can be accessed by the flags key of obj_attrs.

Inputs

obj_3D_locs (List[numpy.ndarray]): A list of \(N\) NumPy arrays representing the 3D coordinates \((x, y, z)\) of an object associated with a detected bounding box.

Outputs

obj_attrs (Dict[str, Any]): A dictionary of attributes associated with each bounding box, in the same order as bboxes. Different nodes that produce this obj_attrs output type may contribute different attributes. dabble.check_nearby_objs produces the flags attribute which contains either the tag_msg for objects that are near each other or an empty string for objects with no other objects nearby.

Configs
  • near_threshold (float) – default = 2.0.
    Threshold of distance, in metres, between two objects. Objects with distance less than near_threshold would be considered as ‘near’.

  • tag_msg (str) – default = “TOO CLOSE!”.
    Tag to identify objects which are near others.

Changed in version 1.2.0: draw.check_nearby_objs used to return obj_tags (List[str]) as an output data type, which has been deprecated and now subsumed under obj_attrs. The same attribute is accessed by using the flags key of obj_attrs.