Line Counter¶
v2¶
Class: LineCounterBlockV2 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.analytics.line_counter.v2.LineCounterBlockV2
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Count objects crossing a defined line segment in video using tracked detections, maintaining separate counts for objects crossing in opposite directions (in and out), and outputting both count values and the actual detection objects that crossed the line for traffic analysis, people counting, entry/exit monitoring, and directional flow measurement workflows.
How This Block Works¶
This block counts objects that cross a line segment by tracking their movement across video frames. The block:
- Receives tracked detection predictions with unique tracker IDs and an image with embedded video metadata
- Extracts video metadata from the image:
- Accesses video_metadata from the WorkflowImageData object
- Extracts video_identifier to maintain separate counting state for different videos
- Uses video metadata to initialize and manage line zone state per video
- Validates that detections have tracker IDs (required for tracking object movement across frames)
- Initializes or retrieves a line zone for the video:
- Creates a LineZone from two coordinate points defining the line segment
- Configures triggering anchor point if specified (optional - if not specified, uses default anchor behavior)
- Stores line zone configuration per video using video_identifier
- Maintains separate counting state for each video
- Monitors object positions across frames:
- Tracks each object's position using its unique tracker_id
- Detects when an object's triggering anchor point (if specified) or default anchor crosses the line
- Determines crossing direction based on which side of the line the object approaches from
- Counts line crossings:
- In Direction: Objects crossing the line in one direction increment the count_in counter
- Out Direction: Objects crossing the line in the opposite direction increment the count_out counter
- Each unique tracker_id is counted only once per crossing (prevents duplicate counting if object oscillates near line)
- Identifies crossing detections:
- Creates masks identifying which detections crossed in each direction in the current frame
- Filters detections to separate those that crossed "in" from those that crossed "out"
- Returns the actual detection objects (not just counts) for further processing
- Maintains persistent counting state:
- Counts accumulate across frames for the entire video
- State persists for each video until workflow execution completes
- Separate counters for each unique video_identifier
- Returns four outputs:
- count_in: Total number of objects that crossed the line in the "in" direction (cumulative across video)
- count_out: Total number of objects that crossed the line in the "out" direction (cumulative across video)
- detections_in: Detection objects that crossed the line in the "in" direction (current frame crossings)
- detections_out: Detection objects that crossed the line in the "out" direction (current frame crossings)
The line segment defines a virtual boundary in the video frame. The direction (in/out) is determined by which side of the line objects approach from - for a horizontal line, objects coming from above might count as "in" while objects from below count as "out" (or vice versa, depending on line orientation). The triggering anchor (if specified) determines which point on the bounding box must cross the line for the crossing to be counted - if not specified, the line zone uses its default anchor behavior. The count outputs provide cumulative totals across the video, while the detection outputs provide the actual objects that crossed in the current frame, enabling further analysis or visualization of crossing events.
Common Use Cases¶
- People Counting: Count people entering and exiting buildings, stores, or events (e.g., count visitors entering store, track people entering/exiting building, monitor event attendance), enabling entry/exit counting workflows
- Traffic Analysis: Count vehicles passing through intersections or road segments (e.g., count vehicles crossing intersection, track traffic flow in specific directions, monitor vehicle passage at checkpoints), enabling traffic flow analysis workflows
- Retail Analytics: Track customer movement and foot traffic in retail spaces (e.g., count customers entering store sections, track movement between departments, monitor shopping flow patterns), enabling retail foot traffic analytics workflows
- Security Monitoring: Monitor entry and exit at secure areas or checkpoints (e.g., track entries to restricted areas, count people at access points, monitor checkpoint crossings), enabling security access monitoring workflows
- Occupancy Management: Track occupancy changes by counting objects entering and leaving spaces (e.g., count entries/exits to manage room capacity, track vehicle arrivals/departures in parking, monitor space occupancy changes), enabling occupancy tracking workflows
- Wildlife Monitoring: Count animals crossing defined paths or boundaries (e.g., track animal migration patterns, count wildlife crossing roads, monitor animal movement in habitats), enabling wildlife behavior analysis workflows
Connecting to Other Blocks¶
This block receives tracked detections and an image with embedded video metadata, and produces count_in, count_out, detections_in, and detections_out:
- After Byte Tracker blocks to count tracked objects crossing lines (e.g., count tracked people crossing line, track vehicle crossings with consistent IDs, monitor tracked object movements), enabling tracking-to-counting workflows
- After object detection or instance segmentation blocks with tracking enabled to count detected objects (e.g., count detected vehicles, track people crossings, monitor object movements), enabling detection-to-counting workflows
- Using detections_in or detections_out outputs to process or visualize objects that crossed the line (e.g., visualize objects that crossed, analyze crossing objects, filter for crossing events), enabling crossing object analysis workflows
- Before visualization blocks to display line counter information and crossing objects (e.g., visualize line and counts, display crossing statistics, show crossing objects with annotations), enabling counting visualization workflows
- Before data storage blocks to record counting data and crossing events (e.g., log entry/exit counts, store traffic statistics, record crossing objects with metadata), enabling counting data logging workflows
- Before notification blocks to alert on count thresholds or crossing events (e.g., alert when count exceeds limit, notify on specific object crossings, trigger actions based on counts), enabling count-based notification workflows
Version Differences¶
Enhanced from v1:
- Detection Outputs: Adds two new outputs (
detections_inanddetections_out) that provide the actual detection objects that crossed the line in each direction, not just count totals, enabling downstream processing and visualization of crossing objects - Simplified Input: Uses
imageinput that contains embedded video metadata instead of requiring a separatemetadatafield, simplifying workflow connections and reducing input complexity - Optional Triggering Anchor: Makes
triggering_anchoroptional (default None) instead of required, allowing the line zone to use its default anchor behavior when no specific anchor is needed - Improved Integration: Better integration with image-based workflows since video metadata is accessed directly from the image object rather than requiring separate metadata input
Requirements¶
This block requires tracked detections with tracker_id information (detections must come from a tracking block like Byte Tracker). The line must be defined as a list of exactly 2 points, where each point is a list or tuple of exactly 2 coordinates (x, y). The image's video_metadata should include video_identifier to maintain separate counting state for different videos. The block maintains persistent counting state across frames for each video, so it should be used in video workflows where frames are processed sequentially. For accurate counting, detections should be provided consistently across frames with valid tracker IDs.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/line_counter@v2to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
line_segment |
List[Any] |
Line segment defined by exactly two points, each with [x, y] coordinates. Objects crossing from one side count as 'in', objects crossing from the other side count as 'out'. Example: [[0, 100], [500, 100]] creates a horizontal line at y=100. Crossing direction depends on which side objects approach from.. | ✅ |
triggering_anchor |
str |
Optional point on the bounding box that must cross the line for counting. If not specified (None), the line zone uses its default anchor behavior. Options when specified: CENTER, BOTTOM_CENTER, TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, etc. Specifying CENTER ensures the object is substantially across the line before counting, reducing false positives from objects near but not fully crossing the line.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
soft— runtimehosted_serverless,dedicated_deployment; executionremote; inputvideo - Block keeps per-video state in process memory (keyed by video_metadata.video_identifier). With remote step execution on stateless or multi-replica HTTP runtimes, successive requests may be served by different worker processes, so the state resets between calls and the output is meaningless for tracking / counting / aggregation. Use local step execution in an InferencePipeline for stable cross-frame results.
-
soft— inputimage - Block depends on temporal context from video or repeated-frame workflows. With a still image/photo, there is no meaningful history to track, compare, aggregate, or visualize, so the block provides little or no benefit.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Line Counter in version v2.
- inputs:
SAM 3,Time in Zone,Anthropic Claude,Dynamic Crop,Mask Area Measurement,BoT-SORT Tracker,Object Detection Model,Mask Edge Snap,Path Deviation,Stitch OCR Detections,OpenAI,Instance Segmentation Model,Email Notification,EasyOCR,Llama 3.2 Vision,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,YOLO-World Model,Byte Tracker,Detections Transformation,Keypoint Detection Model,Detections Classes Replacement,Slack Notification,Byte Tracker,Single-Label Classification Model,Clip Comparison,VLM As Detector,CogVLM,SORT Tracker,Camera Focus,PP-OCR,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Instance Segmentation Model,OpenAI,Time in Zone,Detection Event Log,Detections Stabilizer,Object Detection Model,SAM 3,SAM 3,Detections Merge,Current Time,Roboflow Visual Search Classifier,OpenAI-Compatible LLM,Florence-2 Model,Stitch OCR Detections,Path Deviation,GeoTag Detection,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,Moondream2,VLM As Classifier,Detection Offset,Llama 3.2 Vision,VLM As Detector,Instance Segmentation Model,Line Counter,MQTT Writer,Roboflow Dataset Upload,Local File Sink,Bounding Rectangle,Google Gemini,Event Writer,Seg Preview,Byte Tracker,Google Gemini,OpenAI,Twilio SMS Notification,SAM 3 Interactive,PLC EthernetIP,Detections Filter,LMM For Classification,Object Detection Model,Velocity,Webhook Sink,Buffer,Template Matching,Twilio SMS/MMS Notification,MoonshotAI Kimi,Image Stack,Multi-Label Classification Model,OPC UA Writer Sink,Google Gemini,OC-SORT Tracker,Dimension Collapse,LMM,Detections Combine,PTZ Tracking (ONVIF),Time in Zone,OCR Model,SAM2 Video Tracker,ByteTrack Tracker,Per-Class Confidence Filter,Email Notification,Clip Comparison,Cosmos 3,Qwen-VL,PLC Writer,Google Gemma,Qwen 3.5 API,Model Monitoring Inference Aggregator,Size Measurement,Motion Detection,Google Gemma API,Detections Consensus,Instance Segmentation Model,CSV Formatter,Segment Anything 2 Model,SAM3 Video Tracker,Detections Stitch,GLM-OCR,Anthropic Claude,Google Vision OCR,Perspective Correction,Qwen 3.6 API,MoonshotAI Kimi,OpenRouter,Qwen3.5-VL,Roboflow Vision Events,OpenAI,PLC ModbusTCP,Overlap Filter,S3 Sink,Roboflow Dataset Upload - outputs:
Image Preprocessing,Anthropic Claude,Image Slicer,Time in Zone,Dynamic Crop,Mask Area Measurement,BoT-SORT Tracker,Bounding Box Visualization,Mask Edge Snap,Object Detection Model,Path Deviation,Absolute Static Crop,SIFT Comparison,Stitch Images,Stitch OCR Detections,Instance Segmentation Model,Email Notification,Stability AI Inpainting,Frame Delay,Distance Measurement,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,Auto Rotate on Edges,Dominant Color,Byte Tracker,Keypoint Detection Model,Detections Transformation,Stability AI Outpainting,Model Comparison Visualization,Detections Classes Replacement,Slack Notification,Line Counter Visualization,Byte Tracker,SORT Tracker,Ellipse Visualization,Corner Visualization,Camera Focus,Morphological Transformation,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Color Visualization,Instance Segmentation Model,Triangle Visualization,Detection Event Log,Detections Stabilizer,Time in Zone,Object Detection Model,Image Contours,Image Threshold,Detections Merge,QR Code Generator,Roboflow Visual Search Classifier,Florence-2 Model,Stitch OCR Detections,Path Deviation,GeoTag Detection,Label Visualization,Detection Offset,Instance Segmentation Model,Line Counter,MQTT Writer,Roboflow Dataset Upload,Identify Outliers,Bounding Rectangle,Event Writer,Byte Tracker,Trace Visualization,Twilio SMS Notification,Pixel Color Count,SAM 3 Interactive,Detections Filter,Object Detection Model,Velocity,Webhook Sink,Halo Visualization,Mask Visualization,Pixelate Visualization,Twilio SMS/MMS Notification,Dot Visualization,Image Stack,OPC UA Writer Sink,OC-SORT Tracker,Keypoint Visualization,Detections Combine,Image Slicer,PTZ Tracking (ONVIF),Time in Zone,Circle Visualization,SAM2 Video Tracker,ByteTrack Tracker,Morphological Transformation,Per-Class Confidence Filter,Email Notification,Halo Visualization,Polygon Visualization,Crop Visualization,Model Monitoring Inference Aggregator,Keypoint Detection Model,Size Measurement,Heatmap Visualization,Icon Visualization,Motion Detection,Detections Consensus,Instance Segmentation Model,Overlap Analysis,Image Blur,Segment Anything 2 Model,Grid Visualization,Detections Stitch,Background Color Visualization,Blur Visualization,Anthropic Claude,Reference Path Visualization,Classification Label Visualization,Background Subtraction,Polygon Visualization,Perspective Correction,Text Display,Roboflow Vision Events,Identify Changes,Keypoint Detection Model,SIFT Comparison,Overlap Filter,Line Counter,Roboflow Dataset Upload
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Line Counter in version v2 has.
Bindings
-
input
image(image): Image with embedded video metadata. The video_metadata contains video_identifier to maintain separate counting state for different videos. Required for persistent counting across frames..detections(Union[instance_segmentation_prediction,object_detection_prediction]): Tracked object detection or instance segmentation predictions. Must include tracker_id information from a tracking block. Objects are counted when their triggering anchor point (if specified) crosses the line segment. The detections_in and detections_out outputs provide the actual detection objects that crossed in each direction..line_segment(list_of_values): Line segment defined by exactly two points, each with [x, y] coordinates. Objects crossing from one side count as 'in', objects crossing from the other side count as 'out'. Example: [[0, 100], [500, 100]] creates a horizontal line at y=100. Crossing direction depends on which side objects approach from..triggering_anchor(string): Optional point on the bounding box that must cross the line for counting. If not specified (None), the line zone uses its default anchor behavior. Options when specified: CENTER, BOTTOM_CENTER, TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, etc. Specifying CENTER ensures the object is substantially across the line before counting, reducing false positives from objects near but not fully crossing the line..
-
output
count_in(integer): Integer value.count_out(integer): Integer value.detections_in(Union[object_detection_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.detections_out(Union[object_detection_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.
Example JSON definition of step Line Counter in version v2
{
"name": "<your_step_name_here>",
"type": "roboflow_core/line_counter@v2",
"image": "<block_does_not_provide_example>",
"detections": "$steps.object_detection_model.predictions",
"line_segment": [
[
0,
50
],
[
500,
50
]
],
"triggering_anchor": "CENTER"
}
v1¶
Class: LineCounterBlockV1 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.analytics.line_counter.v1.LineCounterBlockV1
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Count objects crossing a defined line segment in video using tracked detections, maintaining separate counts for objects crossing in opposite directions (in and out) for traffic analysis, people counting, entry/exit monitoring, and directional flow measurement workflows.
How This Block Works¶
This block counts objects that cross a line segment by tracking their movement across video frames. The block:
- Receives tracked detection predictions with unique tracker IDs and video metadata
- Validates that detections have tracker IDs (required for tracking object movement across frames)
- Initializes or retrieves a line zone for the video:
- Creates a LineZone from two coordinate points defining the line segment
- Stores line zone configuration per video using video_identifier
- Maintains separate counting state for each video
- Monitors object positions across frames:
- Tracks each object's position using its unique tracker_id
- Detects when an object's triggering anchor point (default: CENTER of bounding box) crosses the line
- Determines crossing direction based on which side of the line the object approaches from
- Counts line crossings:
- In Direction: Objects crossing the line in one direction increment the count_in counter
- Out Direction: Objects crossing the line in the opposite direction increment the count_out counter
- Each unique tracker_id is counted only once per crossing (prevents duplicate counting if object oscillates near line)
- Maintains persistent counting state:
- Counts accumulate across frames for the entire video
- State persists for each video until workflow execution completes
- Separate counters for each unique video_identifier
- Returns two count values:
- count_in: Total number of objects that crossed the line in the "in" direction
- count_out: Total number of objects that crossed the line in the "out" direction
The line segment defines a virtual boundary in the video frame. The direction (in/out) is determined by which side of the line objects approach from - for a horizontal line, objects coming from above might count as "in" while objects from below count as "out" (or vice versa, depending on line orientation). The triggering anchor determines which point on the bounding box must cross the line for the crossing to be counted - using CENTER ensures the object is substantially across the line before counting.
Common Use Cases¶
- People Counting: Count people entering and exiting buildings, stores, or events (e.g., count visitors entering store, track people entering/exiting building, monitor event attendance), enabling entry/exit counting workflows
- Traffic Analysis: Count vehicles passing through intersections or road segments (e.g., count vehicles crossing intersection, track traffic flow in specific directions, monitor vehicle passage at checkpoints), enabling traffic flow analysis workflows
- Retail Analytics: Track customer movement and foot traffic in retail spaces (e.g., count customers entering store sections, track movement between departments, monitor shopping flow patterns), enabling retail foot traffic analytics workflows
- Security Monitoring: Monitor entry and exit at secure areas or checkpoints (e.g., track entries to restricted areas, count people at access points, monitor checkpoint crossings), enabling security access monitoring workflows
- Occupancy Management: Track occupancy changes by counting objects entering and leaving spaces (e.g., count entries/exits to manage room capacity, track vehicle arrivals/departures in parking, monitor space occupancy changes), enabling occupancy tracking workflows
- Wildlife Monitoring: Count animals crossing defined paths or boundaries (e.g., track animal migration patterns, count wildlife crossing roads, monitor animal movement in habitats), enabling wildlife behavior analysis workflows
Connecting to Other Blocks¶
This block receives tracked detections and video metadata, and produces count_in and count_out values:
- After Byte Tracker blocks to count tracked objects crossing lines (e.g., count tracked people crossing line, track vehicle crossings with consistent IDs, monitor tracked object movements), enabling tracking-to-counting workflows
- After object detection or instance segmentation blocks with tracking enabled to count detected objects (e.g., count detected vehicles, track people crossings, monitor object movements), enabling detection-to-counting workflows
- Before visualization blocks to display line counter information (e.g., visualize line and counts, display crossing statistics, show counting results), enabling counting visualization workflows
- Before data storage blocks to record counting data (e.g., log entry/exit counts, store traffic statistics, record occupancy metrics), enabling counting data logging workflows
- Before notification blocks to alert on count thresholds or events (e.g., alert when count exceeds limit, notify on occupancy changes, trigger actions based on counts), enabling count-based notification workflows
- Before analysis blocks to process counting metrics (e.g., analyze traffic patterns, process occupancy data, work with counting statistics), enabling counting analysis workflows
Requirements¶
This block requires tracked detections with tracker_id information (detections must come from a tracking block like Byte Tracker). The line must be defined as a list of exactly 2 points, where each point is a list or tuple of exactly 2 coordinates (x, y). The block requires video metadata with video_identifier to maintain separate counting state for different videos. The block maintains persistent counting state across frames for each video, so it should be used in video workflows where frames are processed sequentially. For accurate counting, detections should be provided consistently across frames with valid tracker IDs.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/line_counter@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
line_segment |
List[Any] |
Line segment defined by exactly two points, each with [x, y] coordinates. Objects crossing from one side count as 'in', objects crossing from the other side count as 'out'. Example: [[0, 100], [500, 100]] creates a horizontal line at y=100. Crossing direction depends on which side objects approach from.. | ✅ |
triggering_anchor |
str |
Point on the bounding box that must cross the line for counting. Options: CENTER (default), BOTTOM_CENTER, TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, etc. CENTER ensures the object is substantially across the line before counting, reducing false positives from objects near but not fully crossing the line.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
soft— runtimehosted_serverless,dedicated_deployment; executionremote; inputvideo - Block keeps per-video state in process memory (keyed by video_metadata.video_identifier). With remote step execution on stateless or multi-replica HTTP runtimes, successive requests may be served by different worker processes, so the state resets between calls and the output is meaningless for tracking / counting / aggregation. Use local step execution in an InferencePipeline for stable cross-frame results.
-
soft— inputimage - Block depends on temporal context from video or repeated-frame workflows. With a still image/photo, there is no meaningful history to track, compare, aggregate, or visualize, so the block provides little or no benefit.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Line Counter in version v1.
- inputs:
SAM 3,Time in Zone,Anthropic Claude,Dynamic Crop,Mask Area Measurement,BoT-SORT Tracker,Object Detection Model,Mask Edge Snap,Path Deviation,Stitch OCR Detections,OpenAI,Instance Segmentation Model,Email Notification,EasyOCR,Llama 3.2 Vision,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,YOLO-World Model,Byte Tracker,Detections Transformation,Keypoint Detection Model,Detections Classes Replacement,Slack Notification,Byte Tracker,Single-Label Classification Model,Clip Comparison,VLM As Detector,CogVLM,SORT Tracker,Camera Focus,PP-OCR,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Instance Segmentation Model,OpenAI,Time in Zone,Detection Event Log,Detections Stabilizer,Object Detection Model,SAM 3,SAM 3,Detections Merge,Current Time,Roboflow Visual Search Classifier,OpenAI-Compatible LLM,Florence-2 Model,Stitch OCR Detections,Path Deviation,GeoTag Detection,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,Moondream2,VLM As Classifier,Detection Offset,Llama 3.2 Vision,VLM As Detector,Instance Segmentation Model,Line Counter,MQTT Writer,Roboflow Dataset Upload,Local File Sink,Bounding Rectangle,Google Gemini,Event Writer,Seg Preview,Byte Tracker,Google Gemini,OpenAI,Twilio SMS Notification,SAM 3 Interactive,PLC EthernetIP,Detections Filter,LMM For Classification,Object Detection Model,Velocity,Webhook Sink,Buffer,Template Matching,Twilio SMS/MMS Notification,MoonshotAI Kimi,Image Stack,Multi-Label Classification Model,OPC UA Writer Sink,Google Gemini,OC-SORT Tracker,Dimension Collapse,LMM,Detections Combine,PTZ Tracking (ONVIF),Time in Zone,OCR Model,SAM2 Video Tracker,ByteTrack Tracker,Per-Class Confidence Filter,Email Notification,Clip Comparison,Cosmos 3,Qwen-VL,PLC Writer,Google Gemma,Qwen 3.5 API,Model Monitoring Inference Aggregator,Size Measurement,Motion Detection,Google Gemma API,Detections Consensus,Instance Segmentation Model,CSV Formatter,Segment Anything 2 Model,SAM3 Video Tracker,Detections Stitch,GLM-OCR,Anthropic Claude,Google Vision OCR,Perspective Correction,Qwen 3.6 API,MoonshotAI Kimi,OpenRouter,Qwen3.5-VL,Roboflow Vision Events,OpenAI,PLC ModbusTCP,Overlap Filter,S3 Sink,Roboflow Dataset Upload - outputs:
Image Preprocessing,Anthropic Claude,Image Slicer,BoT-SORT Tracker,Bounding Box Visualization,Mask Edge Snap,Object Detection Model,Absolute Static Crop,SIFT Comparison,Stitch Images,Stitch OCR Detections,Instance Segmentation Model,Email Notification,Stability AI Inpainting,Frame Delay,Track Class Lock,Dynamic Zone,Auto Rotate on Edges,Dominant Color,Byte Tracker,Keypoint Detection Model,Stability AI Outpainting,Detections Classes Replacement,Slack Notification,Line Counter Visualization,Byte Tracker,SORT Tracker,Ellipse Visualization,Corner Visualization,Morphological Transformation,Anthropic Claude,Roboflow Visual Search,Color Visualization,Instance Segmentation Model,Triangle Visualization,Detections Stabilizer,Object Detection Model,Image Contours,Image Threshold,QR Code Generator,Roboflow Visual Search Classifier,Stitch OCR Detections,Label Visualization,Detection Offset,Instance Segmentation Model,MQTT Writer,Identify Outliers,Event Writer,Byte Tracker,Trace Visualization,Twilio SMS Notification,Pixel Color Count,Object Detection Model,Webhook Sink,Halo Visualization,Mask Visualization,Pixelate Visualization,Twilio SMS/MMS Notification,Dot Visualization,Image Stack,OPC UA Writer Sink,OC-SORT Tracker,Keypoint Visualization,Image Slicer,PTZ Tracking (ONVIF),Circle Visualization,SAM2 Video Tracker,ByteTrack Tracker,Morphological Transformation,Email Notification,Halo Visualization,Polygon Visualization,Crop Visualization,Keypoint Detection Model,Heatmap Visualization,Icon Visualization,Motion Detection,Detections Consensus,Instance Segmentation Model,Image Blur,Grid Visualization,Blur Visualization,Anthropic Claude,Reference Path Visualization,Classification Label Visualization,Background Subtraction,Polygon Visualization,Perspective Correction,Text Display,Roboflow Vision Events,Identify Changes,Keypoint Detection Model,SIFT Comparison
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Line Counter in version v1 has.
Bindings
-
input
metadata(video_metadata): Video metadata containing video_identifier to maintain separate counting state for different videos. Required for persistent counting across frames..detections(Union[instance_segmentation_prediction,object_detection_prediction]): Tracked object detection or instance segmentation predictions. Must include tracker_id information from a tracking block. Objects are counted when their triggering anchor point crosses the line segment..line_segment(list_of_values): Line segment defined by exactly two points, each with [x, y] coordinates. Objects crossing from one side count as 'in', objects crossing from the other side count as 'out'. Example: [[0, 100], [500, 100]] creates a horizontal line at y=100. Crossing direction depends on which side objects approach from..triggering_anchor(string): Point on the bounding box that must cross the line for counting. Options: CENTER (default), BOTTOM_CENTER, TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, etc. CENTER ensures the object is substantially across the line before counting, reducing false positives from objects near but not fully crossing the line..
-
output
Example JSON definition of step Line Counter in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/line_counter@v1",
"metadata": "<block_does_not_provide_example>",
"detections": "$steps.object_detection_model.predictions",
"line_segment": [
[
0,
50
],
[
500,
50
]
],
"triggering_anchor": "CENTER"
}