How do i implement OCR text recognition in unity?
@Bunny83 @Eric5h5 @robertbu @Aurore @whydoidoit @fafase Hi, I am working in Text recognition. I need to recognize hand written texts or printed texts. I have tried vuforia for this and it worked but i don’t want to spend that much money on it. I have tried the following,
Tesseract
Google cloud vision API.
Tesseract - I can’t able to complete it. I have searched in google and am doing.
Google cloud vision - I am getting 403 forbidden error. I have to check this.
Does anyone help me on this? i have struggling in this for past 2 weeks. i desperately in need of your help.
Thanks.
I want to implement OCR in multiple languages on Android but vuforia only supports English.
I've been looking to alternatives but I'm not sure if Google Cloud Vision is feasible because I wanted it to be in real time.
The other alternative is Tesseract but I did not find a plugin or wrapper for unity so I'm not sure if I will be able to make it work.
How are your trying to do it?
Thanks
Answer by $$anonymous$$ · Jun 09, 2017 at 02:29 PM
@MuraliVenkat I was able to get Tesseract to compile but as I remember there were also many dependent libraries like Leptonica and Libtiff that also had to be successfully compiled and linked as well. I found a version of these libraries somewhere on the net and added those to my project. My app successfully recognized text at about 300 dpi. You could create a Unity plugin that then calls this OCR function. There is a sample plugin project in the Unity Documentation.
@$$anonymous$$ : Thanks for your reply. Can you share any POC for it so that i will move forward to complete this one. I am stuck on it. Thank you.
@$$anonymous$$uraliVenkat Here is the line of code in my xCode project that interfaces with Tesseract to perform the OCR:
text = tess->TesseractRect((const unsigned char*)imageData, (int)([imageRep bitsPerPixel]/8), bytes_per_line, 0, 0, imageSize.width, imageSize.height);
Answer by G9host · Aug 12, 2017 at 07:10 AM
@digland2000 Can please post the link of the sample Plugin Project (which i couldn't find any where even documentations)..Thank you...
@G9host Go to this page:
https://docs.unity3d.com/$$anonymous$$anual/PluginsForDesktop.html
Look under the section titled Examples and there is a small link you can click under the heading Simplest Plugin. It was a very basic project but helped a lot.