I'm currently in C # trying to find a way to search for a specific template in a large image, this is actually a screenshot. A 100% match is required, so the problem is pretty simple.
Test material: http://www.myhideout.eu/temp/pattern.png (NB: transparent pixels are irrelevant and should not be tested). http://www.myhideout.eu/temp/test.png
If the template is found, I will need some kind of coordinate, so I know where, but this is the easy part.
The only approach I came with so far is obvious. Take the first pixel of the pattern and iterate through the test image until a match is found, then check the rest of the pattern until the test is completed or there is no more pattern. If the test fails, go to the next pixel corresponding to the first pixel of the template and try again. If you skip the test image without matching, then obviously there is no such template, and this should be the result of the test.
I suppose this works, but in reality things are a little more complicated. I have not come to you with the proper structuring of the code, and in the test cases I made there were some rather strange errors, which is not a big surprise, given the complexity.
However, my biggest problem is time. This is only a small part of the lengthy process, and the goal is to bring the total execution time to a few seconds. Imagine an image of 1920 * 1200, which is the limit where the pattern is at the end, and before that there are several partial matches.
Of course, I was looking for a network, various forums, etc., but the only material that I came up with is very advanced and will be of little use, even if I could understand it for a variety of purposes.
I also consider the possibility of converting the template and test image into some kind of bitset, and then just AND, SHIFT and / or MASK my way through it, but this is beyond the scope of my current capabilities.
I think I have described my problems in some detail. I apologize for the backlog of code examples, but what I had was of little use to anyone, and also embarrassing.
I would really appreciate any help.