K
K
Kirill Petrov2018-12-14 13:16:49
Python
Kirill Petrov, 2018-12-14 13:16:49

How to detect a series of dots at any angle in an image?

Greetings, there is an original image with some kind of hole with holes, on which I want to find the top and bottom holes (marked in orange). It is known that there can be 20 or 30 holes in a row.
5c1382ef0bb03444324984.png
Now I find the contours, filter by size, and then for each Y coordinate in a loop, I determine how many contours intersect with an imaginary vertical line. If there are more than 20, then the object is found. But this method does not work if the image is tilted...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Dugin, 2018-12-15
@adugin

The Viola-Jones algorithm would fit here (also see Haar cascades).
You can also manually make something like a matched filter and use filter2D.
You can also look in the direction of template matching.
I do not offer a neural network.

A
Artyom Melnik, 2018-12-20
@MelnikRTM

I'll try to suggest:
A sequence of: identification of all objects, filtering the desired shapes, clustering by distance (and maybe additional conditions), approximation of a straight line from a cluster, a measure of dispersion for control.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question