Module 8/10 · Weeks 12 · 14 h

Event detection and object tracking

UAT 454 UAS for Surveillance, Monitoring and Security

About 85 minDraft, awaiting reviewLast updated 21 October 2026

Lesson

By the end of this module you will be able to

  1. Explain event rules in security, such as line crossing and zone intrusion
  2. Compute how OR and AND combination of two sensors affects detection probability and nuisance alarms
  3. Associate new detections with current tracks using a distance gate
  4. Identify the limits of automatic detection and tracking

Prerequisites: Module 7 Integrating cameras, sensors, communications and control centres

Why this matters

Every sensor has two problems that trade off: set it too sensitive and it alarms for wind, dogs and leaves; too dull and it misses real intruders. Combining sensors and tracking objects continuously improves both, if you understand what each method trades for what.

Event rules

Security video analytics do not decide “who is the criminal”; they apply defined event rules, such as:

  • Line crossing a person or vehicle crosses a virtual line parallel to the fence from outside to inside
  • Intrusion a person stays in a restricted zone longer than allowed, such as the truck yard after hours
  • Loitering a person stays in one area unusually long
  • Object left or removed an item appears in or disappears from the scene

Garcia (2007) distinguishes nuisance alarms, caused by something other than an intruder such as animals or wind, from false alarms, caused by the equipment itself. Both erode operators’ trust in the system.

Combining two sensors

If two sensor types work independently, OR combination (either alarms) raises detection probability but adds both sensors’ nuisance alarms. AND combination (both must alarm close together in time) cuts nuisance alarms sharply but also lowers detection.

Example 1 OR or AND?

The fence sensor detects with probability 0.90 and raises 8 nuisance alarms a day; video analytics detect with 0.85 and raise 3 a day. AND requires both within 30 seconds.

# detection probability of the fence sensor and video analytics (independent)
p_fence, p_video = 0.90, 0.85
# nuisance alarms per day
nar_fence, nar_video = 8.0, 3.0
window = 30 / 86400                    # 30 s coincidence window, in days

p_or = 1 - (1 - p_fence) * (1 - p_video)
p_and = p_fence * p_video
# AND nuisance: both sensors alarm by chance within the 30 s window
nar_and = nar_fence * nar_video * 2 * window
print(f"OR : Pd {p_or:.3f}, nuisance {nar_fence + nar_video:.1f}/day")
print(f"AND: Pd {p_and:.3f}, nuisance {nar_and:.4f}/day")
OR : Pd 0.985, nuisance 11.0/day
AND: Pd 0.765, nuisance 0.0167/day

OR detects with 0.985 but gives 11 nuisance alarms a day. AND cuts nuisance to about 0.017 a day (roughly one in 60 days) but detection falls to 0.765. The distribution centre uses a mix: OR to send the drone to verify, and AND to dispatch the response team immediately without waiting, gaining both benefits because drone verification costs far less than sending people.

Four horizontal bars of detection probability: fence sensor 0.9, video analytics 0.85, OR logic 0.985 and AND logic 0.765. On the right, nuisance alarms of 8, 3, 11 and 0.017 per day
Figure 1 Combining two sensors with OR and AND

This calculation assumes the sensors are independent. In reality strong wind can trigger both the fence sensor and the camera (swaying trees) at once, so AND nuisance will be higher than computed; collect real statistics for at least several weeks after installation.

Object tracking

When the drone finds an intruder, it must follow them continuously to give the response team their position. With several people, the system must know which earlier person each new detection belongs to. The standard method predicts each track’s position with a Kalman filter, then associates new detections with the nearest prediction, as in SORT (Bewley and colleagues, 2016), using a distance gate to reject pairs that are implausibly far apart.

Example 2 Who is each new detection?

Two people, T1 and T2, are being tracked. A new thermal frame shows three detections; the gate is 5 m.

import math
# predicted positions of current tracks (m) and detections in the new frame
tracks = {"T1": (120.0, 45.0), "T2": (132.0, 60.0)}
detections = [(121.5, 46.2), (131.0, 58.8), (160.0, 20.0)]
gate = 5.0                              # association gate (m)

used = set()
for tid, p in tracks.items():
    d, j = min((math.dist(p, q), j) for j, q in enumerate(detections) if j not in used)
    if d <= gate:
        used.add(j)
        print(f"{tid} <- detection {j} ({d:.2f} m)")
    else:
        print(f"{tid}: no detection within gate, coast")
new = [j for j in range(len(detections)) if j not in used]
print("new tracks from detections:", new)
T1 <- detection 0 (1.92 m)
T2 <- detection 1 (1.56 m)
new tracks from detections: [2]

T1 pairs with detection 0 at 1.92 m, and T2 with detection 1 at 1.56 m. Detection 2 is outside every gate, so a new track starts; it may be a third person or a dog, and the operator must confirm. Associating one track at a time is simple, but people walking close together may be swapped, so real systems solve all pairs at once, for example with the Hungarian method.

Two purple squares are the predicted positions of T1 and T2, each with a 5 metre gate circle. Pink circle d0 is inside T1's gate and d1 inside T2's gate. d2 is far away at the lower right, labelled new track
Figure 2 Associating detections with tracks using a distance gate

Limits of automatic detection

  • Thermal images struggle to tell people from similar-sized animals at long range
  • Rain and fog cut the detection range of both camera types
  • Intruders who know the system may move very slowly or hide in blind spots
  • Models trained on fixed-camera images may perform poorly on drone images taken from different angles

