Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low reco count even using example on iOS #35

Closed
piginhat opened this issue Jul 22, 2016 · 13 comments
Closed

Low reco count even using example on iOS #35

piginhat opened this issue Jul 22, 2016 · 13 comments

Comments

@piginhat
Copy link

I'm testing the sample app that comes with the package and when I run it the only way I can get it to accurately recognise alpha numerics is to type them in GIMP and test off my screen.

I have tried various texts, all single line from number plates, to single words to just numbers and I only get 100% hit when using typed text off my computer screen?

@NMAC427
Copy link
Owner

NMAC427 commented Jul 22, 2016

Hi. There could be a few different reasons why it won't work. One problem could be, that there is to much text/noise in the image.
bildschirmfoto 2016-07-22 um 20 56 24
Another reason why it may not work is, that the neural network isn't trained to recognize the font. I would first user the SwiftOCR Debug app (SwiftOCR/example/OS X/SwiftOCR Debug OS X) and look at the bounding boxes it recognizes (lower left corner). If the bounding boxes are good but the recognized text still is bad, I would try to download the font used in the image and train the NN with it. I hope this helps (if not, could you please send me some example images?).

PS. I use SwiftOCR to recognize text in images like this (and it works great :D).
img_1145

@piginhat
Copy link
Author

Hi,

firstly thank you for such a fast response!

I came across your library as I have been asked could I create a number
plate reco app and yours seemed to come out tops!

I tried on my car but no luck. I then tried the following, all with
different fonts:

Magazine, poster, newspaper, printer image, leaflet

But the only hit I get is if I type text into GIMP or something else on
screen :-(

Will try your suggestions

Thanks

P

On Fri, July 22, 2016 8:11 pm, Nicolas Camenisch wrote:

Hi. There could be a few different reasons why it won't work. One problem
could be, that there is to much text/noise in the image. ![bildschirmfoto
2016-07-22 um 20 56
24](https://cloud.githubusercontent.com/assets/9914734/17068018/d0dbcdb8-
504e-11e6-8b80-6a648153628c.png)
Another reason why it may not work is, that the neural network isn't
trained to recognize the font. I would first user the SwiftOCR Debug app
(SwiftOCR/example/OS X/SwiftOCR Debug OS X) and look at the bounding
boxes it recognizes (lower left corner). If the bounding boxes are good
but the recognized text still is bad, I would try to download the font
used in the image and train the NN with it. I hope this helps (if not,
could you please send me some example images?).

PS. I use SwiftOCR to recognize text in images like this (and it works
great :D).
![img_1145](https://cloud.githubusercontent.com/assets/9914734/17068270/4
88d7d60-5050-11e6-8147-8c92a61faf0a.png)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#35 (comment)

@piginhat
Copy link
Author

HI, OK i have used the the debug and the bounding rects are spot on, but still missing reco.

I've run the training app and selected all fonts and clicked start training and when finished and clicked test it reports 79.5% accuracy.

I've downloaded a few fonts that I think might help my particular needs but could you clarify the following please?

  1. How do I get the fonts into the training section?
  2. Once I have trained the font does the NN compile into the sample app, my own app?

Thanks

@NMAC427
Copy link
Owner

NMAC427 commented Jul 23, 2016

Hello.
After you installed the fonts, you just have to restart the training app and the new fonts should appear in the list.
After training the NN, press the Save button and the new OCR-Network file get saved on your desktop. To use this network, you have to replace the old OCR-Network in the SwiftOCR folder with this new file.

@piginhat
Copy link
Author

HI,
OK, have added font, trained, created NN file and copied into SwiftOCR->framework->SwiftOCR, recompiled SwiftOCR Camera and still no accurate reco :-(

I'm primarily trying to reco car number plates but any text I choice seems to fail?
1
2
3
4
5

@NMAC427
Copy link
Owner

NMAC427 commented Jul 23, 2016

Ok now I know why it isn't working. To recognize the first two images you have to first invert them (so that they are black on white instead of white on black). The last three images are way to big. I've scaled them down and the recognition worked well. :D

9f2347f6-5111-11e6-8cd7-79db3b91b76a

bildschirmfoto 2016-07-23 um 21 14 19

@piginhat
Copy link
Author

piginhat commented Jul 23, 2016

Ah, so this leads to another question then...I thought I could use the library to point my device at number plates and ensure the number is in the shaded area of the screen view the snap and it would recognise?

So does this mean this is not possible?

I have also scaled the number plate image to 256px and still no reco?

@NMAC427
Copy link
Owner

NMAC427 commented Jul 23, 2016

Hmmm... I tried to recognize some license plates with the iOS Testing app and it worked. How accurate is the recognition if your try to recognize it with the unmodified and the modified app?

I have also scaled the number plate image to 256px and still no redo?

What do you mean by scaling the image to 256px? The height of each character should be somewhere between 20 and 70 px tall.

@piginhat
Copy link
Author

I am trying to go to my car, place the number plate in the shaded area of the camera view and snap.

So can I assume the library wont work by pointing at plates on cars? I would have to take a photo of the plate, reduces in size then try to reco?

@NMAC427
Copy link
Owner

NMAC427 commented Jul 23, 2016

It seems like you have to tinker with some parameters (#36) and try to train the NN some more.
I'm sorry that it doesn't work like it should but I have no idea why. I will look into it some more tomorrow.

@efromsf
Copy link

efromsf commented Sep 11, 2016

Fantastic framework Nicolas. Your comments here to piginhat have been very helpful.
Hopefully this is okay to to ask but are you interested in some paid consulting integrating swiftOCR into an app? If so please do reach out to efromsf at yahoo.com. We might have a fun project for you.

@piginhat
Copy link
Author

Unfortunately I got nowhere with it, just could not get the framework to recognise the plates. I also was unable to find a font that matched that would import to Mac fonts so I could try to train the network :-(

@efromsf
Copy link

efromsf commented Sep 11, 2016

Nicolas, do you have any free time or interest?
BTW you really have been remarkably responsive with your help for folks...

@NMAC427 NMAC427 closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants