Need for Pattern Recognition Code/ algorithm for 2D image (flat pattern)

Hi,

I need my Arduino to store approx 3000-5000 patterns 2D image or vectors in it's memory.

Then when I a pattern, the arduino should make an action (to be defined later)

Currently I'm struggling with finding an algorithm that can store and recognize these patterns...

Can anyone help me out??

Kind regards,
Jeroen

Can you provide an example of what just one of your patterns looks like?

Paul

jeroenvandenhurk:
Then when I a pattern,

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.

Yes, please find attached some example patterns.

Schermafbeelding 2017-06-01 om 21.55.37.png

Schermafbeelding 2017-06-01 om 21.54.42.png

Schermafbeelding 2017-06-01 om 21.54.33.png

jeroenvandenhurk:
Yes, please find attached some example patterns.

Yes, I see what the picture looks like, but what do they look like to your program in the Arduino??????

You MUST be able to have the patterns in something a computer can read and store.

Paul

I need my Arduino to store approx 3000-5000 patterns 2D image or vectors in it's memory.

In just 2048 bytes of memory?

Currently I'm struggling with finding an algorithm that can store and recognize these patterns...

What does that tell you?

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.

I would look into the work that Open MV has been doing or use a Raspberry Pi.

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..

Can you help me with this?

See the attached image... it demonstrates the idea

This is all very simple and so far theoretical, but how are the patterns to be read, to be compared to the stored templates?

I imagine two different directions:

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..