A Python-based privacy protection system that uses camera motion detection to automatically close applications when someone approaches your computer.
- 📷 Multi-Camera Support: Switch between laptop and phone cameras
- 🎯 Smart Motion Detection: Advanced OpenCV-based detection
- 🔒 Application Control: Safely close or minimize applications
- ⚙️ Configurable: Adjustable sensitivity and settings
- 🚀 Auto-Start: Windows startup integration
- 📊 Logging: Detailed activity logs
- 🧪 Testing Tools: Built-in camera testing utilities
- Ensure Python 3.8+ is installed:
python --version
- Run Setup:
This will install all necessary Python packages and create required directories.
python setup.py
- Connect your phone (Optional): If using a phone camera, connect it via Windows Phone Link.
- Test your camera(s):
python test_camera.py
- Start Privacy Guard:
python privacy_guard.py
- Python 3.8 or higher (Python 3.12+ is supported with special
setuptoolshandling). - Windows operating system (for
pywin32and application control features).
- Clone the repository (or download the source code):
git clone https://github.com/UTKARSHKUMAR712/Privacy-Guard-System.git cd Privacy-Guard-System - Run the setup script:
This script will:
python setup.py
- Check your Python version.
- Install required Python packages (
opencv-python,psutil,pywin32,numpy). - Create
logs/andconfig/directories.
Settings are stored in config/settings.json. If the file doesn't exist, it will be created with default values on first run.
| Setting | Description | Default Value |
|---|---|---|
camera_index |
Index of the camera to use (0 for laptop, 1+ for phone/external). | 1 |
motion_sensitivity |
Threshold for motion detection (500-5000). Higher value means less sensitive. | 1500 |
detection_delay |
Minimum seconds between privacy breach detections to prevent spam. | 5 |
auto_close_apps |
If True, applications will be closed/minimized on detection. |
True |
show_camera_feed |
If True, displays the camera feed with detection status. |
True |
enable_notifications |
If True, enables system notifications (not yet implemented). |
True |
log_level |
Logging level (INFO, DEBUG, WARNING, ERROR). |
INFO |
protected_processes |
List of processes that will NOT be closed or minimized. | (System processes) |
target_applications |
List of applications to be considered for closing/minimizing. | (Common browsers/apps) |
force_close_list |
List of applications to always force close (not just minimize). | (Specific games/apps) |
- Install the "Phone Link" app on both your Windows PC and Android phone.
- Pair your devices through the Phone Link app.
- Enable camera sharing in the Phone Link settings.
- Your phone camera will typically appear as camera index
1or2in the Privacy Guard system.
python privacy_guard.py- Run with default settings:
python privacy_guard.py
- Use a specific camera:
python privacy_guard.py --camera [INDEX] May change order # Example: python privacy_guard.py --camera 0 (for laptop camera) # Example: python privacy_guard.py --camera 1 (for phone/external camera)
- Test cameras interactively:
This will run
python privacy_guard.py --test
test_camera.pyfor an interactive camera test. - Show help message:
python privacy_guard.py --help
q- Quit the application.c- Change the active camera source.s- Adjust the motion detection sensitivity.t- Toggle test mode (shows detection status without taking action).h- Hide/Show the camera feed window.
- Python 3.12+ issues: If you encounter issues, try running
pip install setuptoolsandpip install --upgrade pipbeforepython setup.py. - Missing dependencies: Ensure all packages from
requirements.txtare installed. Runpython setup.pyagain. - Camera not found: Verify your camera index. Use
python privacy_guard.py --testto find available cameras. pywin32errors: This project is designed for Windows.pywin32is a Windows-specific library.
Feel free to fork the repository, open issues, or submit pull requests.
This project is licensed under the LICENSE file.