Object proximity

Filters objects in close XY proximity based on a specific measurement.

Description

Filters objects in close XY proximity based on a specific measurement. For two, or more, objects within close proximity of each other the object with the largest (or smallest) measurement will be retained, whilst the others will be removed. This can be used to filter instances of the same object being detected multiple times. Distances are only considered in XY. Any Z-axis information on object position will be ignored.

Parameters

ParameterDescription
Input objectsObjects to be filtered.
Filter modeControls what happens to objects which don't pass the filter:
  • "Do nothing" Retains all input objects, irrespective of whether they passed or failed the filter. This is useful when also storing the filter results as metadata values (i.e. just counting the number of objects which pass the filter).
  • "Move filtered objects to new class" Objects failing the filter are moved to a new object class. The name of the class is determined by the "Output (filtered) objects" parameter. All existing measurements and relationships are carried forward into the new object collection.
  • "Remove filtered objects" (default) Removes objects failing the filter. Once removed, these objects are unavailable for further use by modules and won't be included in exported results.
Output (filtered) objectsNew object collection containing input objects which did not pass the filter. These objects are only stored if "Filter mode" is set to "Move filtered objects to new class".
Reference modeControls the method used for determining the nearest neighbour distances:
  • "Centroid (2D)" Distances are between the input and neighbour object centroids, but only in the XY plane. These distances are always positive; increasing as the distance between centroids increases.
  • "Centroid (3D)" Distances are between the input and neighbour object centroids. These distances are always positive; increasing as the distance between centroids increases.
  • "Surface (2D)" Distances are between the closest points on the input and neighbour surfaces, but only in the XY plane. These distances increase in magnitude the greater the minimum input-neighbour object surface distance is; however, they are assigned a positive value if the closest input object surface point is outside the neighbour and a negative value if the closest input object surface point is inside the neighbour. For example, a closest input object surface point 5px outside the neighbour will be simply "5px", whereas a closest input object surface point 5px from the surface, but contained within the neighbour object will be recorded as "-5px". Note: Any instances where the input and neighbour object surfaces overlap will be recorded as "0px" distance.
  • "Surface (3D)" Distances are between the closest points on the input and neighbour surfaces. These distances increase in magnitude the greater the minimum input-neighbour object surface distance is; however, they are assigned a positive value if the closest input object surface point is outside the neighbour and a negative value if the closest input object surface point is inside the neighbour. For example, a closest input object surface point 5px outside the neighbour will be simply "5px", whereas a closest input object surface point 5px from the surface, but contained within the neighbour object will be recorded as "-5px". Note: Any instances where the input and neighbour object surfaces overlap will be recorded as "0px" distance.
Minimum separationMinimum allowed distance in XY plane for two objects to co-exist. Any objects with XY separation smaller than this value will be subject to filtering, where the "less suitable" (depending on filter settings) object will be removed.
Calibrated unitsWhen selected, object-object distances are to be specified in calibrated units; otherwise, units are specified in pixels.
Only link objects in same frameWhen selected, objects must be in the same time frame for them to be linked.
Method for filteringFor objects closer than the value specified by "Minimum separation" this parameter controls which will be retained.
Measurement to filter onObjects will be filtered against their value of this measurement. Objects missing this measurement are not removed; however, they can be removed by using the module "With / without measurement".