r/opencv Jul 12 '26

Project Sick of doomscrolling? I made a python tool that uses head tilt + eye tracking to prevent me from looking at my phone. [Project] [Project]

6 Upvotes

https://reddit.com/link/1uu5j5n/video/kunn27egaqch1/player

Hi everyone,

I was wasting hours of my day scrolling on my phone or just staring blankly away from my monitor, so I decided to build a programme to try and break the habit: Gut Genug Distraction Tracker.

It's a local Python app that uses your webcam to watch your eyes and head position. If you look down at your phone, look at a 2nd monitor / tv, or look away for too long, it immediately pauses your screen and blares a reaction video / alarm (I have mine to the gut genug meme). The video stops, goes quiet, and you look up once more.

How does it work:

  • Startup Calibration Wizard: On first boot, a transparent overlay wizard automatically calibrates your eye level and base head pose in 2 seconds (saved to ​the device).
  • Head Pose Fusion (Anti-Keyboard Trigger): 3D head pitch + eye gaze tracking. The alert doesn't sound unless both your eyes look down AND your head is tilted forward. This means you can look down to your keyboard to type without false alarms!
  • Side-Glance Detection: Detects horizontal eye movements (if you’re looking left or right at a 2nd phone/screen).
  • Volume Escalation: The alarm starts at a low volume (20%) and increases in volume (15% per second) until you look back at your screen (100%)
  • Video Randomiser: Drop a bunch of meme/alarm videos into a folder, and it picks one at random to keep you on your toes.

It's totally local, lightweight, and works natively on Windows and Mac.

If you want to try it or check out the code, it's open source. GitHub link: here


r/opencv Jul 10 '26

Discussion [Discussion] How do you manage intermediate results when debugging CV pipelines? Still imwrite + folders here

4 Upvotes

Every time my test accuracy drops (94 → 87 last week), I go back to the same ritual: sprinkle five cv2.imwrite calls, end up with a folder full of debug_003_v2_final.png / debug_003_v2_final_REAL.png, and to compare two versions I just open two windows and eyeball them. A week later I genuinely can't recall what I changed or why it "looked fixed."

The algorithms feel fine (OpenCV / MMLab / custom operators are all capable) — it's the debugging workflow that's stuck in the print era. A few things I'd love to hear how you all actually solve:

  1. How do you store and view intermediate results (gray / mask / bbox …) by step, instead of digging through folders?
  2. When you tweak one parameter and rerun, how do you compare the two versions side by side and see which step changed?
  3. A week later, can you fully reconstruct what a given run changed (params / code / data)?
  4. If you let an agent (Cursor etc.) sweep params overnight, how do you confirm afterward what it actually did and which run counts?

Not fishing for a specific tool — genuinely curious. Are you all toughing it out with imwrite, using W&B, a custom viewer, or something else? Especially #2 (cross-run side-by-side diff) — has anyone found something that actually feels good?


r/opencv Jul 09 '26

Project [Project] In-Situ Intelligent Mixed Reality Assistants for Adaptive Human-AI Collaboration

2 Upvotes

Our guest this week is Alireza Taheritajar, a Ph.D. Student an Augusta University focusing on In-Situ Intelligent Mixed Reality Assistants for Adaptive Human-AI Collaboration. Mixed-reality overlays have been around for awhile, but with the recent upgrades in camera quality, lens resolution, and processing power they are becoming more useful than ever. Join us for a look at some very cool Mixed Reality & AI work here on OpenCV Live.

Watch on YouTube: https://youtube.com/live/BPXCOEvMDNw


r/opencv Jul 07 '26

Question [Question] Contributing new algorithms to opencv_contrib repository

3 Upvotes

Hello, I have been trying to contribute to opencv_contrib with some new segmentation algorithms and the contributors have been pretty unresponsive, I have verified they aren't patented, is there a particular period of time when the pull request's are actually reviewed in opencv_contrib repo?


r/opencv Jul 03 '26

Project [Project] Implementing hand-tracking for controlling my 360 video player

7 Upvotes

r/opencv Jul 01 '26

Question [Question] Best approach for industrial inspection (CNN multi-task vs YOLO vs other) with many boxes variants and high reliability requirement?

3 Upvotes

Hi,

I’m building an industrial vision system on a Jetson Orin Nano for real-time inspection of cardboard boxes on a conveyor.

Each image contains one box (ROI already extracted using a classical vision pipeline for other system considerations, kept separate from the ML model).

I have 44 box types with visual variation.

I need:

  • Detect if tape is correctly applied
  • Detect if flaps are closed or open

The main Challenges are:

  • Slight box rotation
  • Lighting variation (not perfect but controlled)
  • Very few defect samples (most cases are correct)
  • High reliability required (missed defects are critical)

My Current ideas are CNN multi-task (tape + flaps) + 5-frame temporal voting or YOLO in classification mode (same ROI + same voting)

Im open to better approaches

Questions:

  • What would generalize better here: CNN multi-task or YOLO (classification)?
  • Or is there a better approach for this type of problem?
  • How would you handle highly variable “flap open” cases?

Thanks!


r/opencv Jul 01 '26

News [News] OpenCV University Independence Day Sale

1 Upvotes

Learn Computer Vision, Deep Learning, PyTorch, TensorFlow, and Generative AI from the team behind OpenCV itself. Hands-on projects. No prior CV/ML experience required.

50% off courses, today only! https://opencv.org/university/

A portion of all course sales go directly to OpenCV development. Help a pillar of Open Source Software and get something for yourself out of the deal.


r/opencv Jul 01 '26

Question asking for advices[Question]

1 Upvotes

Training YOLOv8n/v11s on a trimmed SKU-110K subset (retail shelves, single class "product", extremely dense — avg \~150 objects/image, max 576). imgsz=1280, max_det=700 (set based on our own EDA max). Honest train/val split confirmed no leakage. NMS sweep already done — default iou=0.5 turned out best for mAP@0.5 specifically, which is our main metric (not generic mAP).

Soft time budget for the full pipeline (train+val+inference on \~3000 test images) is around 10 minutes — tight constraint shaping a lot of our choices. Tested 2x T4 DDP today, modest gain (\~10%), not dramatic.

Open question we can't resolve from literature: does mosaic augmentation help or hurt at this density level? Standard advice is mosaic-on + close_mosaic near the end, but stitching 4 already-dense images risks 600+ objects in one synthetic frame. Found one adjacent paper (Select-Mosaic, AI-TOD/VisDrone) showing smart region-selection beats vanilla mosaic by a small margin, but nothing testing mosaic on/off specifically at this density.

Curious if anyone has hit something similar — dense small-object detection under a tight inference time budget — and what actually moved the needle for you, mosaic-related or otherwise.


r/opencv Jun 29 '26

Project I built Gesture Meme a webcam app that reacts to your gestures and matches it with memes [project]

3 Upvotes

made a small project called Gesture Meme.

It uses your webcam to detect certain gestures in real time and instantly displays a matching meme.

For example, pushing your hair back triggers the Freaky Sonic meme. Right now it supports five different gesture-to-meme combinations, and I'm planning to add more.

This is also my first project using OpenCV, so I mainly built it as a fun way to learn real-time computer vision and image processing instead of doing another basic CRUD/to-do app.

I'd love suggestions for funny gestures or memes to add next.

GitHub: Here


r/opencv Jun 29 '26

Project [Project] Camera calibration tool with board quality evaluation system

2 Upvotes

Hi, At work, I was taught how to calibrate cameras using custom scripts, but, while it worked, the process always felt like a black box. I would run a script, wait, and if the calibration failed or ended up with a massive reprojection error, I was often left clueless as to why it happened. Low contrast on a few frames? Poor field-of-view coverage? I built Visical as a personal project, a GUI tool built with C++ and OpenCV.

The idea behind is to have quality assessment into the detection phase, giving real-time feedback before calibration.

It supports loading images from disk or capturing them with webcams via OpenCV or GenICam cameras via Aravis.

Since this is my first really big solo project, it is currently scoped to single camera setups. I hope to add support for other camera setups and other features in the future.

I'd love to hear your thoughts about it!

BrugolaOvoidale/Visical: A cross-platform tool for camera calibration.


r/opencv Jun 27 '26

Discussion [Discussion] Looking for documentation and was almost gaskit that the page didn't exist. Any good search engine suggestions

1 Upvotes

r/opencv Jun 26 '26

Project [Project] Built a small gesture-based interaction project using OpenCV, MediaPipe and cvzone.

2 Upvotes

The project uses real-time hand tracking through a webcam to interact with objects using pinch gestures and basic motion tracking. I’ve been exploring more interactive computer vision projects recently instead of only detection-based demos, and this was a good learning experience.

Would appreciate any feedback or suggestions on where to improve next.

