Hello, everyone, I'm working on the task to create a character recognition application.
I use zhang Suen algorithm, does anyone know that algorithm??
if anyone know, please let me know the workings of the algorithm and how these algorithms transform into coding??
help me please...
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
help me again please.
I have made zhang Suen algorithm running and I can change the image to black and white.
I want to display the results of OCR text in a text box.
does anyone know how to display the text of the input image??
does anyone know how to display the text of the input image??
If you had searched this forum first, you might have come across this recent thread.
Originally Posted by eijdaites
here is my project :
Whenever possible, please attach your project in your post rather than forcing us to download it from another site.
Anyway, most of the JPG images that you have are too blurry. I doubt they can be successfully converted by any decent OCR software.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
I have uploaded my project in me*****re, therefore I've included the link.
I would like to make their own OCR software not to compare with existing software.
I just need to do the pattern recognition of letters and took it into the text box.
I have uploaded my project in me*****re, therefore I've included the link.
What I meant was, instead of telling us to download your project from an external site, you can save us some time if your project was directly attached to your post. See this post for an attachment example. You can attach your project by clicking the Go Advanced button and then click the Manage Attachments button.
Originally Posted by eijdaites
I would like to make their own OCR software not to compare with existing software.
I just need to do the pattern recognition of letters and took it into the text box.
Just so you know, Optical Character Recognition means pixels in an image are analyzed for patterns that resembles characters/letters/numbers/symbols/etc. You can probably imagine that such a task isn't easy at all to program. That's why there aren't any 100% fool-proof OCR software yet. The last thread I linked to was the best I could find, so if that wasn't good enough for you, well then, good luck with your search!
Last edited by Bonnie West; Jul 14th, 2013 at 07:16 AM.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
If your going to create your own good luck it won't be an easy task. I'm sure it took them years to make good OCR (thats probably 100's of programmers together). Bonnie was just trying to give you a quick way out of your problem. And also, we don't like to open other sites, that's why there is a way to attach in this forum, why use another site? It's a lot more simple to use one site (this one). Also even if you do create an OCR, how many different kind of fonts is out there, new ones everyday probably. Also people handwritting, captcha, it's a hard task to do. Good luck with your project! I guess you could try to make one for only one type of font, which would be lame
for the application, I want to make a very simple OCR application.
applications can only read one type of font and just read the characters A - Z, a - z, 0-9.
The reason is that my approach would involve "reading" the BMP file header
and parsing the BMP file. The problem with JPEGs is that they are compressed,
and I do not know how to recover the "lost" compressed data.
Further, I have no idea what the Zhang Suen algorithm is.
So, if you need to use JPEG and Zhang Suen, then, sorry, I doubt I can help.
But, if BMP only is ok and you are willing to try to develop a new algorithm, then possibly .. but it will be complex.
I have created a little demo, not for the recognition, but for dividing letters. (a start)
It will find the first letter of the first picturebox and add it to a second picturebox.
I did not do for the next letters, but if the text is simple and normal, you could offset from previous character positions (right position) and get next character positions.
Once you can get the characters one by one you could then do the recognition part. It will be a lot easier to compare 1 letter at a time.
Here is the little project I made so far, haven't had time to work too much on it. Hopefully it can give you an idea. I will tell you this again, an OCR has a lot more then letter recognition, it has to "try" and divide each letters and then match it with the correct letter (or one that looks like the most '%').
For the demo project, click Load Picture, then click Find/Copy First Letter and you will see the letter appear in Picture2.
I'm not sure yet how to compare, I was thinking to save the alphabet (one font only) and then match pixel per pixel to the image being scanned and the one with the highest percentage (the most similar pixels) would be the one my OCR would choose.
This is far from being a real OCR, I just hope it gives you (or others) an idea of how a very simple OCR works and hopefully they will share their ideas or make another project to share on this Forum!
I'm not sure yet how to compare, I was thinking to save the alphabet (one font only) and then match pixel per pixel to the image being scanned and the one with the highest percentage (the most similar pixels) would be the one my OCR would choose.
Yes, I had very similar thoughts regarding the issue (comparing) and possible
solution (pixel-by-pixel matching). Seems doable, but will no doubt be a challenge.
However, once a means can be devised to do the first alphabet letter, the rest
should fall into place pretty quickly.
I tested everyone of those OCR apps from the link Max posted. Most don't work or don't work very well. A couple are fairly nice and do a decent job but all you need is one to help you get started.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Yes, I had very similar thoughts regarding the issue (comparing) and possible
solution (pixel-by-pixel matching). Seems doable, but will no doubt be a challenge.
However, once a means can be devised to do the first alphabet letter, the rest
should fall into place pretty quickly.
Spoo
Yeah, I figured it would be hard to do. Since I do not have much time anymore working very long hours, and no access to pc I can't help much anymore or make big projects.
I think what we have in mind would work spoo, but that will only work on one kind of font! (well maybe more than 1 if they are similar)
I'll try to figure out how to compare the pixels one of these days, I've always wanted to make an OCR from scratch. I'm not 100% sure on how to implement the comparing yet!
We should all work together on this one, even if the end product is not excellent, it would give an idea to a lot of people using this forum.
I think it's a good project to work on, just like jmsrickland's sound wave project!
I tested everyone of those OCR apps from the link Max posted. Most don't work or don't work very well. A couple are fairly nice and do a decent job but all you need is one to help you get started.
You should post the one that you liked the most, so I don't have to download them all!
I have so much VB6 crap on my computer and can't get rid of it! Like a VB6 Hoarder.
Or just let me know which one to download.
I'm going to go back and test them again and I'll upload the ones that have decent output.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
please give comment on the project.
I made zhang Suen algorithm to make the process of thining but I do not understand how to call the function that I created.
here is my project :
Last edited by eijdaites; Jul 18th, 2013 at 01:17 PM.
Here's one of the apps I downloaded from Max's link.
I made a few changes to it but did not alter in any way the original scanning code
It works very nicely but from my testing I found that not all fonts are supported
Run the project and follow the directions
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
You loaded up "Fixedsys 9.bmp" so after you do that you need to click on Change Font and set the current font to Fixedsys at 9 points.
If you load the other bitmap file it is called "Courier 12.bmp" you must click on Change Font and set the current font to Courier at 12 points.
I'm thinking if the name of the font, it's style, and it's size is known ahead of time, like in the image file name or some other way, then the code could be changed to get this info, set picText to this font then you could eliminate the Change Font function
Last edited by jmsrickland; Jul 18th, 2013 at 10:25 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
You loaded up "Fixedsys 9.bmp" so after you do that you need to click on Change Font and set the current font to Fixedsys at 9 points.
If you load the other bitmap file it is called "Courier 12.bmp" you must click on Change Font and set the current font to Courier at 12 points.
I'm thinking if the name of the font, it's style, and it's size is known ahead of time, like in the image file name or some other way, then the code could be changed to get this info, set picText to this font then you could eliminate the Change Font function
I tried it again like you said and still does not read it! Are you using windows 7? maybe because of resolution? mine is 1366 * 768 pixel
By looking at the picture you attached it appears that it loads the image file and displays it in the Picturebox correctly so I don't know why the program is not reading the pixels from that Picturebox and giving you the correct results if you are indeed changing the font to the correct font name, regular style, and the correct point size.
Go into cmdScan_Click() and put in the code you see below in red. Now run the project again but only click on Scan button, nothing else. This was the original code but I commented it out because I wanted to load different bitmaps with text to test a variety.
Code:
Private Sub cmdScan_Click()
Dim ctl As PictureBox
Dim lX As Long, lY As Long
Dim lLine() As Long
Dim lPower() As Long
Dim lPicWidth As Long
Dim lPicHeight As Long
Dim lvLine As Long
Dim sReturn As String
Dim sOutput As String
Dim lskip As Long
lPower() = fcnGetPower()
Set ctl = picText
With ctl
.Cls
.Picture = Nothing
'create the picture with the text
ctl.Print "...Hello! I just like to know how things work..."
ctl.Print "abcdefghijklmnopqrstuvwxyz"
ctl.Print UCase$("abcdefghijklmnopqrstuvwxyz")
ctl.Print "!@#$%^&*()"
ctl.Print "1234567890"
ctl.Refresh
DoEvents
.ScaleMode = vbPixels
'get the values
lPicWidth = .ScaleWidth - 1
lPicHeight = .ScaleHeight - 1
'
'
'
'
End Sub
Last edited by jmsrickland; Jul 19th, 2013 at 10:33 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
I don't know what you are doing, Max, but it works perfectly for me and it looks like it also works for Doogle.
I pointed out in my post that it wont support all fonts. I have played around with several fonts and it works great and with other fonts it doesn't. I'm going to do a deeper test on this however so far I know it works with the two bitmaps I included. You can make other bitmaps with text using other fonts and point sizes and see what works the best. But first you got to get this straightened out because you picture you included just isn't what it does with me. My results look exactly like the picture Doogle posted.
Last edited by jmsrickland; Jul 20th, 2013 at 12:22 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Did you notice the image I posted? The results are exactly the same as the bitmap as far as spacing between letters and Doogle's had no spacing between the letters. The 2nd image I posted is Courier 12 and it too is exactly the same as the bitmap except no line to line spacing but that's to be expected.
I have no explanation why you two do not get perfect results like I do.
I have a suggestion. Make your own bitmaps, instead of using the ones I included, and use them for testing and see what results you get.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Here's another app that's decent enough. It does one character only but it is rather accurate and you can teach it to learn the characters. I did some modifications to it to make it easier to use but I didn't change any of the text recognition logic.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.