Name: multiple-object-detection
Description: Multiple object detection with scale based on OpenCV Python library
GitHub: https://github.com/korniichuk/multiple-object-detection
Multiple detection of Twitter logo in example source image:
Multiple detection of Instagram logo in example source image:
Template matching is a technique for finding areas of an image that match (are similar) to a template image (patch).
We need two primary components:
- source image -- image in which we expect to find a match to the template image;
- template -- patch image which will be compared to the template image.
Goal is to detect the highest matching area. To identify the matching area, we have to compare the template image against the source image by sliding it.
By sliding, we mean moving the patch one pixel at a time (left to right, up to down). At each location, a metric is calculated so it represents how 'good' or 'bad' the match at that location is (or how similar the patch is to that particular area of the source image).
For each location of template over source image, we store the metric in the result matrix. Each location (x, y) in result matrix contains the match metric.
multiple-object-detection
checked on Ubuntu Desktop 18.04 LTS.
Please, install python3-pil.imagetk
and python3-tk
packages:
$ sudo apt-get update
$ sudo apt-get install python3-pil.imagetk python3-tk
Install Python packages:
$ sudo pip install -r requirements.txt
or
$ pipenv install
- imutils ver. 0.5.2
- numpy ver. 1.16.3
- opencv-python ver. 4.1.0.25
- tkinter ver. 8.6