|This property is provided by the legacy OCR plugin. In version 12.60, the plugin was replaced with the new Optical Character Recognition plugin powered by Google Cloud Vision API. To learn more, see Optical Character Recognition.
The legacy OCR plugin was removed from TestComplete in version 12.60. If you need to use objects, methods, and properties provided by the legacy plugin with this version of TestComplete, please contact our Customer Care team. The legacy OCR plugin was restored in TestComplete version 14.0. To use the objects, methods, and properties with this or later TestComplete version, you need to install and enable the plugin manually.
OCRObject.DefaultOptions property returns an
OCROptions object that holds the default values of character recognition settings. Passing this object to the
GetText method discards the changes made via the
|OCRObjectObj||An expression, variable or parameter that specifies a reference to an OCRObject object|
The property is applied to the following object:
OCROptions object holding the default values of character recognition settings.
The following code snippet creates an
OCROptions object that contains the default character recognition settings and then posts those default settings to the test log.
def OCROptionsSample(): # Obtains an on-screen object (Notepad window) OnScreenObj = Sys.Process("notepad").Window("Notepad", "*").Window("Edit") # Obtains an image of the on-screen object Rect = OnScreenObj.Picture() # Creates an OCR object OCRObj = OCR.CreateObject(Rect) # Creates an OCROptions object that stores the default character recognition settings OCROptions = OCRObj.DefaultOptions # Obtains the default settings and posts them to the test log Info = "Active recognition set: " + str(OCROptions.ActiveRecognitionSet) + "\r\n" + "Grayscale binarization: " + str(OCROptions.GrayScaleBinarization) + "\r\n" + "Binarization threshold: " + str(OCROptions.BinarizationThreshold) + "\r\n" + "Recognition autorejection: " + str(OCROptions.RecognitionRejectionAuto) + "\r\n" + "Recognition rejection threshold: " + str(OCROptions.RecognitionRejection) + "\r\n" + "Exact search is used: " + str(OCROptions.ExactSearch) + "\r\n" + "Search accuracy threshold: " + str(OCROptions.SearchAccuracy) + "\r\n" + "Skip fragmentation: " + str(OCROptions.SkipFragmentation) Log.Message("Character Recognition Default Settings", Info)