Anyone know of any Xojo code that can read car license plates?
Dave
Try changing the subject to “OCR With Xojo” or something, it might attract more people.
It’s not likely that there is existing Xojo code for such a specific use case though. Maybe someone will have insight, or libraries that can be wrapped up for use with Xojo.
I did Licenseplate recognition with Xojo in the past. Perhaps I’ll find some time tomorrow to search for the project… But I don’t know if I’ll find it…
Monkeybread has a plugin for OCR if you want to go that route.
https://www.monkeybreadsoftware.net/plugins-mbsocrplugin.shtml
Core Image has a rather bizarre function for ‘finding’ the text within a image, however you still need to use a OCR library to read that text.
Requires a lot of declares, plugin or API Kit.
But it’s backed into the OS, just a shame that the actual OCR part isn’t, but it might save you some time as it can at least locate text on a photo.
Thinking about this, you might want to look at desaturating the image first and then increasing the contrast. Don’t forget you’ll also have glare, reflections and dirt on the number plate which will make it harder to process.
Dave, iOS declares are not quite simple. The learning curve is not trivial. And if Sam says it requires “a lot of declares”, even less.
You may look into using an online API, such as
http://www.newocr.com/api/
or
http://ocrsdk.com/
https://github.com/openalpr/openalpr
alpr.exe plateimage.png
Works on Linux, Mac, Windows and can identify license plates anywhere in an image, even from different angles/perspectives Using the locality argument in the command line, you can even get the state/country of the license plate as well as the number
I’ve used OpenALPR for police software to automatically identify the vehicle in front of the cruiser and pull up the related information so eyes can stay on the road more often OpenALPR even has a daemon for streaming ffmpeg video for real-time license plate gathering!
For Linux it’s as simple as:
sudo apt-get update && sudo apt-get install -y openalpr openalpr-daemon openalpr-utils libopenalpr-dev
For Windows there are pre-compiled binaries available. There is an out-dated Mac binary available; I’d recommend compiling the source from the Git repository
https://github.com/openalpr/openalpr.git
Hope that helps! It’s much smaller than OpenCV and there are libraries available if you wish to invoke the calls from API rather than a shell or video-stream.
You can try CIFeature class from Apple.
CIFeatureTypeText May be what you need to detect.
I have that in my plugins for macOS if you like to test on Mac first.