Skip to content

Repository files navigation

overstep

overstep is a lightweight, high-performance Python library for boundary violation detection, spatial video analytics, crowd density monitoring, person Re-ID, multi-tripwire perimeter defense, Markov zone transitions, Kalman uncertainty confidence ellipses, GIS GeoJSON integration, multi-camera mapping, collision forecasting, heatmap generation, trajectory clustering, and object tracking.

Complete Feature Architecture

  1. Computational Geometry Suite:

    • Vectorized Batch PIP: batch_point_in_polygon for high-speed $O(M \times N)$ array evaluation checking $M$ query points against an $N$-vertex polygon in a single array operation.
    • Ramer-Douglas-Peucker (RDP) Simplification: simplify_polygon curve simplification.
    • Convex & Concave Hulls: convex_hull and concave_hull.
    • Oriented Bounding Box (OBB): oriented_bounding_box.
  2. Kalbee Kalman State Estimation & Uncertainty Ellipses:

    • 7D SORT Kalman Filter powered by kalbee (KalmanBoxTracker) with Chi-Square outlier rejection (gated_update).
    • Position covariance uncertainty confidence ellipses calculated via get_uncertainty_ellipse.
  3. Markov Zone Transition Graph:

    • ZoneTransitionGraph models transition probability matrices $P(Z_j \mid Z_i)$ and computes anomaly scores for unexpected inter-zone movements.
  4. Async Non-Blocking Event Engine:

    • AsyncEventEngine supports non-blocking stream processing with event listener callbacks (on_enter, on_exit, on_cross, on_dwell).
  5. Crowd Density & Social Distance Analysis:

    • CrowdDensityAnalyzer and SocialDistanceAnalyzer.
  6. Track Re-Identification (Re-ID):

    • ReIDFeatureMatcher matches visual feature embeddings using cosine_similarity.
  7. Multi-Line Virtual Tripwire System:

    • MultiTripwireManager detects sequential perimeter breaches.
  8. Automated Analytics Reports & GeoJSON:

    • AnalyticsReportGenerator and RFC 7946 GeoJSON importer/exporter (polygon_to_geojson, events_to_geojson_feature_collection).
  9. Multi-Camera Aggregation & Collision Forecasting:

    • MultiCameraAggregator and CollisionPredictor.

Installation

Using uv:

uv pip install -e .

Quickstart

import overstep as ov

# 1. Vectorized PIP check for 10,000 points
query_points = np.random.uniform(0, 1000, (10000, 2))
polygon = np.array([[100, 100], [500, 100], [500, 400], [100, 400]])

inside_mask = ov.batch_point_in_polygon(query_points, polygon)

# 2. Setup tracker & async event engine
poly_zone = ov.PolygonZone(polygon=polygon)
sync_engine = ov.EventEngine(poly_zone)
async_engine = ov.AsyncEventEngine(sync_engine)

async_engine.register_callback("enter", lambda ev: print(f"Alert: Track #{ev.track_id} entered!"))

Testing

Run full test suite with uv:

uv run pytest

About

Lightweight boundary violation detection, spatial video analytics, and tracking library in Python.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages