config.py module contains all configurable parameters for the EVM Vital Signs Monitor system. These constants control signal processing, ROI detection, and video processing behavior.
Import
Heart Rate Parameters
Parameters controlling heart rate signal processing and validation.Amplification factor for heart rate magnification in Eulerian Video Magnification.
Lower frequency bound for heart rate bandpass filter (Hz).
Corresponds to ~50 BPM (0.83 Hz × 60 = 49.8 BPM).
Upper frequency bound for heart rate bandpass filter (Hz).
Corresponds to 180 BPM (3.0 Hz × 60 = 180 BPM).
Maximum physically plausible heart rate (beats per minute).
Measurements exceeding this are considered invalid.
Minimum physically plausible heart rate (beats per minute).
Measurements below this are considered invalid.
Respiratory Rate Parameters
Parameters controlling respiratory rate signal processing and validation.Amplification factor for respiratory rate magnification.
Higher than heart rate due to smaller motion amplitude.
Lower frequency bound for respiratory rate bandpass filter (Hz).
Corresponds to ~11 BPM (0.18 Hz × 60 = 10.8 BPM).
Upper frequency bound for respiratory rate bandpass filter (Hz).
Corresponds to 30 BPM (0.5 Hz × 60 = 30 BPM).
Maximum physically plausible respiratory rate (breaths per minute).
Measurements exceeding this are considered invalid.
Minimum physically plausible respiratory rate (breaths per minute).
Measurements below this are considered invalid.
ROI Parameters
Parameters controlling Region of Interest (ROI) extraction and processing.Number of levels for ROI pyramid processing in Laplacian pyramid decomposition.
Padding (in pixels) added around the detected face bounding box for ROI extraction.
Ensures the entire facial region is captured.
Target size for ROI processing (width, height) in pixels.
All extracted face ROIs are resized to this dimension for consistent processing.
An alternative size
(640, 480) is available in the source but commented out.
The smaller size reduces computational load.Video Parameters
Parameters controlling video capture and frame processing.Assumed video frame rate (frames per second).
Used for temporal frequency calculations in signal processing.
YOLO Model Paths
Paths to pre-trained YOLO face detection models.Dictionary mapping YOLO model names to their file paths.Access specific models:
ROI Stabilization Parameters
Parameters for stabilizing ROI position across frames to reduce jitter.Threshold for significant ROI position change (pixels).
Changes smaller than this threshold may be smoothed to reduce jitter.
Weights for ROI smoothing filter applied to recent ROI positions.
Most recent position has highest weight (0.3), oldest has lowest (0.1).
Configuration Example
Parameter Relationships
Validation Ranges
| Parameter | Min | Max | Unit | Physiological Basis |
|---|---|---|---|---|
| Heart Rate | 40 | 250 | BPM | Resting to maximum exercise |
| Respiratory Rate | 8 | 35 | BPM | Normal breathing to hyperventilation |
| HR Filter | 0.83 | 3.0 | Hz | 50-180 BPM range |
| RR Filter | 0.18 | 0.5 | Hz | 11-30 BPM range |