robokudo.annotators.grab_cut

Image segmentation using GrabCut algorithm.

This module provides an annotator for:

  • Refining object ROIs using GrabCut

  • Processing color image regions

  • Creating segmentation masks

  • Visualizing segmentation results

The module uses:

  • OpenCV GrabCut implementation

  • ROI-based initialization

  • Iterative segmentation

  • Mask-based visualization

Warning

Current implementation is incomplete and for reference only.

Classes

GrabCutAnnotator

Refine the ROI of an Object Hypothesis with the GrabCut Algorithm

Module Contents

class robokudo.annotators.grab_cut.GrabCutAnnotator(name='GrabCutAnnotator')

Bases: robokudo.annotators.core.ThreadedAnnotator

Refine the ROI of an Object Hypothesis with the GrabCut Algorithm

This annotator:

  • Refines object ROIs using GrabCut

  • Processes color image regions

  • Creates foreground/background models

  • Generates segmentation masks

  • Visualizes segmented regions

Warning

Current implementation only processes one object and lacks annotation creation.

compute()

Process object hypotheses using GrabCut.

The method:

  • Loads color image and object hypotheses

  • For each hypothesis: * Extracts ROI rectangle * Creates initial mask * Initializes foreground/background models * Runs GrabCut segmentation * Creates visualization

Note

Currently only processes one object and lacks annotation creation.

Returns:

SUCCESS after processing

Return type:

py_trees.Status