Skip to main content

import Admonition from '@theme/Admonition';

Color Descriptor

The ColorDescriptor filter analyzes video frames to extract color features from regions of interest (ROIs), classify states based on visual signatures, and optionally sync events to the cloud. It supports multiple calibration and classification strategies, along with telemetry and offline replay support.

FeaturesDirect link to Features

  • Color Feature Extraction
    Extract HSV and RGB statistics (mean, std, min/max, variance) from ROIs using configurable extractors.

  • Calibration Modes
    Choose from:

    • zero_shot: no calibration required
    • one_shot: quick 1-frame calibration
    • few_shot: multi-frame learning for higher accuracy
  • ROI Detection & State Classification

    • ROIs are defined via a JSON file and tracked per-frame
    • Classifiers assign meaningful labels to each region (e.g., "clean" vs "dirty")
  • Cloud Sync (Optional)

    • Detects movement, captures sample video, and syncs annotated frames to GCP
    • Includes alert reporting via Cloud Monitoring
  • Offline Mode
    Replay annotated frames from a JSON file to simulate upstream output

  • Debug Visualization

    • Annotates ROI regions, frame ID, and feature summaries directly on frames
    • Supports frame-by-frame inspection
  • Telemetry Reporting
    Collects and exports metrics with customizable frequency and format

Example OutputDirect link to Example Output

Each frame produces structured metadata like:

{
"meta": { "id": 123 },
"states": ["clean", "dirty"],
"rois": [
[{ "x": 20, "y": 30, "width": 100, "height": 100 }],
[{ "x": 140, "y": 30, "width": 100, "height": 100 }]
],
"hsv_color_info": [ { "mean_h": 23.1, "std_dev_s": 10.2, ... } ],
"rgb_color_info": [ { "r_mean": 120.5, "g_mean": 110.2, ... } ]
}

When to UseDirect link to When to Use

Use this filter when you need:

  • Visual classification of regions in live or recorded video
  • Real-time monitoring or alerting based on appearance
  • Frame-level logging for inspection or ML pipelines
  • Visual QA or compliance inspection use cases

Configuration ReferenceDirect link to Configuration Reference

KeyTypeDefaultDescription
debugbooleanfalseEnable visual overlays and logs
roi_json_pathstring"./configs/roi_config.json"Path to ROI config file
output_json_pathstring"./output/output.json"Periodic JSON output path
full_json_pathstring"./output/full_data.json"Full output dump
calibration_methodstring"zero_shot"One of: "zero_shot", "one_shot", "few_shot"
n_calibration_framesint60Number of frames used in few-shot calibration
feature_extractorsstring[]["color"]Extractors to use
classifier_typestring"distance"Classifier backend
n_statesint2Number of output states
cloud_syncbooleanfalseEnable GCP syncing and reporting
offline_modebooleanfalseUse upstream JSON instead of live video
output_color_frame_intervalint100Frame interval for output
service_namestring"fcd"Telemetry service name
gcp_credentials_pathstring"./google_application_credentials.json"GCP credential path
gcp_project_idstringrequired if cloud_sync is enabledGCP project ID for telemetry
input_json_pathstring"./input/video_data.json"Input JSON for offline mode
Tip
This filter is modular—feature extractors, classifiers, and calibration strategies can be expanded in the future.