This project is a Windows-only Python and OpenCV learning experiment built around desktop-window capture, cascade-classifier detection, visible rectangle review, and optional mouse interaction.The useful portfolio focus is the computer vision workflow: capture a frame, run a detector, inspect the rectangles, and document the constraints that still need engineering work. It should be read as an experiment with limitations, not as a polished application or a deployment guide.
What It Demonstrates
Window Capture: WindowCapture uses Win32 APIs to find a named desktop window, crop the title bar and borders, and return an image OpenCV can process.
Cascade Classifier Detection: main.py loads cascade_classifier/cascade/cascade.xml and runs OpenCV detection against the captured frame.
Visible Result Review: Vision.draw_rectangles() draws detection rectangles so results can be inspected visually.
Click-Point Calculation: Vision.get_click_points() converts rectangles into center points, which makes the coordinate math explicit and reviewable.
Retraining Notes: The README documents the manual OpenCV cascade retraining workflow and the external command-line tools required.
Technologies Used
OpenCV: Computer vision and cascade classifier loading.
Python: Main scripting language for the capture and detection workflow.
PyAutoGUI: Optional desktop mouse movement and clicking behavior when the script is run.
PyWin32: Windows desktop-window lookup and capture support.
NumPy: Image-array handling before OpenCV processing.
Current Constraints
The capture code is Windows-specific.
main.py uses a hard-coded window title.
The script can move the mouse and click while running.
The current click behavior uses the first detected rectangle and then sleeps for 10 seconds.
There is no config file, command-line interface, or automated test suite yet.
Retraining is manual and depends on OpenCV command-line utilities that are not installed by pip install opencv-python.
Next Improvements
The next useful work is measurement and maintainability:
Add tests for rectangle-to-click-point math.
Add tests or fixtures around capture offsets.
Define a reviewed image batch for detection-quality checks.
Record detection-loop timing in a repeatable environment.
Turn hard-coded settings into configuration.
Keep retraining commands and dataset notes easy to reproduce.