You can use the Stopped vehicle detection scenario to detect stopped vehicles in a restricted area.
This scenario is designed for monitoring changes in an outdoor scene, such as a car parking in an area where parking is not permitted. The objects to be detected should meet the size requirements described in the recommended camera configuration for object detection analytics.
This scenario analyzes foreground motion when analyzing scenes. Only vehicles that are detected as remaining still for the configured duration in the defined area foreground can trigger alerts.
The following image shows a configuration of a Stopped vehicle detection scenario: