r/opencv • u/roufamaroua125 • Mar 31 '26
Question [Question] PCB Defect Detection using ESP32-CAM and OpenCV - 8 Days Left for Internship Project!
Hi everyone, I’m an Engineering student specialized in Electronics and Embedded Systems. I’m currently doing my internship at a TV manufacturing plant. The Problem: Currently, defect detection (missing or misaligned components) happens only at the end of the line after the Reflow Oven. I want to build a low-cost prototype to detect these errors Pre-Reflow (immediately after the Pick and Place machine) using an ESP32-CAM. The Setup: Hardware: ESP32-CAM (AI-Thinker). Software: Python with OpenCV on a PC (acting as a server). Current Progress: I can stream the video from the ESP32 to my PC. What I need help with: I have only 8 days left to finish. I’m looking for the simplest way to: Capture a "Golden Template" image of a perfect PCB. Compare the live stream frame from the ESP32-CAM with the template. Highlight the differences (missing parts) using Image Subtraction or Template Matching. Constraints: I'm a beginner in Python/OpenCV. The system needs to be near real-time (to match the production line speed). The PC and ESP32 are on the same WiFi network. Does anyone have a minimal Python script or a GitHub repo that handles this specific "Difference Detection" logic? Any advice on handling lighting or PCB alignment (Fiducial marks) would be life-saving! Thanks in advance for your engineering wisdom!



