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: str = 'ROIAdjusterAnnotator', descriptor: ROIAdjusterAnnotator = 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.

offset_pixel: int = 20

Pixels to add/subtract from ROI sides (positive grows, negative shrinks)

analysis_scope: typing_extensions.Type

Type of annotations to process.

fill_value_mask: int = 0

Value to fill new mask areas when growing ROIs

parameters
update() py_trees.common.Status

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