robokudo.annotators.roi_adjuster

ROI adjustment for RoboKudo.

This module provides an annotator for adjusting the size of Region of Interest (ROI) boundaries for object hypotheses. It can grow or shrink ROIs and their associated masks by a specified pixel offset.

Classes

ROIAdjusterAnnotator

Annotator for adjusting ROI sizes of object hypotheses.

Module Contents

class robokudo.annotators.roi_adjuster.ROIAdjusterAnnotator(name='ROIAdjusterAnnotator', descriptor=Descriptor())

Bases: robokudo.annotators.core.BaseAnnotator

Annotator for adjusting ROI sizes of object hypotheses.

This annotator can grow or shrink ROIs (Regions of Interest) on object hypotheses by a specified pixel offset. It handles both the ROI boundaries and their associated masks, ensuring proper adjustment of both.

class Descriptor

Bases: robokudo.annotators.core.BaseAnnotator.Descriptor

Configuration descriptor for ROI adjustment.

class Parameters

Parameters for configuring ROI adjustment behavior.

Variables:
  • offset_pixel – Pixels to add/subtract from ROI sides (positive grows, negative shrinks)

  • analysis_scope – Type of annotations to process, defaults to ObjectHypothesis

  • fill_value_mask – Value to fill new mask areas when growing ROIs, defaults to 0

offset_pixel = 20
analysis_scope
fill_value_mask = 0
parameters
update()

Update ROIs by applying the configured pixel offset.

For each object hypothesis in the analysis scope: - Adjusts the ROI boundaries by the specified pixel offset - If a mask exists, adjusts it accordingly with the specified fill value

Returns:

SUCCESS after adjusting all ROIs

Return type:

py_trees.common.Status