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 requiredone_shot: quick 1-frame calibrationfew_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
| Key | Type | Default | Description |
|---|---|---|---|
debug | boolean | false | Enable visual overlays and logs |
roi_json_path | string | "./configs/roi_config.json" | Path to ROI config file |
output_json_path | string | "./output/output.json" | Periodic JSON output path |
full_json_path | string | "./output/full_data.json" | Full output dump |
calibration_method | string | "zero_shot" | One of: "zero_shot", "one_shot", "few_shot" |
n_calibration_frames | int | 60 | Number of frames used in few-shot calibration |
feature_extractors | string[] | ["color"] | Extractors to use |
classifier_type | string | "distance" | Classifier backend |
n_states | int | 2 | Number of output states |
cloud_sync | boolean | false | Enable GCP syncing and reporting |
offline_mode | boolean | false | Use upstream JSON instead of live video |
output_color_frame_interval | int | 100 | Frame interval for output |
service_name | string | "fcd" | Telemetry service name |
gcp_credentials_path | string | "./google_application_credentials.json" | GCP credential path |
gcp_project_id | string | required if cloud_sync is enabled | GCP project ID for telemetry |
input_json_path | string | "./input/video_data.json" | Input JSON for offline mode |