Answer the question
In order to leave comments, you need to log in
How to recognize an object (C/C++)?
There is a catalog of pictures (a folder with pictures). The image sizes (height, width) are the same. Pictures appear on the screen.
You need to find a picture on the screen and write to the array the name of the file from the directory that this picture corresponds to.
The picture on the screen may differ in size from the picture in the catalog.
With what can this be done?
Answer the question
In order to leave comments, you need to log in
Well, when you specify what exactly is shown in the picture, then it will be possible to advise something sensible. In any case, 100% accuracy is not achieved.
And so - arm yourself with OpenCV and into battle.
If the picture is not cropped, then it is not very difficult to find a match. They did it, it even works.
Images are processed in the database: transfer to YCrCb, resizing to 8 by 8 without maintaining proportions, taking several hashes for each color component, hashes are taken bit by bit from the pixel, starting from the highest (if you do as it was in one of the articles on Habré , color was not taken into account there, there will be porridge). The hashes are stored in the database. Then the same thing is done for the desired one and the hashes are searched in the database with some hamming distance, here you already need to find it. But this will only help if the pictures are quite noticeably different.
If I understood the question correctly, then it is enough to bring all the photos to the same size (for example, 30x30) and when you want to find the most similar one, reduce this picture to the appropriate size and check the correlation with each image from the catalog.
Pearson (cross-correlation)
is described by one formula that may look scary, but does not create problems.
Let's say the correlation between two pictures is r.
if r = 1, it means that the pictures are identical. The closer the correlation is to one, the more similar the image data is to each other.
There are a million other solutions, but in my opinion this is the simplest and fastest.
@ivandzemianchyk , will be calculated according to the formula from here:
masters.donntu.edu.ua/2009/ggeo/striltsiv/library/... ?
is there a difference with the formula from this document:
www.nanoscopy.ru/upload/files/articles/Weekly_Arti...
after the words "Cross-correlation of two images" on the third page?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question