The DORI detail levels of IEC 62676-4:2014 (replaced by seven levels in the 2025 edition) help establish whether each camera can really detect or recognise. Decisions to respond must always involve a human operator.

Handing a track to the ground team

The tracker gives a position and a velocity, which is what a response vehicle needs: not where the intruder is, but where he will be.

Example 3 Why must the report carry heading and speed?

The intruder was last seen at zone 7, (600, 50) m, running west at 5 m/s. The response vehicle leaves the guard post at (300, 350) m and drives straight at 8 m/s (all assumed). Compare driving to the reported point with driving to the predicted meeting point, using the report times of module 7 (14 and 45 words at 2.5 words per second).

import math

seen, vel = (600.0, 50.0), (-5.0, 0.0)       # last sighting (m) and velocity (m/s) of the intruder
post, speed = (300.0, 350.0), 8.0            # guard post (m) and vehicle speed (m/s)

def intercept(p, v, start, s):               # time t > 0 after setting off with |p + v t - start| = s t
    dx, dy = p[0] - start[0], p[1] - start[1]
    a, b, c = v[0]**2 + v[1]**2 - s**2, 2 * (dx * v[0] + dy * v[1]), dx * dx + dy * dy
    roots = [(-b + sgn * math.sqrt(b * b - 4 * a * c)) / (2 * a) for sgn in (1, -1)]
    return min(t for t in roots if t > 0)

t_go = math.dist(seen, post) / speed                     # a) drive to the point in the report
miss = math.dist(seen, (seen[0] + vel[0] * t_go, seen[1] + vel[1] * t_go))
print(f"to the reported point: arrive {t_go:.1f} s, the intruder is then {miss:.0f} m away")
for words in (14, 45):                                   # b) drive to the predicted meeting point
    delay = words / 2.5                                  # time to speak the report
    now = (seen[0] + vel[0] * delay, seen[1] + vel[1] * delay)
    t = intercept(now, vel, post, speed)
    print(f"{words}-word report ({delay:4.1f} s): meet {t:.1f} s after setting off, {delay + t:.1f} s after the sighting")
to the reported point: arrive 53.0 s, the intruder is then 265 m away
14-word report ( 5.6 s): meet 38.8 s after setting off, 44.4 s after the sighting
45-word report (18.0 s): meet 37.6 s after setting off, 55.6 s after the sighting

A position alone sends the vehicle where the intruder was 53 seconds ago, 265 m behind him. With heading and speed the two meet about 38 seconds after the vehicle sets off. The report time still counts: the meeting comes 44.4 seconds after the sighting with the structured report and 55.6 with the spoken description, 11.2 seconds later, a large loss against the 20-second margin in module 6. The prediction assumes a straight run at constant speed, so the tracker keeps updating and the operator corrects the vehicle by radio.

Module lab

Lab: testing event rules and tracking

  1. Set up a camera or fly a drone over an open yard; draw a virtual line and a restricted zone in video-analytics software
  2. Have classmates cross the line, loiter, and walk close together in pairs; record detections and track swaps
  3. Compute OR and AND for the two sensors your group tested with the code in Example 1
  4. Try gates of 2, 5 and 10 m in the Example 2 code on your recorded data, and explain the trade-off

Common mistakes

Watch out

  • Using OR everywhere, flooding operators with nuisance alarms
  • Using AND everywhere, missing intruders that one sensor cannot see
  • Assuming sensors are independent when wind and rain affect both at once
  • Setting the gate too wide, pairing the wrong people
  • Letting the system dispatch responders without operator confirmation

Summary

  • Event rules such as line crossing, intrusion and loitering turn video into checkable alarms
  • OR raises detection but adds nuisance; AND cuts nuisance but lowers detection; good systems use both at different stages
  • Tracking predicts positions and associates new detections within a distance gate
  • Automatic detection has limits; operators always decide on response

Check your understanding

  1. Two sensors detect with 0.8 and 0.7. What is the OR combination?
  2. From question 1, what is the AND combination?
  3. How does a nuisance alarm from a passing dog differ from a false alarm?
  4. A track is predicted at (50, 20) and a detection is at (53, 24). With a 5 m gate, can they be paired?
  5. Why might real AND nuisance alarms exceed the computed value?
Answers
  1. A nuisance alarm comes from something other than an intruder, such as an animal; a false alarm comes from the equipment itself
  2. The distance is m, exactly the gate, so yes
  3. The same cause, such as strong wind, can trigger both sensors together, so they are not independent

Key formulas

OR combination
AND combination
Chance coincident nuisance alarms

Key references

  1. Garcia, M. L. (2007). Design and evaluation of physical protection systems (2nd ed.). Butterworth-Heinemann. link
  2. Bewley, A., Ge, Z., Ott, L., Ramos, F., & Upcroft, B. (2016). Simple online and realtime tracking. In 2016 IEEE International Conference on Image Processing (pp. 3464–3468). link
  3. Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35–45. link
  4. International Electrotechnical Commission. (2014). Video surveillance systems for use in security applications – Part 4: Application guidelines (IEC 62676-4:2014, Ed. 1.0; revised by Ed. 2.0 in 2025). link
  5. International Electrotechnical Commission. (2025). Video surveillance systems for use in security applications – Part 4: Application guidelines (IEC 62676-4:2025, Ed. 2.0). link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Artificial intelligence and computer vision · Inspection, industry and surveillance