Line Counter Visualization¶
Class: LineCounterZoneVisualizationBlockV1
Source: inference.core.workflows.core_steps.visualizations.line_zone.v1.LineCounterZoneVisualizationBlockV1
Draw a line zone on an image to visualize counting boundaries, displaying a colored line overlay with in/out count labels for line counter workflows that track objects crossing a specified line.
How This Block Works¶
This block takes an image and line zone coordinates (two points defining a line) and draws a visual representation of the counting line with count statistics. The block:
- Takes an image and line zone coordinates (two points: [x1, y1] and [x2, y2]) as input
- Creates a line mask from the zone coordinates using the specified color and thickness
- Overlays the line onto the image with the specified opacity, creating a semi-transparent line visualization
- Displays text labels showing the count_in (objects that crossed into the zone) and count_out (objects that crossed out of the zone) values
- Positions the count text at the starting point of the line (x1, y1) with customizable text styling
- Returns an annotated image with the line zone and count statistics overlaid on the original image
The block visualizes line counting zones used to track object movement across a defined boundary line. The line is drawn between the two specified points with customizable color, thickness, and opacity. Count statistics (in and out) are displayed as text labels, typically connected from a Line Counter block that tracks object crossings. The visualization helps users see the counting boundary and monitor counting results in real-time. Note: This block should typically be placed before other visualization blocks in the workflow, as the line zone provides a background reference layer for object detection visualizations.
Common Use Cases¶
- Line Counter Visualization: Visualize line counting zones for people counting, vehicle counting, or object tracking workflows where objects cross a defined line boundary, displaying the counting line and in/out statistics
- Traffic and Movement Monitoring: Display counting lines for traffic monitoring, pedestrian flow analysis, or entry/exit tracking applications where you need to visualize the counting boundary and current counts
- Checkpoint and Access Control: Visualize counting lines at checkpoints, gates, or access points to show the monitoring boundary and track entry/exit counts for security or access control workflows
- Retail and Business Analytics: Display counting lines for foot traffic analysis, customer flow monitoring, or occupancy tracking in retail, hospitality, or business intelligence applications
- Crowd Management and Safety: Visualize counting lines for crowd management, capacity monitoring, or safety workflows where tracking object movement across boundaries is critical
- Real-Time Counting Dashboards: Create visual overlays for real-time counting dashboards, monitoring interfaces, or live video feeds where the counting line and statistics need to be clearly visible
Connecting to Other Blocks¶
The annotated image from this block can be connected to:
- Line Counter blocks to receive count_in and count_out values that are displayed on the visualization
- Other visualization blocks (e.g., Bounding Box Visualization, Label Visualization, Polygon Visualization) to add object detection annotations on top of the line zone visualization
- Data storage blocks (e.g., Local File Sink, CSV Formatter, Roboflow Dataset Upload) to save images with line zone visualizations for documentation, reporting, or analysis
- Webhook blocks to send visualized results with line zones to external systems, APIs, or web applications for display in dashboards or monitoring tools
- Notification blocks (e.g., Email Notification, Slack Notification) to send annotated images with line zones as visual evidence in alerts or reports
- Video output blocks to create annotated video streams or recordings with line zone visualizations for live monitoring, counting visualization, or post-processing analysis
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/line_counter_visualization@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
copy_image |
bool |
Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations.. | ✅ |
zone |
List[Any] |
Line zone coordinates in the format [[x1, y1], [x2, y2]] consisting of exactly two points that define the counting line. The line is drawn between these two points, and objects crossing this line are counted. Typically connected from a Line Counter block's zone output.. | ✅ |
color |
str |
Color of the line zone. Can be specified as a color name (e.g., 'WHITE', 'RED'), hex color code (e.g., '#5bb573', '#FFFFFF'), or RGB format (e.g., 'rgb(255, 255, 255)'). The line is drawn in this color with the specified opacity.. | ✅ |
thickness |
int |
Thickness of the line zone in pixels. Controls how thick the counting line appears. Higher values create thicker, more visible lines, while lower values create thinner lines. Typical values range from 1 to 10 pixels.. | ✅ |
text_thickness |
int |
Thickness of the count text labels in pixels. Controls how bold the text appears (line width of text characters). Higher values create thicker, bolder text, while lower values create thinner text. Typical values range from 1 to 3.. | ✅ |
text_scale |
float |
Scale factor for the count text labels. Controls the size of the text displaying count_in and count_out values. Values greater than 1.0 make text larger, values less than 1.0 make text smaller. Typical values range from 0.5 to 2.0.. | ✅ |
count_in |
int |
Number of objects that crossed into the line zone (crossing from one side to the other in the 'in' direction). Typically connected from a Line Counter block's count_in output (e.g., '$steps.line_counter.count_in'). This value is displayed in the visualization text label.. | ✅ |
count_out |
int |
Number of objects that crossed out of the line zone (crossing from one side to the other in the 'out' direction). Typically connected from a Line Counter block's count_out output (e.g., '$steps.line_counter.count_out'). This value is displayed in the visualization text label.. | ✅ |
opacity |
float |
Opacity of the line zone overlay, ranging from 0.0 (fully transparent) to 1.0 (fully opaque). Controls how transparent the counting line appears over the image. Lower values create more transparent lines that blend with the background, while higher values create more opaque, visible lines. Typical values range from 0.2 to 0.5 for balanced visibility.. | ✅ |
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 Line Counter Visualization in version v1.
- inputs:
Morphological Transformation,Image Preprocessing,Email Notification,VLM As Classifier,Halo Visualization,Morphological Transformation,Object Detection Model,Pixel Color Count,Text Display,Template Matching,Image Threshold,Model Monitoring Inference Aggregator,Pixelate Visualization,Keypoint Detection Model,Qwen-VL,OpenAI,CogVLM,Crop Visualization,Cosine Similarity,Dot Visualization,Google Vision OCR,PLC EthernetIP,Detections List Roll-Up,Florence-2 Model,Dimension Collapse,Roboflow Dataset Upload,Qwen3.5-VL,Roboflow Vision Events,Polygon Zone Visualization,Polygon Visualization,SIFT Comparison,Absolute Static Crop,S3 Sink,Twilio SMS/MMS Notification,QR Code Generator,SIFT Comparison,Contrast Enhancement,Stitch OCR Detections,Dynamic Zone,OCR Model,Color Visualization,Roboflow Dataset Upload,Gaze Detection,Roboflow Custom Metadata,LMM For Classification,OpenAI-Compatible LLM,Line Counter Visualization,Image Blur,Stability AI Inpainting,Blur Visualization,Current Time,Perspective Correction,Keypoint Visualization,Anthropic Claude,MQTT Writer,MoonshotAI Kimi,Google Gemini,Image Slicer,Identify Changes,Depth Estimation,Detections Consensus,Ellipse Visualization,Google Gemma API,PLC ModbusTCP,Slack Notification,Identify Outliers,Image Stack,Google Gemini,Bounding Box Visualization,Label Visualization,Size Measurement,Camera Focus,Stitch OCR Detections,CSV Formatter,OpenAI,SIFT,Anthropic Claude,Image Convert Grayscale,Roboflow Asset Library Attributes,Florence-2 Model,EasyOCR,Buffer,Twilio SMS Notification,Local File Sink,Icon Visualization,Triangle Visualization,VLM As Classifier,Qwen 3.5 API,JSON Parser,OpenRouter,Distance Measurement,OpenAI,Background Color Visualization,MoonshotAI Kimi,Google Gemini,Grid Visualization,Clip Comparison,Corner Visualization,Reference Path Visualization,Image Slicer,Single-Label Classification Model,Line Counter,Halo Visualization,Dynamic Crop,Webhook Sink,Stability AI Outpainting,Detection Event Log,VLM As Detector,Relative Static Crop,Anthropic Claude,Clip Comparison,Multi-Label Classification Model,OpenAI,Llama 3.2 Vision,Motion Detection,Camera Calibration,Model Comparison Visualization,Trace Visualization,PTZ Tracking (ONVIF),Google Gemma,OPC UA Writer Sink,Line Counter,Circle Visualization,Email Notification,LMM,Event Writer,Instance Segmentation Model,Contrast Equalization,Camera Focus,Heatmap Visualization,Background Subtraction,Image Contours,Qwen 3.6 API,GLM-OCR,VLM As Detector,Classification Label Visualization,Llama 3.2 Vision,Stitch Images,Mask Visualization,Microsoft SQL Server Sink,Stability AI Image Generation,Polygon Visualization - outputs:
Morphological Transformation,Image Preprocessing,Email Notification,VLM As Classifier,Morphological Transformation,Halo Visualization,Object Detection Model,Pixel Color Count,BoT-SORT Tracker,Template Matching,Image Threshold,Text Display,Pixelate Visualization,Keypoint Detection Model,Qwen-VL,OpenAI,CogVLM,Crop Visualization,SAM 3,Dot Visualization,Google Vision OCR,Florence-2 Model,Roboflow Dataset Upload,Mask Edge Snap,Qwen3.5-VL,Roboflow Vision Events,Polygon Zone Visualization,Qwen2.5-VL,Polygon Visualization,Absolute Static Crop,Twilio SMS/MMS Notification,SIFT Comparison,Contrast Enhancement,Single-Label Classification Model,OCR Model,Byte Tracker,Color Visualization,Roboflow Dataset Upload,Gaze Detection,LMM For Classification,Detections Stabilizer,Line Counter Visualization,Image Blur,Stability AI Inpainting,Object Detection Model,Blur Visualization,SAM 3,Perspective Correction,Keypoint Visualization,Anthropic Claude,MoonshotAI Kimi,Google Gemini,Image Slicer,SAM 3,Depth Estimation,Detections Stitch,Ellipse Visualization,Google Gemma API,Object Detection Model,Time in Zone,Image Stack,Google Gemini,Bounding Box Visualization,Label Visualization,Keypoint Detection Model,Camera Focus,Keypoint Detection Model,Multi-Label Classification Model,OpenAI,SIFT,Perception Encoder Embedding Model,Anthropic Claude,Image Convert Grayscale,Moondream2,OC-SORT Tracker,CLIP Embedding Model,Florence-2 Model,Seg Preview,EasyOCR,YOLO-World Model,Buffer,Multi-Label Classification Model,Segment Anything 2 Model,Single-Label Classification Model,Triangle Visualization,Icon Visualization,Qwen 3.5 API,VLM As Classifier,OpenRouter,Dominant Color,Instance Segmentation Model,Qwen3-VL,Instance Segmentation Model,OpenAI,Background Color Visualization,MoonshotAI Kimi,Google Gemini,Clip Comparison,Semantic Segmentation Model,Corner Visualization,Image Slicer,SmolVLM2,Reference Path Visualization,Single-Label Classification Model,Halo Visualization,Dynamic Crop,Instance Segmentation Model,Stability AI Outpainting,VLM As Detector,Anthropic Claude,Relative Static Crop,Multi-Label Classification Model,Clip Comparison,SORT Tracker,OpenAI,Llama 3.2 Vision,Barcode Detection,ByteTrack Tracker,Motion Detection,Camera Calibration,Google Gemma,Model Comparison Visualization,Trace Visualization,QR Code Detection,Circle Visualization,LMM,Event Writer,Instance Segmentation Model,Contrast Equalization,Camera Focus,Heatmap Visualization,Background Subtraction,Qwen 3.6 API,SAM2 Video Tracker,GLM-OCR,Image Contours,Qwen3.5,VLM As Detector,Classification Label Visualization,Llama 3.2 Vision,Stitch Images,Mask Visualization,Stability AI Image Generation,Semantic Segmentation Model,Polygon Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Line Counter Visualization in version v1 has.
Bindings
-
input
image(image): The image to visualize on..copy_image(boolean): Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations..zone(list_of_values): Line zone coordinates in the format [[x1, y1], [x2, y2]] consisting of exactly two points that define the counting line. The line is drawn between these two points, and objects crossing this line are counted. Typically connected from a Line Counter block's zone output..color(string): Color of the line zone. Can be specified as a color name (e.g., 'WHITE', 'RED'), hex color code (e.g., '#5bb573', '#FFFFFF'), or RGB format (e.g., 'rgb(255, 255, 255)'). The line is drawn in this color with the specified opacity..thickness(integer): Thickness of the line zone in pixels. Controls how thick the counting line appears. Higher values create thicker, more visible lines, while lower values create thinner lines. Typical values range from 1 to 10 pixels..text_thickness(integer): Thickness of the count text labels in pixels. Controls how bold the text appears (line width of text characters). Higher values create thicker, bolder text, while lower values create thinner text. Typical values range from 1 to 3..text_scale(float): Scale factor for the count text labels. Controls the size of the text displaying count_in and count_out values. Values greater than 1.0 make text larger, values less than 1.0 make text smaller. Typical values range from 0.5 to 2.0..count_in(integer): Number of objects that crossed into the line zone (crossing from one side to the other in the 'in' direction). Typically connected from a Line Counter block's count_in output (e.g., '$steps.line_counter.count_in'). This value is displayed in the visualization text label..count_out(integer): Number of objects that crossed out of the line zone (crossing from one side to the other in the 'out' direction). Typically connected from a Line Counter block's count_out output (e.g., '$steps.line_counter.count_out'). This value is displayed in the visualization text label..opacity(float_zero_to_one): Opacity of the line zone overlay, ranging from 0.0 (fully transparent) to 1.0 (fully opaque). Controls how transparent the counting line appears over the image. Lower values create more transparent lines that blend with the background, while higher values create more opaque, visible lines. Typical values range from 0.2 to 0.5 for balanced visibility..
-
output
image(image): Image in workflows.
Example JSON definition of step Line Counter Visualization in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/line_counter_visualization@v1",
"image": "$inputs.image",
"copy_image": true,
"zone": [
[
0,
50
],
[
500,
50
]
],
"color": "WHITE",
"thickness": 2,
"text_thickness": 1,
"text_scale": 1.0,
"count_in": "$steps.line_counter.count_in",
"count_out": "$steps.line_counter.count_out",
"opacity": 0.3
}