# STACK

## Core Language & Environment
- **Python**: Primary language for all scripts (v3.10+ expected).

## Principal Libraries
- **OpenCV (`cv2`)**: Core computer vision operations, image thresholding, morphological operations, pattern matching (Template Matching), Difference Hash (`_dhash`), Laplacian variance.
- **NumPy (`np`)**: Matrix operations and mask manipulations for image arrays.
- **EasyOCR (`easyocr`)**: Convolutional/Recurrent Neural Network based OCR for detecting measure numbers to prevent duplications.

## Utilities
- **yt-dlp**: Command-line tool called via `subprocess` for downloading high-quality video frames (720p preferred over 1080p to optimize processing) from YouTube.
- **img2pdf**: Lightweight library to convert combined tab images into A4 PDF output.
- **Pillow (`PIL`)**: Additional image manipulation where OpenCV is less ergonomic.

## Execution Requirements
- Windows OS (noted via `sys.platform == "win32"` encodings).
