twelve17 / openalpr-ios

Xcode Framework for the openalpr library
GNU General Public License v3.0
116 stars 35 forks source link

how use alpr in xcode? #2

Closed olivero86 closed 8 years ago

olivero86 commented 9 years ago

I think I successfully installed openalpr-ios and linked it in my xcode project. however, I have no idea how to use it in xcode? thank you, your help is greatly appreciated!

twelve17 commented 9 years ago

Have you had a chance to go through the Readme? Do you have a specific question?

olivero86 commented 9 years ago

yes. I have an image (UIImage) in my app and would like to recognize the license plate. Is there a function I could call to do that? Thank you so much!

twelve17 commented 9 years ago

Are you familiar with the openalpr library?

olivero86 commented 9 years ago

no, just saw the demo on the website and installed it with your manual.

twelve17 commented 9 years ago

openalpr has an API for taking an image and returning plate candidates. You may want to get a little familiar with that first. The main class on the project is a good reference to use as an example.

olivero86 commented 9 years ago

I think I can understand what this class does but I still have no idea how to use it in my ios app? can you give me a hint what to do or maybe a sample project?

twelve17 commented 9 years ago

Unfortunately I don't have a sample project I can post at the moment. But the various parts are goog-able. You will need to know:

olivero86 commented 9 years ago

hmm ok, I thought your openalpr-ios did some of that already?

twelve17 commented 9 years ago

I don't have a simple openalpr-ios project. It's mingled with an app I'm working on, and has hardcoded paths to include openalpr. I haven't yet learned how to create Xcode projects dynamically via a script, like OpenCV does with its iOS python script, so it would still take manual tweaking to get it working elsewhere.

I haven't had a chance to extract out the generic stuff from the proprietary stuff I am not allowed to release. I'm also not working with UIImages, but I am sure there are samples online for doing the conversion from them. All the other items are generic concepts that apply to any C++ library you might use in Xcode.

I'm also waiting until Tesseract 3.03 is released, so that then it can just be a CocoaPod dependency, which should make management of an openalpr Xcode project easier.

olivero86 commented 9 years ago

Ok I'll try to do that but just for my understanding, what did I do by following ur openalpr-ios readme? None of the "various parts" above? Thanks

twelve17 commented 9 years ago

I believe that the instructions in the readme would get you the first two items on that list. Then it's a matter of including the alpr header in a objective C++ class in your project, and using the openalpr API to get plates from a OpenCV mat.

olivero86 commented 9 years ago

I got the conversion for the UIImage. Could you give me a hint which classes I need?

twelve17 commented 9 years ago

I'm not sure what you mean. Can you be more specific? Do you have the code somewhere?

olivero86 commented 9 years ago

looks like I got the these things covered: How to include the openalpr headers in your own project How to "link to" the openalpr library in your own project How to convert an UIImage to OpenCV Mat

now I think I have to include the right openalpr classes as you stated by this "How to use C++ classes in Xcode projects (mainly this means renaming the impl classes with an '.mm' extension)" Problem is I'm not sure which classes I'll need?

Would you be interested in setting up a demo xcode project in swift for me? I'll pay for it of course!

twelve17 commented 9 years ago

I'm afraid I am not experienced with swift at the moment. The classes you need are shown in openalpr's main.cpp class. Tinker around with code from that class for a bit, and you will see what you need.

twelve17 commented 8 years ago

For v2 of this project, I have replaced the old instructions and bash scripts with a Ruby script to build the OpenALPR and dependency Frameworks, as well as the OpenALPR Xcode project. A sample app is included. These changes have been pushed to the master branch, and the old version has been moved to branch 1_0. Feel free to check out this new script and see if it works for you. I will no longer be working on or supporting the 1_0 codebase.