Zone Dwell Violation Snapshot
The Zone Dwell Violation Snapshot action prepares visual evidence for loitering violations by annotating captured images with bounding boxes and dwell time information.
Overview
When someone loiters in a monitored zone, simply recording the event isn't enough—you need clear visual evidence showing:
- Who was there
- Where they were
- How long they stayed
This action takes raw zone dwell event data and transforms it into annotated evidence suitable for violation reports and notifications.
What It Does
1. Receives Event Data
The action receives zone dwell event records from the Zone Dwell Reader action. Each record includes:
- The zone where loitering occurred
- The duration of the dwell
- Reference to captured images
2. Retrieves Images
For each event, the action:
- Looks up the "Full Frame" image stored during detection
- If no stored image exists, attempts to capture a live snapshot as fallback
3. Annotates Images
The action draws on the image:
- Bounding Box: A rectangle around the detected person/object
- Label: Text showing the violation type and dwell time
Example annotation: "Loitering [05:23]" displayed above a red bounding box around the person.
4. Checks for Duplicates
Before processing, the action checks if a violation has already been created for this specific event by this specific rule. This prevents:
- Duplicate violations for the same incident
- Alert fatigue from repeated notifications
5. Prepares for Violation
The annotated image is packaged as an attachment, ready to be passed to the Create Violation action.
Configuration
This action typically requires no direct configuration. It automatically:
- Reads events from the previous action (Zone Dwell Reader)
- Uses system-defined annotation styles
- References the correct image paths
Workflow Position
This action is the middle step in a loitering violation workflow:
- Zone Dwell Reader: Finds events exceeding dwell threshold
- Zone Dwell Violation Snapshot: Prepares annotated evidence (this action)
- Create Violation: Records the violation with the evidence
Understanding Results
| Result | Meaning | Next Step |
|---|---|---|
| processed | Evidence prepared successfully | Pass to Create Violation |
| no_events | No events to process | End workflow (nothing to do) |
| duplicate_skipped | Violation already exists for this event | Event is skipped, continues to next |
| image_not_found | Could not retrieve or capture image | Fallback attempted; may proceed with limited evidence |
Annotation Details
Bounding Box
The bounding box is drawn using:
- Color: Typically red for violations
- Thickness: Bold enough to be clearly visible
- Position: Surrounds the detected person/object
Label Format
The label includes:
- Violation Type: "Loitering" or similar descriptor
- Dwell Time: Formatted as [MM:SS] showing minutes and seconds
Example labels:
- "Loitering [03:45]" - Person lingered for 3 minutes 45 seconds
- "Zone Dwell [12:00]" - Object in zone for 12 minutes
Common Use Cases
Standard Loitering Violation
- Zone Dwell Reader finds events > 5 minutes
- This action annotates each event
- Create Violation records and alerts
Restricted Area Access
- Zone Dwell Reader finds any dwell in restricted zones
- This action annotates (even for brief dwells)
- Create Violation for security response
Tiered Response
- First workflow: Events > 3 minutes → Warning notification
- Second workflow: Events > 10 minutes → Formal violation
Troubleshooting
Image Not Found
-
Storage Path: The detection action stores images at configured paths. Verify the path is accessible.
-
Disk Space: Full disk may prevent image storage during detection.
-
Image Retention: Old images may have been purged. Ensure retention policy keeps images long enough for violation processing.
-
Fallback: The action will attempt a live snapshot if the stored image is missing. If the stream is also unavailable, evidence will be limited.
Duplicate Events Appearing
-
Processing Flag: Ensure the full workflow completes and marks events as processed.
-
Rule Identification: The duplicate check uses the specific rule ID. Multiple rules can create violations for the same event.
-
Database: Check the violation records to understand what was created.
Poor Annotation Quality
-
Image Quality: Annotations are only as good as the source image. Improve camera quality if needed.
-
Bounding Box Accuracy: Bounding boxes come from the detection action. If inaccurate, adjust detection settings.
-
Image Size: Very small images may have unreadable annotations. Ensure adequate resolution.
Fallback Snapshot Issues
-
Stream Availability: If the original stream is offline, fallback capture fails.
-
Timing: Fallback captures current frame, which may not show the violating person anymore.
-
Accept Limitations: For best results, ensure original detection captures and stores images reliably.
Best Practices
-
Reliable Image Storage: Configure adequate storage and ensure detection actions save images successfully.
-
Timely Processing: Run violation workflows frequently so stored images are still available.
-
Consistent Thresholds: Use the same dwell threshold in Zone Dwell Reader as defined in your violation policy.
-
Review Annotations: Periodically review created violations to ensure annotations are clear and accurate.
-
Storage Retention: Set image retention policies to keep images at least 24-48 hours beyond typical violation processing time.
Output
The action produces:
- Annotated Image: PNG/JPG with bounding box and label
- Event Metadata: Original event data for violation record
- Attachment: Formatted for Create Violation action
Related Actions
- Object Detection: Creates zone dwell events with tracking enabled
- Zone Dwell Reader: Finds events to process
- Create Violation: Records the final violation with this action's evidence