RegionKit Open Editor →
exclusion zones computer vision false positives privacy detection zones

Exclusion Zones in Computer Vision — Why and How to Define Them

Exclusion zones filter out regions your CV system should ignore — reducing false positives, protecting privacy, and improving detection accuracy. Learn why they matter and how to define them precisely.

· RegionKit

Every camera captures more than you want to monitor. A security camera watching a car park also sees the public road behind it. A factory camera monitoring a production line also sees the maintenance worker walking past. An entrance camera captures not just the door, but the window beside it showing a private office.

Exclusion zones tell your CV system what to ignore. Defining them precisely is one of the most impactful things you can do to reduce false positive rates and ensure compliance.

Why exclusion zones matter

Reducing false positives

The most common reason to define exclusion zones is noise. Consider:

Drawing an exclusion zone over each of these areas removes the false positives completely — without any model changes.

Privacy compliance

In many jurisdictions, recording people in certain areas without their knowledge is unlawful. Common examples:

Exclusion zones provide the technical mechanism for privacy-by-design: any detection whose centroid or bounding box falls inside an exclusion zone is suppressed before it is logged, alerted on, or stored.

Directing inference compute

Running a full-resolution detector on parts of the frame you don’t care about wastes GPU/CPU cycles. Some implementations use exclusion zones to crop or mask the frame before inference, reducing the tensor size and improving throughput.

Types of exclusion zones

Static background exclusion — Mask out areas of permanent background activity: a clock on a wall, a blinking light, a flag in the wind. These generate motion detection events regardless of content.

Out-of-bounds exclusion — Areas inside the camera’s field of view but outside the monitored physical space. A ceiling-mounted camera that can see a private office through a glass partition. A car park camera that captures a bus stop on the adjacent road.

Privacy exclusion — Areas where detection must be suppressed for legal or ethical reasons.

Perspective-based dead zones — Areas where the camera angle makes detection unreliable. Objects very close to the camera appear large and distorted; objects at extreme angles appear flattened. Excluding these zones avoids low-confidence detections polluting your data.

Defining exclusion zones in RegionKit

Open RegionKit and load a still frame from your camera.

  1. Create an Exclusion layer in the Layers panel — use red as the colour and set a dashed stroke style to visually distinguish exclusion zones from detection zones
  2. Activate the Polygon tool (P)
  3. Trace the boundary of the area to exclude — be generous with the boundary rather than tight, especially for privacy zones
  4. Label the zone descriptively (road_exclusion, private_office_window, etc.)
  5. Add a tag noting the reason (privacy, false_positive_source, maintenance_area)

Repeat for each exclusion area. Use the visibility toggle on the Exclusion layer to preview the scene with and without exclusion zones visible.

Applying exclusion zones in Python

Load the exclusion zone polygons from the exported JSON and filter any detection whose centroid falls inside one:

import json
import cv2
import numpy as np

with open('scene.json') as f:
    scene = json.load(f)

# Build exclusion zone polygons
exclusion_zones = []
for ann in scene['annotations']:
    if not ann.get('visibility', True):
        continue
    label = ann.get('label', '')
    if 'exclusion' in label.lower() or ann.get('tags', []):
        # Use tag-based filtering or label-based filtering
        pass
    # Simpler: filter by layer name
    exclusion_zones_raw = [
        ann for ann in scene['annotations']
        if ann['type'] == 'polygon' and 'exclusion' in ann.get('label', '').lower()
    ]

def build_poly(ann):
    pts = ann['data']['points']
    return np.array(list(zip(pts[::2], pts[1::2])), dtype=np.float32)

exclusion_polys = [build_poly(ann) for ann in exclusion_zones_raw]

def is_excluded(cx, cy):
    for poly in exclusion_polys:
        if cv2.pointPolygonTest(poly, (float(cx), float(cy)), False) >= 0:
            return True
    return False

# In your detection loop:
for det in detections:
    x1, y1, x2, y2 = det['bbox']
    cx = (x1 + x2) / 2
    cy = (y1 + y2) / 2

    if is_excluded(cx, cy):
        continue  # suppress this detection

    # Process valid detection
    handle_detection(det)

Combining exclusion zones with detection zones

A typical zone configuration has both:

# Detection: only process objects inside at least one detection zone
# Exclusion: never process objects inside any exclusion zone

def in_detection_zone(cx, cy):
    return any(
        cv2.pointPolygonTest(poly, (float(cx), float(cy)), False) >= 0
        for poly in detection_polys
    )

def in_exclusion_zone(cx, cy):
    return any(
        cv2.pointPolygonTest(poly, (float(cx), float(cy)), False) >= 0
        for poly in exclusion_polys
    )

# Process only if inside a detection zone AND not inside any exclusion zone
if in_detection_zone(cx, cy) and not in_exclusion_zone(cx, cy):
    handle_detection(det)

Documentation and audit trails

For regulated deployments, keep records of:

RegionKit’s description and tags fields support this. Include the reason, review date, and approver in each exclusion zone’s metadata. Export as PNG for a visual audit document, or publish to a URL for accessible documentation.


Related: Camera Coverage Zone Planning · Detection Zone Editor · How to Define Regions of Interest

Try RegionKit — it's free

Browser-based ROI editor. No install, no account, no data upload.

Open the Editor