W
W
winser2015-08-04 07:20:16
Programming
winser, 2015-08-04 07:20:16

Dll (Library) to find a part of the image on the screen?

Tell me, can anyone know a library that could search on a large picture, a small one. That is, let's say in the big picture there is a button, in the small picture there is a screenshot of this button. At the input, two images are set, a large one in which to search and a small one that we are looking for, at the output, the coordinates of the location of the small image are given. It is also necessary that it be possible to set the search error, so that if the small picture does not slightly match what is in the big picture, everything also works.
I found one library but everything is too complicated there.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2015-08-04
@fshp

OpenCV

V
Vitaly Pukhov, 2015-08-05
@Neuroware

depending on how exactly it is needed, in the simplest (but not the fastest) case, it will be enough to do this:
write a function that works like this:

Check(original, fragment, point) where point is the place on the source image in which we check for the presence of a fragment.
the presence of a fragment is defined as the difference modulo colors at each point (r1-r2,g1-g2,b1-b2)

Next, we divide the original image into "cells" and run through each of them and check if there is a fragment there, in those places where the fragment is the difference will be less than in those places where it is not.
The accuracy of the "search" will depend on the grid size, the size must be taken not less than a quarter of the fragment size, otherwise the fragment may not be found. You can also set "a little does not match" and at the same time "speed up" the algorithm by proportionally reducing the size of both images, the coordinate, respectively, will also "increase" in the same proportion.
You did not specify a specific language, therefore, only a description of the algorithm, for some languages, the above can be found in the form of a ready-made library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question