ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 OCR: How I can use 2 languages simultaneously?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

ForumReader

5 Posts

Posted - Feb 18 2020 :  01:11:32  Show Profile  Reply
Hello.
What if I have 2 languages in text?
For example 80% of text in English and other 20% in Russian.
I have both "trained" engine, but how I can connect it? :\

xequte

38127 Posts

Posted - Feb 18 2020 :  14:17:37  Show Profile  Reply
Hi

Multiple languages can be supported as follows:

var langs: TIEVisionVectorString;

langs := IEVisionLib.createVectorString();
langs.push_back( IEOCRLanguageList[ OCR_English_language ].Code ); // load English
langs.push_back( IEOCRLanguageList[ OCR_Italian_language ].Code ); // load Italian
m_OCR := IEVisionLib.createOCR( '', langs );


More Info: https://www.imageen.com/help/TIEVisionLibrary.createOCR.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ForumReader

5 Posts

Posted - Feb 19 2020 :  04:33:25  Show Profile  Reply
I add this part of code to default demo. Of course, change Italian to OCR_Russian_Language.

Both "eng" and "rus" trained datafile in exe directory.

When I press "recognize" - get Access violation in ievision.dll at string
memo1.Lines.Text := m_OCR.recognize(ImageEnView1.IEBitmap ...

But original demo works well with "rus" or "eng" in rotation :\
Please help :(
Go to Top of Page

xequte

38127 Posts

Posted - Feb 20 2020 :  04:56:10  Show Profile  Reply
Please email us the sample files that reproduce this.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ForumReader

5 Posts

Posted - Feb 20 2020 :  11:24:37  Show Profile  Reply
Full project (in zip):
https://mega.nz/#!FJwzlIAa!_NZDNGrO7mKGzr7kISRiEUmDGGjvMDSxjppnkdZPjDQ

But you can easy reproduce this error replacing in OCR demo string:

// create OCR object
// m_OCR := IEVisionLib.createOCR(PAnsiChar(AnsiString(langPath)), PAnsiChar(AnsiString(langCode)), TIEVisionOCREngine(cmbEngine.ItemIndex));

TO:

langs := IEVisionLib.createVectorString();
langs.push_back( IEOCRLanguageList[ OCR_English_language ].Code ); // load English
langs.push_back( IEOCRLanguageList[ OCR_Russian_Language ].Code ); // load Italian
m_OCR := IEVisionLib.createOCR( '', langs );

and press Recognize :(
Please help.
Go to Top of Page

xequte

38127 Posts

Posted - Feb 20 2020 :  15:37:45  Show Profile  Reply
Hi

Yes, it seems to fail if the path is not specified. We will investigate. It works when I call:
...
m_OCR := IEVisionLib.createOCR( PAnsiChar(AnsiString(langPath)), langs );

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: