@Dzandaa
Typically, a search for "equality" of individual points in a base region is not what is required.
Search techniques are varied and depend on what is being searched for and where it is being found.
There are a multitude of algorithms (some very advanced and customized ones can even be created using basic computer vision functions), but the most commonly used are:
(we're talking about 2D technologies)
- Pattern matching;
- Classifiers (not DL) such as:
a) MLP (Multi-Layer Perceptrons);
b) SVM (Support-Vector Machines);
c) GMM (Gaussian Mixture Models);
d) KNN (K-Nearest Neighbors);
- Deep learning and CNNs (Convolutional Neural Networks);
- OCR (for character recognition) with or without CNNs;
What @Dzandaa is referring to is deep learning with CNNs, and it's the most challenging and expensive option.
It requires fairly powerful hardware to train the network (i.e., the database), unless you want to train the network in hours or days... or more.
Depending on your needs, try delving deeper into what I wrote above and check out what OpenCV offers.
I'll warn you right away that you'll need to spend many days studying and experimenting.
If you choose deep learning, I also recommend checking out the Python-based YOLO. It can help you generate the ONNX network (i.e., perform the training) and then you can use Lazarus and OpenCV for the runtime (i.e., the search).
Unless OpenCV has something ready-made.
I use paid (very expensive) computer vision libraries and don't use OpenCV.
Good luck for your work.