Color Classifier
Classifies the predominant color of objects in a ROI, or of a ROI in the frame.
Overview
The Color Classifier node classifies the predominant color of objects in a ROI, or of a ROI in the frame. This functionality is useful for applications requiring color-based classification of objects or areas within a video feed.
Inputs & Outputs
- Inputs: 1, Media Format: Raw Video
- Outputs: 1, Media Format: Raw Video
- Output Metadata:
nodes.node_id,recognized_objs,recognized_obj_ids,recognized_obj_count,recognized_obj_delta,value_changed_delta,unrecognized_obj_count,unrecognized_obj_delta
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
roi_labels | Regions of interest labels | string | — | No |
rois | Regions of interest. Conditional on roi_labels. Format: comma-separated normalized x,y coordinate pairs; separate multiple polygons with semicolons (for example, 0.1,0.1,0.9,0.1,0.9,0.9). | string | null | No |
processing_mode | Processing mode. Options: ROIs, at an Interval (rois_interval); ROIs, upon a Trigger (rois_trigger); Objects in an ROI (objects). | enum | rois_interval | Yes |
trigger | Queue ROI for lookup when this condition evaluates to true. Conditional on processing_mode being rois_trigger. | trigger-condition | null | No |
objects_to_process | ex. car,person,car.red. Conditional on processing_mode being objects. | model-labels | null | No |
tracking_mode | Tracking mode. Options: Centroid (centroid); Top center (top-center); Bottom center (bottom-center); Left center (left-center); Right center (right-center). Conditional on processing_mode being objects. | enum | centroid | No |
min_obj_size_pixels | Min. width and height of an object. Conditional on processing_mode being objects. | number | 64 | No |
obj_lookup_size_change_threshold | Object size ratio change threshold. Conditional on processing_mode being objects. Range: minimum 0.1, maximum 2.0. Step: 0.2. | float | 0.1 | No |
max_lookups_per_obj | Max. attempts per object. Conditional on processing_mode being objects. | number | 5 | No |
min_confidence_threshold | Only consider results above this threshold in the color classification. Range: minimum 0, maximum 1.0. Step: 0.05. | float | 0.2 | Yes |
interval | Queue objects or ROIs for lookup at least this many seconds apart. Unit: seconds. | number | 1 | No |
display_roi | Display ROI on video? | bool | true | No |
display_objinfo | Display results on video? Options: Disabled (disabled); Bottom left (bottom_left); Bottom right (bottom_right); Top left (top_left); Top right (top_right). | enum | bottom_left | No |
debug | Log debugging information? | bool | false | No |
Metadata
The output metadata includes information about the color classification results, such as color labels and any changes in their recognition status. This allows for a comprehensive understanding of the scene being analyzed.
Color labels output by this node include: 'black', 'blue', 'brown', 'green', 'grey', 'orange', 'pink', 'purple', 'red', 'white', 'yellow'
Output Metadata
The fields below are declared by this node's metadata schema; the JSON values are representative examples.
| Path | Type | Description |
|---|---|---|
nodes.<node_id>.rois.<roi_label>.label_changed_delta | boolean | When the color of an ROI changes |
nodes.<node_id>.rois.<roi_label>.label_available | boolean | Boolean indicating whether the node has a current result for this ROI. |
nodes.<node_id>.rois.<roi_label>.label | string | Current model-generated result for this ROI. |
nodes.<node_id>.recognized_obj_count | integer | Number of objects successfully processed in the current frame. |
nodes.<node_id>.recognized_obj_delta | integer | When one or more new objects have color assigned |
nodes.<node_id>.label_changed_obj_delta | integer | When the color of one or more objects changes |
nodes.<node_id>.unrecognized_obj_count | integer | Number of objects that could not be processed in the current frame. |
nodes.<node_id>.unrecognized_obj_delta | integer | When one or more objects fail to have color assigned |
nodes.<node_id>.recognized_objs[].id | integer | Tracked object ID. |
nodes.<node_id>.recognized_objs[].color_classifier_result | string | Color label assigned to the object. |
nodes.<node_id>.recognized_obj_ids | array | Array of tracking IDs of objects successfully processed by the node. |
nodes.<node_id>.objects_of_interest_keys | array | Array of metadata keys that contain object IDs relevant to downstream integrations. |
nodes.<node_id>.type | string | Identifies the node type that produced this metadata. |
JSON example
{
"nodes": {
"color_classifier1": {
"label_changed_obj_delta": 0,
"objects_of_interest_keys": [],
"recognized_obj_count": 0,
"recognized_obj_delta": 0,
"recognized_obj_ids": [],
"recognized_objs": [
{
"color_classifier_result": "value",
"id": 0
}
],
"rois": {
"roi1": {
"label": "example",
"label_available": false,
"label_changed_delta": false
}
},
"type": "color_classifier",
"unrecognized_obj_count": 0,
"unrecognized_obj_delta": 0
}
}
}Additional details
Object labels and attributes
- Object labels/classes added: In ROI mode,
color_classifier_roiis added as an object with class11900. - Object attribute labels/classes added: ROI objects receive the configured ROI label with class
11900; predicted color labels use class11901on ROI or upstream objects.
Updated about 22 hours ago
