Skip to content

Sentinel is a Multithreaded Security System, capable of detecting motion and logging security incidents in real-time.

License

Notifications You must be signed in to change notification settings

Utkarsh-Dikshit/Sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Sentinel: High-Performance Multithreaded Security System

A latency-optimized security application built with C++ and OpenCV, featuring a Producer-Consumer architecture for asynchronous video processing.

πŸ“– Overview

Sentinel is a smart surveillance system designed to solve the "dropped frame" problem common in single-threaded security apps. By decoupling frame capture from image processing, Sentinel ensures zero-latency monitoring even during high-load I/O operations (like writing video evidence to disk).

It features a Smart Hysteresis Recording System that prevents file fragmentation by maintaining a recording buffer for 5 seconds after motion stops, mimicking professional DVR behavior.

πŸš€ Key Technical Features

  • Multithreaded Architecture: Uses a Producer-Consumer pattern. Thread 1 captures hardware frames; Thread 2 handles Computer Vision (Gaussian Blur, Thresholding) and Disk I/O.
  • Memory Safety (RAII): Implements std::lock_guard for deadlock prevention and a Leaky Bucket ring buffer to cap memory usage.
  • Smart Recording: Uses std::chrono timers to manage state transitions (Active vs. Buffering) and generates timestamped evidence_HH-MM-SS.avi files.

πŸ› οΈ Tech Stack

  • Language: C++20 (Modern C++)
  • Library: OpenCV 4.12.0
  • Concurrency: std::thread, std::mutex, std::atomic
  • IDE: Visual Studio 2026

πŸ“‚ Project Structure

Sentinel/
β”œβ”€β”€ SentinelSystem.h    # Header: Interface and Member declarations
β”œβ”€β”€ SentinelSystem.cpp  # Source: Implementation of Threading & Vision Logic
└── main.cpp            # Entry Point: Instantiates the System

πŸ”§ Build & Run

1. Prerequisites

  • Visual Studio 2026 (Desktop C++ Workload).
  • OpenCV 4.12.0 (Add opencv\build\x64\vc16\bin to System Path).

2. Setup

  1. Clone:
    git clone https://github.com/Utkarsh-Dikshit/Sentinel.git
  2. Link OpenCV: Open Sentinel.sln. Right-click Project β†’ Properties:
    • Include Dir: Point to opencv\build\include
    • Library Dir: Point to opencv\build\x64\vc16\lib
    • Input: Add opencv_world4120.lib

3. Execution

  1. Build: Set to x64 (Debug or Release) and press Ctrl+Shift+B.
  2. Run: Press F5.
    • πŸ”΄ REC: Motion Detected.
    • 🟑 BUFFER: 5s Cooldown (Hysteresis).
    • Quit: Press q.

About

Sentinel is a Multithreaded Security System, capable of detecting motion and logging security incidents in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages