This repository is a course workspace with small, focused computer-vision examples (OpenCV + webcam + YOLO) and one larger mini-project for metric evaluation of monocular depth.
IntroductionOpenCV.ipynb- Image I/O, basic transforms, drawing, filtering, etc.
Run:
jupyter notebook IntroductionOpenCV.ipynbwebCam.py– simple webcam stream (pressqto quit)RecordImagesFromWebCam.py– capture frames toframes/(presswto write,qto quit)
Run:
python webCam.py
python RecordImagesFromWebCam.pyyolo_example.py– run detection on a single imageyolo26s.pt– model checkpoint, can be obtained from https://github.com/ultralytics/ultralytics
Run:
python yolo_example.py --image_path bus.jpg --model_size yolo26s.pt --confidence_threshold 0.3Folder:
Metric_Evaluation_Monocular_Depth_Estimation/
Goal:
- Calibrate a webcam (intrinsics + distortion)
- Detect an ArUco marker
- Estimate marker pose and reconstruct its metric plane
- Predict monocular depth (pluggable backend; default: MiDaS)
- Backproject depth values inside the marker region, fit a plane, align scale, compute metrics
Start here:
Metric_Evaluation_Monocular_Depth_Estimation/README.md
Minimal quickstart:
cd Metric_Evaluation_Monocular_Depth_Estimation
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# (1) capture chessboards, then calibrate
python -m src.calibration.capture_chessboard
python -m src.calibration.calibrate_camera --square_size_m 0.025
# (2) capture one evaluation image
python -m src.main --capture --capture_output data/images/capture.jpg
# (3) run evaluation
python -m src.main --image data/images/capture.jpg --marker_length_m 0.048 --depth_backend midasInstall dependencies for the root-level scripts/notebook:
pip install -r requirements.txtThe subproject has its own dependency file:
pip install -r Metric_Evaluation_Monocular_Depth_Estimation/requirements.txt- Webcam not accessible: check permissions / correct camera index.
- YOLO weights: ensure
yolo26s.ptexists in the repo root. - ArUco / pose estimation: see the subproject README (OpenCV wheels differ in
cv2.arucocapabilities).
Educational use for the DLMAIWCCV02 Computer Vision course.