You seem to be missing a word. What are you expecting to do with a pattern to have the Arduino act on it?
In general the Arduino UNO is not very capable when it comes to images. The memory is quite limited. If you are dealing with all but the smallest of pictures the Arduino won't be able to store more than a portion of the picture in SRAM. I expect that all of your example patterns will have to be on an SD card. Searching through thousands of files on an SD card will likely be very slow.
The arduino isn't much good as complex math. That means that unless the pattern you are searching for almost exactly matches the example pattern it will be hard for the Arduino to match it.
Your project sounds more like something for which you would use a PC or at least a Raspberry Pi.
A low end Arduino is not a good platform for image processing. I assume the ARM based Arduino's have the processing power to do it, but unless someone has created libraries you have a lot of work to do it from scratch.
Those are awfully simple images to require 3000 to 5000 exemplars. It looks like what you might use with a fancy line following robot. Do the patterns have a meaning that you are trying to extract? Do the colored triangles indicate which way to turn at the T intersection? Those kinds of actions are MUCH easier to do on an Arduino. You would use some sensors for the position of the black line (and in your case, line width) and some color sensors to detect which side of the line which colors are found.
Indeed the application is for a robot to follow a route.
But than very simple..
Let me explain:
On the ceiling there is an image with a straight line.
On meter below that image there is an transparent plate with a dotted pattern.
If the robot is exact below the image, it will see only a straight line
If the robot is a little off track, it will see a straight line with a dotted line next to it.
In the second case the robot can make a corrective action..
1.) Bitmap comparison, based on Hue / Hue value ...| than it needs to have lots of bitmaps in memory
2.) Via an intelligent algoritme that can interpret outline of a the pattern or so..