1. Executive Summary
EdgeTracker is a standalone, browser-based application designed to monitor physical displacement via webcam. The system utilizes real-time image processing to track specific edges with user-defined area of interest, OpenCV will tracking the shape of object and converts pixel-data into physical units (mm) via perspective correction, and provides automated alerting based on movement thresholds.
System Type: Standalone HTML/JS/CSS Application
Deployment: Offline-capable Web Environment
Core Tech: OpenCV, Homography Matrix, Real-time Video Processing
This white paper outlines the technical architecture, functional capabilities, and operational workflow of EdgeTracker, positioning it as a non-contact metrology tool for real-time structural or mechanical monitoring in industrial, laboratory, or field environments.
2. Problem Statement
Challenge: Traditional displacement measurement systems often require expensive hardware (laser sensors, LVDTs) or complex physical setups that limit flexibility and portability. In scenarios where continuous visual monitoring of edges or structural lines is required—such as checking for thermal expansion, mechanical vibration, or assembly alignment—existing solutions may lack real-time feedback or require manual data entry.
EdgeTracker addresses this by leveraging standard webcams and computer vision algorithms to provide a low-cost, offline-capable solution that translates 2D pixel movement into accurate 3D physical measurements (mm) without requiring external sensors.
3. Solution Overview
EdgeTracker operates as a single-file HTML/JS/CSS application (`index.html`) designed for deployment in any standard web environment. It runs entirely offline, ensuring data privacy and minimal infrastructure overhead. The system combines computer vision with geometric calibration to deliver precise metrology results directly within the browser.
3.1 Core Capabilities
- Webcam Integration: Captures real-time video streams from standard USB or built-in webcams.
- Edge Detection & Tracking: Uses Canny edge detection and manual labeling (Line 1–10) to lock onto specific structural features frame-by-frame.
- Perspective Correction: Applies a Homography Matrix transformation based on user-defined trapezoid calibration points to flatten the camera's angle of view into a virtual rectangle.
- Physical Scaling: Converts adjusted pixel data into real-world units (mm) using user-input scaling factors for X and Y axes.
- Intelligent Alerting: Monitors displacement vectors against configurable thresholds with debounce logic to filter out noise or transient interference.
4. Technical Workflow & Architecture
The system follows a three-phase processing pipeline designed for robustness and accuracy:
Phase A: Environment & Optical Setup
1. Deployment: Runs as a standalone `index.html` file, requiring no server-side dependencies.
2. Visual Calibration: Users position the webcam to maintain a constant, static view of the target area.
3. Image Pre-processing: Includes UI sliders for adjusting Contrast and Threshold levels. This facilitates "Sharp Edge" detection by converting the video feed into a high-contrast map before analysis.
Phase B: Selection & Labeling
1. Edge Identification: The system detects sharp edges and overlays them with highlight lines on the video feed.
2. Manual Assignment: Users can select specific detected edges and label them (e.g., Line 1 to Line 10) for persistent tracking across frames.
3. Tracking Logic: Application logic locks onto these edge lines, following their movement frame-by-frame to calculate delta changes.
Phase C: Perspective & Scaling (The Measurement Plane)
1. Plane Definition: Users define a Trapezoid Plane by placing four points on the screen. This accounts for the camera's angle of view and distortion.
2. Perspective Correction: The app calculates a Homography Matrix to transform the trapezoid into a virtual rectangle, effectively flattening the perspective for accurate measurement.
3. Scaling Factor: Users input a `mm/pixel` ratio for both X and Y axes, allowing the system to convert "Adjusted Pixel" movement into real-world units (e.g., millimeters).
4.1 Mathematical Transformation
The core of the perspective correction involves calculating a Homography Matrix ($H$) to map points from the distorted image plane ($P_{raw}$) to the corrected measurement plane ($P_{mm}$):
// Pseudo-code for Perspective Transformation
function applyHomography(P_raw, H_matrix) {
// Transform raw pixel coordinates using 3x3 Homography Matrix
let P_corrected = H_matrix * P_raw;
return P_corrected;
}
This ensures that measurements taken on the screen correspond accurately to physical dimensions in the real world.
5. Monitoring & Alerting Logic
Displacement Calculation
Upon clicking "Initial", the system benchmarks the current position as $(0, 0)$. It then provides a real-time data readout including:
• Raw Pixel Delta: Movement observed directly on the screen.
• Adjusted Pixel Delta: Movement corrected for perspective distortion.
• Physical Delta (mm): Displacement in millimeters for $X$ and $Y$ axes.
• Vector Sum: The absolute magnitude of movement ($V = \sqrt{x^2 + y^2}$).
5.1 Signal Filtering & Fault Protection
To ensure reliability in dynamic environments, EdgeTracker employs advanced logic for displacement calculation and fault protection.
| Parameter |
Description |
Default/Configurable |
| Alert Level |
User-defined distance threshold (mm). |
Yes (e.g., 5.0 mm) |
| Trigger Duration |
Time displacement must stay above Alert Level. |
Yes (e.g., 2.0 seconds) |
Logic Flow:
If (Current_V > Alert_V) { Start Timer }
Else { Reset Timer }
If (Timer >= Trigger_Duration) { Fire_Alert }
6. Deployment & Requirements
System Requirements
- Hardware: Standard PC or laptop with an active webcam and microphone (optional).
- Software: Modern web browser (Chrome, Firefox, Edge) capable of running HTML5/JS.
- Connectivity: Optional internet access for initial load; full offline operation thereafter.
File Structure
The application is designed as a single `index.html` file containing all necessary CSS, JavaScript, and image assets. This simplifies distribution and deployment in restricted network environments (e.g., factory floors or remote sites).
7. Conclusion
Summary:
EdgeTracker represents a significant advancement in accessible metrology by bridging the gap between consumer hardware (webcams) and industrial-grade measurement precision. By combining real-time OpenCV processing with geometric perspective correction, it delivers actionable physical data directly from video feeds. Its modular design allows for easy integration into larger monitoring systems or standalone use as a rapid inspection tool.
Document prepared based on Technical Specification v0.2
Version: 0.5.5 | Date: 12/03/2026