Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Advanced OpenCV 3 python hole detection

Advanced OpenCV 3 python hole detection

centersOpenCV is a well known computer vision library used as base framework used by major companies like Google, IBM, Sony and numerous others. It enables quick vision based tool development and results can be seen in a minutes after starting to code. This time I will show how to find round blobs (for example fiducial marks or holes on PCB). There are many ways to accomplish this task, but many of them don’t produce stable results. After many hours of research I stumbled on SimpleBlobDetector.

For this experiment I will be using standard Python 2.7 installation and OpenCV 3.1 library. OpenCV can be installed numerous ways, for Windows feel free to install from official OpenCV page (requires more steps to get started) or download from Unofficial Windows Binaries for Python Extension Packages and install with command like this:

pip install opencv_python-3.1.0-cp27-cp27m-win32.whl
out

Detection results

Script is provided below and hosted on Github. To start experimenting supply video file and adjust parameters if needed. Code is pretty simple and requires no more explanation (hopefully).

 

More Articles to Read

Single-Sided USB Charger
Single-Sided USB Charger
A FPGA controlled RGB LED MATRIX for Incredible Effects – the Hardware
A FPGA controlled RGB LED MATRIX for Incredible Effects – the Hardware
Using Nanotimers to Reduce IoT System Power Consumption by an Order of Magnitude
Using Nanotimers to Reduce IoT System Power Consumption by an Order of Magnitude
Replace a microwave’s beeping with the Windows XP startup sound
Replace a microwave’s beeping with the Windows XP startup sound
A DIY Laser Scanning Microscope
A DIY Laser Scanning Microscope
Reverse-engineering the surprisingly advanced ALU of the 8008 microprocessor
Reverse-engineering the surprisingly advanced ALU of the 8008 microprocessor
ESP8266 LED lighting: QuinLED v2.6 PCB
ESP8266 LED lighting: QuinLED v2.6 PCB
Switching LVDS Graphics in a Laptop Computer
Switching LVDS Graphics in a Laptop Computer
Teleknitting: TV-based string art
Teleknitting: TV-based string art
DIY Bubble Machine
DIY Bubble Machine
Start your day with Nerf target practice!
Start your day with Nerf target practice!
Teardown of a Peaktech 6225A
Teardown of a Peaktech 6225A

Top




Shares