How to identify letters with ARDUINO

Hey guys, I'm searching for some king of sensor that's able to identify the letters"S", "H" and "U".
I have 30 days to make it so please help me suggesting sensors and the code I have to use for it

Please, Thank you :slight_smile:

"S", "H" and "U" are strings, not letters.
Any Arduino can recognise 'S', 'H' and 'U' - no sensor required.

I think you need to be a little more precise. Start by defining where and how the letters are presented.

In handwriting on paper? Ten foot high projected on a wall? On a smartphone screen? As characters in a serial feed? Over bluetooth by an app?

BTW what does this have to do with Robotics?

Steve

Assuming this is an OCR type of application (but you didn't say) you should start by investigating the algorithms that are used. How do YOU tell the difference between S, H and U? Draw them on grids and draw lines a across and down and try to define the topology of those 3 letters. You lecturer (for this is surely a class assignment?) will have chosen those 3 letters for a reason....

I need to build a robot that, among other functions, needs to identify a letter about 5-10 cm from a supposed sensor capable of doing that, and that letter varies between "S", "H" and "U".

The font of these letters is arial.

Sorry for the lack of information

Ok well you've got me interested, not that I have any ideas right now.

So it reads those letters and presumably decides what to do, like stop or reverse or blink leds or something.

I don't think pattern recognition is a trivial task at all, not that I know anything about it.

But I would start by looking at the topology of those letters to see what it is that makes an "S" an "S", a "U" a "U" and an "H" an "H". There's a subtle distinction between the U and H for example, with an H being a U with legs.

What's your experience with this sort of thing?

A camera and image processing is probably the only option, but AVR based Arduinos can't do image processing.

So it's Arial. How big? What colour letter and background? Always placed vertically in front of the robot or do you have to find it and position the sensor first?

Interesting challenge for an Arduino. I think there's probably a lot of important information in the project specification that you haven't told us yet.

Steve

Why not post the exact assignment your instructor gave you?

That way we aren't guessing what it is you are supposed to do.

I have no experience in image recognition, and after identifying these letters, the robot will drop 2 rescue kits, if for U, 1 if for H, and none if for S.

I thought of using 3 light binary sensors, but he would have to center the letter right in the middle ...
For example
take 2 points in common from S and H, in the case, one in the middle and one in the end.
two points in common of H and U, in this case the two ends.
and two in common of S and U, in the case an end and a low point

I swear, I'm telling you everything I know.
the size of the letter is something about 10 cmx 10 cm or less
the letter is black and the background is white, always vertically

Pixy?

I swear, I'm telling you everything I know.

Why bother, in that case? The project is hopeless.

pixy is a good, but does not sell in Brazil and I have little time, does anyone know another solution? cheaper?

btw, I just want to do some personal stuffs, and I'm asking if anyone knows how to do those things

If it’s just “personal stuffs” how come it has a 30 day deadline?

What you really need is some way to find the vertical centre line of the letter then scan down it. If you find 3 black lines it’s “S”, one in middle, it’s “H” and one at the bottom, it’s “U”. Maybe some of the line following robot techniques might be a start? Though doing it from 10cm away might be asking a lot.

Steve

slipstick:
What you really need is some way to find the vertical centre line of the letter then scan down it. If you find 3 black lines it’s “S”, one in middle, it’s “H” and one at the bottom, it’s “U”.

That’s pretty much what I was thinking some posts ago in #3 and #5 when I said to draw some horizontal and vertical lines- need to figure what makes an “S” an “S” and not an “H”, etc.

You could have some kind of binary sensor as you suggested, and have it on a pan/tilt servo, and look for some number of elements like 5 or 10 say (that you identify) that identify one letter from the other. If it finds 4/5 or 8/10 “S-like” elements it’s an “S”, then. But if it finds <4 or <8, it’s not sure. Something along those lines might be feasible?

You could weight the elements it has to look for: a “U” has no horizontal in the middle, while both the “S” and “H” do. So a lack of middle horizontal is diagnostic of a “U”, so it counts more towards the decision, while of course you need to look for other things too in case the sensor missed the - in the middle of an “S” or “H”.

But… if this is your own project, why don’t you pick other symbols that are easier to identify? They don’t have to be letters as far as the robot is concerned. Or pick letters which are easier to discriminate among: the “U” and “H” problem could be thrown away. I think with 26 letters to choose from, you could find 3 that are easier?

So with a little hand waving to center the letter and assuming an image of the letter with 1 bit per pixel. Simply moving down the image center vertically, counting the number of white to black and black to white transitions and the row of the lowest black to white transition is easier and more reliable.

But for fans of symmetry read on. H is symmetric (flip 180 degrees) in the x and y axes, U is symmetric in the y axis but not x axis, and S is not symmetric in x and y axes.

For x sym test, XOR the top half of the image with the bottom half. Think of this as folding the image in half along the x axis. XOR the pixels that overlay each other. If the result has mostly zeroes, the image is sym about the x axis. Repeat for y sym test but XOR left and right halves. Based on the x sym and y sym tests, guess the letter.

This might fail because of noisy images, poor lighting, choosing fonts where the letters are not symmetric about x and y axes, etc.

ty guys,

I think I'll use the idea of ​​checking the 3 vertical points in each letter. it's a nice one

I'll come by if it's all right, to tell you it worked out.