Skip to content

Pixel Color Count

Class: PixelationCountBlockV1

Source: inference.core.workflows.core_steps.classical_cv.pixel_color_count.v1.PixelationCountBlockV1

Count the number of pixels that match a specific color within a given tolerance.

Type identifier

Use the following identifier in step "type" field: roboflow_core/pixel_color_count@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
target_color Union[Tuple[int, int, int], str] Target color to count in the image. Can be a hex string (like '#431112') RGB string (like '(128, 32, 64)') or a RGB tuple (like (18, 17, 67))..
tolerance int Tolerance for color matching..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Available Connections

Compatible Blocks

Check what blocks you can connect to Pixel Color Count in version v1.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Pixel Color Count in version v1 has.

Bindings
  • input

    • image (image): The input image for this step..
    • target_color (Union[rgb_color, string]): Target color to count in the image. Can be a hex string (like '#431112') RGB string (like '(128, 32, 64)') or a RGB tuple (like (18, 17, 67))..
    • tolerance (integer): Tolerance for color matching..
  • output

    • matching_pixels_count (integer): Integer value.
Example JSON definition of step Pixel Color Count in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/pixel_color_count@v1",
    "image": "$inputs.image",
    "target_color": "#431112",
    "tolerance": 10
}