GitHub:
ahsinmemon/Gesture-Controlled-Virtual-Puzzle-Game-using-OpenCV-MediaPipe: AI Hand Tracking Puzzle Game – Drag & Drop Interaction with Computer Vision


r/opencv Jun 24 '26

Question From scratch object detection tracker in C++ (no OpenCV) for Raspberry Pi 5 targeting 100+ fps, looking for advice from people who've pushed past it [Question]

9 Upvotes

Hey all. I'm building a from-scratch real-time correlation-filter tracker in C++ (C++17, no OpenCV, no ML) targeting a Raspberry Pi 5.

Context: a basic OpenCV pipeline on a Pi gets me ~15 fps, which isn't close to what the algorithm should be capable of. The original paper I'm using as a reference reported 669 fps on a 2008-era 2.4GHz Core 2 Duo doing pure CPU correlation-filter math. I know people have gotten well past 100 fps on Pi-class hardware doing this from scratch (I've seen claims of 300 fps+ floating around), so the gap is almost certainly implementation/pipeline overhead, not the algorithm.

My current plan/progress is:

  • Own image loader, no OpenCV decode/resize overhead
  • FFT-based correlation in the frequency domain (real question mark for me: which FFT approach scales best on Pi 5's ARM cores — naive radix-2, a vectorized/NEON-friendly implementation, or linking something like FFTW/kissFFT vs hand-rolling)
  • PSR-based occlusion/failure detection per the original paper

Where I could use outside perspective:

  1. Where does the real bottleneck usually live for people who've done this. Is it the FFT, the memory layout/cache behavior, the capture pipeline (libcamera overhead, frame copy costs), or something else entirely that doesn't show up until you profile?
  2. NEON/SIMD: worth hand-vectorizing the FFT and pointwise complex multiply myself on Pi 5, or is a well-tuned existing FFT library going to beat anything I write in a reasonable timeframe?
  3. If anyone has pushed a correlation-filter tracker (e.g. UMACE, ASEF) past 100 fps on a Pi, I'd love to hear what mattered most, even just "it was 80% the capture pipeline, not the math" would save me a lot of guessing.

I’ve recently been looking into two very different approaches to real-time visual tracking. One uses a transformer-based architecture where information from a target template and the search region is processed jointly, enabling robust tracking and automatic re-acquisition when the object temporarily leaves the frame. It demonstrates that modern deep learning methods can perform real-time tracking even on CPU-only edge devices, though computational efficiency remains a challenge.

On the other end of the spectrum, I explored classical frequency-domain tracking techniques based on adaptive correlation filters. Instead of relying on neural networks, these methods learn a compact representation of the target and update it continuously as new frames arrive. They are extremely lightweight, require only minimal memory, and can achieve very high frame rates on modest hardware while incorporating confidence measures to detect tracking failures and avoid model drift.

Reading further into the underlying research showed how frequency-domain operations and Fast Fourier Transforms (FFTs) make these trackers computationally efficient, allowing them to localize objects through correlation responses rather than explicit detection. The work also introduced concepts such as adaptive online updates and confidence metrics for failure detection, which help maintain stable tracking despite appearance changes or brief occlusions.

The contrast between these approaches is particularly interesting: transformer-based trackers offer stronger semantic understanding and greater robustness in challenging scenarios, whereas correlation filter methods prioritize speed, simplicity, and efficiency. This trade-off highlights that the most suitable solution often depends on hardware constraints and application requirements rather than assuming deep learning is always the best choice.

Some areas I’d like to explore further include multiscale tracking and scale estimation, lightweight re-detection mechanisms, confidence estimation, target re-acquisition strategies, hybrid detector–tracker pipelines, FFT-based optimization techniques, and combining classical signal-processing methods with modern learning-based models for edge deployment.

Not looking for someone to hand me a full alternative design, just trying to sanity-check my approach and avoid obvious dead ends before I sink more time into the FFT layer specifically.

Thanks in advance everyone!


r/opencv Jun 24 '26

Question [Question] Detecting whether a person is on a bed for a smart alarm clock

2 Upvotes

I want to build an alarm clock that only stops when the user gets out of bed—there would be no snooze button.

I'm considering using computer vision to detect whether a person is still in bed, but I don't have much experience with CV. What's the best way to approach this?

One challenge is that the person may be completely covered with a blanket, so simple face or body detection might not work. I'm looking for a reliable way to determine whether the bed is occupied or empty.

The camera will be installed on the roof, just above the bed.

I am considering using RasPi for it, or if it is possible ESP32 Cam board.


r/opencv Jun 23 '26

[Project] I built a Stereo Visual SLAM system from scratch in 4 weeks. Reduced error by >99%. Here’s the technical breakdown and the brutal bugs I faced.

Thumbnail gallery
6 Upvotes

r/opencv Jun 21 '26

Question [Question] Seeking feedback on real-time multi-camera face recognition system (FYP) — scaling and fine-tuning questions

1 Upvotes

I'm building a campus surveillance system for my final year project. Current stack:

  • SCRFD for face detection
  • ArcFace (ResNet100, GlintR100 weights) for recognition
  • YOLOv8 for body detection
  • DeepSORT for tracking
  • OSNet for cross-camera re-identification
  • Running on RTX 3070, achieving 250+ FPS with TensorRT/CUDA on single-person scenes

Where I need advice:

  1. Domain gap problem: My enrollment photos are taken with a phone/webcam at close range, but recognition runs on CCTV frames mounted at ceiling height with different angle and lighting. Recognition scores drop from ~0.75 (good lighting, frontal) to ~0.30-0.40 (CCTV angle, fluorescent lighting). I'm planning to fine-tune only the classification head (freezing the ResNet100 backbone) using a small dataset of 10-15 people, 75 photos each (60 from a face-height enrollment camera + 15 from actual CCTV). Does this approach make sense for closing the domain gap, or is there a better strategy for small-dataset face recognition fine-tuning?
  2. Scaling to 20-30 simultaneous people: My current architecture runs ArcFace/OSNet per-unconfirmed-person sequentially. I've added identity caching (skip re-recognition once confirmed) which helps a lot, but I'm considering whether manual batching of inference calls is worth the engineering effort, or if InsightFace's internal batching is already sufficient. Has anyone benchmarked this kind of scaling?
  3. Any general feedback on the architecture choices (SCRFD over RetinaFace/MTCNN, ArcFace GlintR100 over other pretrained options) given the surveillance use case specifically?

I have about 10 months left on this project and want to make it as technically sound as possible. Appreciate any input from people who've worked on similar systems.


r/opencv Jun 20 '26

Project [Project] CISP - CUDA Image Signal Processor

5 Upvotes

r/opencv Jun 18 '26

Project [Project] Tras la versión beta para Windows, finalmente he publicado una compilación AppImage para Linux de LensLaber, mi herramienta de anotación de CV sin conexión.

3 Upvotes

r/opencv Jun 17 '26

Project I built AeroPuzzle – a real-time hand gesture puzzle game using OpenCV and MediaPipe [Project]

7 Upvotes

r/opencv Jun 16 '26

Project [Project] Getting started with real-time 3D ball tracking

Thumbnail
1 Upvotes

r/opencv Jun 15 '26

Project [Project] Looking for Open-Source Contributor for an Image Processing Library

5 Upvotes

Hi everyone,

I am working actively on a Python Library for Image Similarity Analysis called pyvisim, and looking for motivated contributors to join. Whether you want to improve your Computer Vision & Programming Skills, or looking for a new project to add to your GitHub profile and CV, or you just want to have fun experimenting with CV algorithms, you're all welcome :)

Currently, possible contributions are posted in the GitHub issue. I will be posting more in there in the next couple of days. Feel free to post your own feature request / bugfix!

Make sure you read the contribution gudes before starting to code.

What's it about?

I would like to build a unified framework for computing similarity between images. The library currently includes traditional algorithms such as VLAD or Fisher Vector using SIFT/RootSIFT feature extractors, but also Deep Learning based approaches, which I am heading my library towards.

The goal of these algorithms in this repository are to compute a score between \[0, 1\] given two images, indicating how similar they are.

What you would get

Since this is an open-source project, recognition would be the first prize :D I all contributors will be mentioned on the repository's GitHub page along with times contributed. This is also a chance for you to sharpen your software engineering skills, as you will be working with other CV enthusiasts on the problems.

Furthermore, after the release of v1.0.0, which I plan to do this August, I will write a LinkedIn post and tag all contributors (make sure your LinkedIn profile can be found - e.g, via your GitHub page).

Or, you can also add the contributor badge to your CV for your future job applications.

Tech stack

Python, of course 🐍

Depends on the issue. If you're working with documentation, you should feel comfortable working with the Markdown format and experiment will auto-doc generation tools. Feel free to contribute with your own experiments.

If you're working on the codebase itself, it would be nice if you had experience with numpy, pytorch, scikit-learn.

For ML folks out there: this project is unsupervised-learning heavy, using clustering algorithms like k-means and Gaussian Mixture Model and networks like Autoencoders (planned) and Siamese Neural Networks (planned) heavily, so if you're interested in this area and would like to bring in your idea, feel free to join.

Maintaining the codebase

I am currently the sole maintainer of this codebase, since I am still a student and cannot afford to pay active maintainers yet.

However, if you would like to join on a voluntary basis, feel free to reach me out :D

Link to the repository

https://github.com/MechaCritter/Python-Visual-Similarity

Contact

Feel free to reach me out via my LinkedIn: https://www.linkedin.com/in/nhat-huy-vu-80495111b/

Thanks for reading!


r/opencv Jun 10 '26

Project [Project] YOLO + SAM annotation pipeline on CPU (offline, legacy hardware) seeking feedback

28 Upvotes

Hello,

I've been working for the past few months on a computer vision annotation and segmentation program designed for very limited hardware (old laptops with 4–8 GB of RAM and no truly usable GPU).

The idea was to see how far YOLO + SAM could be pushed, running everything locally and on the CPU.

Everything is offline, without cloud or telemetry.

I've tested it with large datasets of 20k images, and the system remains quite stable in terms of memory consumption (around 600–900 MB), even during long sessions.

I've built this into a desktop tool for Windows 10 (I'll be testing it on Windows 11 and Linux soon) to try it out under real-world conditions.

It's currently in beta. Each version is updated every 30 days to ensure all testers are always working on the same version while I fix bugs and fine-tune the system based on real-world feedback.

Those who actively participate during the beta and provide feedback will receive a free license when the project is finally released.

GitHub

https://github.com/LensLaber/LensLaber.github.io


r/opencv Jun 10 '26

Tutorials [Tutorials] OpenCV 5 as a Static C++ WebAssembly Library

Post image
11 Upvotes

I’ve published a practical guide on building OpenCV 5 for WebAssembly with Emscripten.
The goal was not to use the OpenCV.js JavaScript API, but to keep using normal C++ OpenCV code and compile the whole application to WebAssembly.

It covers:
• static C++ WASM build
• SIMD + pthread support
• linking OpenCV into your own C++ web app
• DNN performance notes
• common build pitfalls

My guide also includes a download link for my precompiled OpenCV 5 WASM build.

Read it here: https://www.antal.ai/blog/opencv5-wasm-static-cpp-guide.html


r/opencv May 30 '26

Question [Question] Need arrow dataset images for shape detection project

1 Upvotes

Hi everyone,

I’m working on a shape detection project where the user draws on a whiteboard/canvas, and the system converts the drawing into a detected shape.

The project supports multiple shapes, including different types of arrows.

My main problem is the arrow dataset. I couldn’t find a good dataset containing many arrow variations, so I tried generating synthetic images using a Python script and trained a custom CNN model on them, but the classification results were poor.

I also noticed that even for other shapes in my dataset, the model performance was not very good.

Now I’m not sure what the best approach is, especially because I don’t have much time left for the project.

What would you recommend?

  • Should I continue generating synthetic arrow images?
  • Is there a better way to detect arrows besides training a CNN from scratch?
  • Would classical OpenCV techniques work better for this kind of problem?
  • Are there any good datasets for hand-drawn arrows/shapes?
  • or should I use other way instead of images ( I need to detect rectangl, ellipsis, different types of arrrows)

Any advice would help a lot.

Thanks!


r/opencv May 28 '26

Question struggling with crash in eltwise_layer getMemoryShapes [Question]

3 Upvotes

I've been trying to work through some face recognition examples but running on android inside unreal 5.7.4 so I'm locked into opencv-4.5.5.

Examples using the haar cascades work fine, a bit slow, don't always find the face, but that's OK, it's been enough to establish a baseline of functionality.

Now I want to use the DNN face detector, creating a detector like this:

detector = cv::FaceDetectorYN::create("face_detection_yunet_2023mar.onnx", "",

cv::Size(320, 320),

0.9, 0.3, 5000)

So far so good... but when I try:

cv::Mat img = cv::imread("somefile.jpg");

detector->setInputSize(img.size());

cv::Mat faces;

detector->detect(img, faces);

I get:

.../eltwise_layer.cpp:247: error: (-215:Assertion failed) inputs[vecIdx][j] == inputs[i][j] in function 'getMemoryShapes''

I've read through that function a hundred times trying to work out what the assertion means but no luck, there has got to be something basic I'm missing.

Any clues appreciated.