Wiki

Clone wiki

examinator / Home

  1. Welcome

Examinator is an Automated Optical Inspection program for loaded PCBs, used mainly for component presence/polarity check.
The program works by taking a single image of the board using a high resolution camera (for example a phone camera, using the phone as IP camera).

The program uses dlib and a bit opencv as its core, and is written in Qt/C++.

The program works using fhog or dnn classifiers for the entire board, the fiducials and the components to be verified.
First, the board is located running the board classifier. Then, the fiducials are searched to locate the board more precisely. Finally, the classifiers for the components are run at the locations determined by the board position.
Currently, the user interface is in Romanian or English.

The program has been developed under Ubuntu.
Under Windows/mingw32 v5.3 dlib is NOT working when vectorisation is turned on.
But under Windows/mingw64 v7.3 dlib is working, and the Examinator program can be built in this environment. It’s just a bit more complicated to get, or even better, build, all the dependencies on Windows: dlib, opencv, openblas/MKL, zbar, libdmtx, zxing-cpp. Openblas or MKL is used for dnn training or inference, as a poor man’s alternative to cuda when no nvidia GPU is available. Currently cuda support is working only under linux. For Windows, there is an experimental CMAKE build file which partially works with CUDA and Visual Studio.

Installalling dependencies on debian derivatives (linux):
Install qt5-default if available
Install qtcreator git meld cmake-qt-gui libopencv-dev libsqlite-dev libopenblas-dev qtmultimedia5-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly doxygen-gui gstreamer1.0-qt5 libgstreamer1.0-dev gstreamer1.0-opencv libgstreamer-plugins-bad1.0-dev qt5-image-formats-plugins libqt5multimedia5-plugins libqt5charts5-dev libqt5serialport5-dev qttools5-dev gcc g++
Install also libzbar-dev libdmtx-dev and/or libzxingcore-dev if you want to read barcodes representing serial numbers from the images.
To use the raspberry pi camera on Raspberry PI OS, also install gstreamer1.0-omx-generic gstreamer1.0-omx gstreamer1.0-omx-rpi-config

If you have a NVIDIA GPU compatible with dlib (any GPU beginning with the second generation Maxwell cards and at least 4GB of memory should work, if you find a suitable CUDA and driver for it, it is advisable to install cuda and cudnn to speed up dnn training and inference.
On ubuntu 22.04, this can be done by installing nvidia-cuda-dev nvidia-cudnn nvidia-cuda-toolkit-gcc and one of the drivers providing nvidia-driver-binary and also nvidia-driver with it’s dependencies.

Clone dlib
cd dlib
mkdir build
cd build
cmake-gui ..
-> configure/generate
make
make install (as root / using sudo)

For dlib, usually you will want to build it optimized for your machine, using for example —march=native, and the best SIMD instruction set available for it (SSE2/SSE3/SSE4/AVX/NEON) available for it. Check the dlib documentation for further informations.

Installing dependencies on windows:
Install doxygen to build the documentation (it’s only in Romanian).
Clone and build dlib, opencv, zbar and libdmtx. I used c:\source as download/build directory, so the paths in the project file are pointing to this folder. Adjust the paths according to the used folders.
For dlib and opencv use cmake, and the compiler which will be used to build examniator.
If you want to use barcodes, build also libdmtx and zbar and/or libzxing. Imagemagick is not needed, only the plain libraries. I used msys2 to build these libraries. I used
https://salsa.debian.org/debian/zxing-cpp
for zxing, but the result were not great. It might also work with
https://github.com/nu-book/zxing-cpp
but I have not tested this.
If the libraries are built with mingw (for example using msys2), but the program is to be compiled using MSVC, you need to build also lib files, not only the dll files which are enough to build the program using mingw.

Afterwards open the project in QTCreator and build it. You might need to run lrelease the first time you build the project in order to create examinator.qm.
Or run qmake and make in the folder with the project file to build the program.

Updated