A collection of OpenCV-based Python experiments and tutorial exercises built around computer vision concepts such as face detection, eye detection, and Harris corner detection.
This repository contains sample scripts created while learning OpenCV with Python. The code demonstrates practical usage of OpenCV operations, including:
- Real-time face and eye detection using Haar cascades
- Harris corner detection with non-maximal suppression and normalization
- Image processing utilities for visualization and experimentation
- Python 3.14 or newer
opencv-contrib-pythonmatplotlib
The project dependencies are defined in pyproject.toml.
-
Create and activate a virtual environment in the project folder:
python -m venv .venv .\.venv\Scripts\Activate.ps1
-
Install dependencies:
pip install -r requirements.txt
If you do not have a
requirements.txt, install directly frompyproject.tomldependencies:pip install opencv-contrib-python matplotlib
-
python main.py- A simple entry point that prints a startup message.
-
python harris_corner_cv2.py- Runs a Harris corner detection demo using
assets/checkersboard.pngand displays the processing results.
- Runs a Harris corner detection demo using
-
python t9.py- Runs a live webcam demo for face and eye detection with OpenCV Haar cascades.
Other scripts (t1.py through t8.py, t8_1.py, t6_1.py, test.py) are likely additional tutorial examples and experiments.
main.py– project entry pointharris_corner_cv2.py– Harris corner detection examplet9.py– face and eye detection examplet1.py…t8.py,t8_1.py,t6_1.py– tutorial/exploration scriptsassets/– sample images used for demonstrationspyproject.toml– project metadata and dependency configuration
- The
assetsfolder contains sample images used by the scripts, includingcheckersboard.pngfor corner detection. - Press
qto exit the live webcam demo int9.py.
- OpenCV tutorials: https://opencv2-python-tutorials.readthedocs.io/en/latest/index.html
- OpenCV Haar cascade documentation and examples