ImageEn, unit ievision

TIEVisionOCR


Declaration

TIEVisionOCR = interface(TIEVisionBase)


Description

This interface allows you to perform OCR (Optical Character Recognition) in English and 110 other languages:

Afrikaans, Albanian, Amharic, Ancient Greek, Arabic, Armenian, Assamese, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Breton, Bulgarian, Burmese, Catalan,
Cebuano, Cherokee, Simplified Chinese, Traditional Chinese, Corsican, Croatian, Czech, Danish, Dhivehi, Dutch, Dzongkha, English, Equations, Esperanto, Estonian,
Faroese, Filipino, Finnish, Frankish, French, Gaelic, Galician, Georgian, German, Greek, Gujarati, Haitian, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Inuktitut,
Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Korean, Kurdish, Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malay, Malayalam,
Maltese, Maori, Marathi, MICR, Middle English, Middle French, Mongolian, Nepali, Norwegian, Occitan, Oriya, Pashto, Persian, Polish, Portuguese, Punjabi, Quechua,
Romanian, Russian, Sanskrit, Serbian, Sindhi, Sinhala, Slovakian, Slovenian, Spanish, Sundanese, Swahili, Swedish, Syriac, Tagalog, Tajik, Tamil, Tatar, Telugu, Thai,
Tibetan, Tigrinya, Tongan, Turkish, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Western Frisian, Yiddish, Yoruba

Recognition supports:
- Reading ANSI or Unicode text from a raster image
- Estimating the document orientation (text angle)
- Getting each recognized character position (bounding boxes)
- Getting text regions (to reproduce text layout)



To change the language of OCR, specify the path of the language file when calling IEVisionLib.createOCR. You can download language files from:
www.imageen.com/download/

Note: Only one single instance of this object can exist in your application.


Demos

Demo  Demos\IEVision\OCR\OCR.dpr
Demo  Demos\IEVision\OCRwithLayout\OCRwithLayout.dpr


Examples

OCR := IEVisionLib.createOCR(IEOCRLanguageList[OCR_English_language].Code);
str := OCR.recognize(ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0)).c_str();

OR

sLanguage := 'fra'; // French
if FileExists( IncludeTrailingPathDelimiter( ExtractFilePath( Application.ExeName )) + sLanguage + '.traineddata' ) = False then
  raise Exception.create( 'Language file not found' );
OCR := IEVisionLib.createOCR( sLanguage );
str := OCR.recognize(ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0)).c_str();

OR for multiple languages:

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 );
str := m_OCR.recognize(ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0)).c_str();


Methods and Properties

Public Method  clearAdaptiveInfo
Public Method  getBoxes
Public Method  getOrientation
Public Method  getRegions
Public Method  getTextAngle
Public Method  getWordBoxes
Public Method  isWordValid
Public Method  recognize
Public Method  setSegmentationMode
      

See Also

Public Method  createOCR
Class  TIEVisionLanguages
Class  TIEVisionOCRWordBox
Global Method  IEVisionLanguageCodeToName
Global Method  IEVisionLanguageNameToCode
Global Method  IEVisionGetLanguagesInFolder