robokudo.annotators.cluster_color_histogram¶
Color histogram analysis for object hypotheses.
This module provides an annotator for:
Calculating 2D color histograms for object hypotheses
Analyzing hue and saturation distributions
Supporting masked ROI analysis
Optional visualization of histogram plots
The module uses:
HSV color space for analysis
2D histograms for hue-saturation distributions
Matplotlib for optional visualization
Note
Histogram plotting is optional and can be disabled for performance.
Classes¶
Hue and saturation histogram analysis for object hypotheses with RGB ROI and Mask. |
Module Contents¶
- class robokudo.annotators.cluster_color_histogram.ClusterColorHistogramAnnotator(name='ClusterColorHistogramAnnotator', descriptor=Descriptor())¶
-
Bases:
robokudo.annotators.core.BaseAnnotatorHue and saturation histogram analysis for object hypotheses with RGB ROI and Mask.
This annotator:
Calculates 2D histograms of hue and saturation
Processes masked ROIs from object hypotheses
Normalizes histogram distributions
Optionally generates visualization plots
Warning
Histogram plotting can significantly impact performance (200-500ms).
- class Descriptor¶
-
Bases:
robokudo.annotators.core.BaseAnnotator.DescriptorConfiguration descriptor for color histogram analysis.
- class Parameters¶
-
Parameters for configuring histogram calculation.
Histogram parameters:
- Variables:
-
histogram_cols – Number of histogram columns (hue bins), defaults to 16
histogram_rows – Number of histogram rows (saturation bins), defaults to 16
Visualization:
- Variables:
-
generate_plot_output – Whether to generate histogram plots, defaults to False
- histogram_cols = 16¶
- histogram_rows = 16¶
- generate_plot_output = False¶
- parameters¶
- update()¶
-
Process object hypotheses and calculate color histograms.
The method:
Loads point cloud and color image from CAS
Creates color histogram annotations
Updates visualization if enabled
- Returns:
-
SUCCESS after processing
- Return type:
-
py_trees.Status
- create_color_histogram_annotations(color: numpy.typing.NDArray)¶
-
Calculate 2D color histograms for object hypotheses.
For each object hypothesis with a valid ROI mask:
Extracts color image region and mask
Converts to HSV color space
Calculates 2D histogram of hue and saturation
Normalizes histogram distribution
Creates histogram annotation
Optionally generates visualization plot
- Parameters:
-
color (numpy.ndarray) – Input color image
- Returns:
-
Combined histogram plot image if enabled, None otherwise
- Return type:
-
numpy.ndarray or None