def reset_text_recognizer(self): """Resets the text recognizer settings to default. Example: | Switch OCR To Numbers Only | # Sets the On screen Character Recognition To Numbers Only. | | Reset Text Recognizer | # Reset the text recognizer back to the alpha-numeric text recognition. | """ self._info("Setting the text recognition setting to the default settings.") TextRecognizer.reset() TextRecognizer.getInstance()
def reset_text_recognizer(self): """Resets the text recognizer settings to default. Example: | Switch OCR To Numbers Only | # Sets the On screen Character Recognition To Numbers Only. | | Reset Text Recognizer | # Reset the text recognizer back to the alpha-numeric text recognition. | """ self._info( "Setting the text recognition setting to the default settings.") TextRecognizer.reset() TextRecognizer.getInstance()
def startup(): if LOGIN_SCREEN_FULL.exists(LOGIN_SCREEN_FULL_IMG): pass elif WELCOME_SCREEN.exists(WELCOME_SCREEN_IMG): logout() wait_for_login_screen() else: raise BadError("Unrecognized Starting Condition") Settings.OcrTextRead = True Settings.OcrLanguage = "eng" # reset the TextRecognizer TR.reset() # instantiate it TR.getInstance() wl = string.ascii_letters + string.digits OCR.setParameter("tessedit_char_whitelist", wl)
import org.sikuli.script.TextRecognizer as TR Settings.OcrReadText = True Settings.OcrLanguage = "chi_sim" TR.reset() print selectRegion().text()
grid.x += 3 grid.y += 2 lineCount = int(grid.h / lineHeight) grid.h = lineCount * lineHeight #grid.highlight(2) # step 3: walk through the lines grid.setRows(lineCount) for i in range(lineCount): grid.getRow(i).highlight(1) break # uncomment to be faster # read the textual content of the first 2 rows Settings.OcrTextRead = True import org.sikuli.natives.OCR as OCR import org.sikuli.script.TextRecognizer as TR TR.getInstance() digits = "0123456789" lower = "abcdefghijklmnopqrstuvwxyz" upper = lower.upper() chars = lower + upper all = chars + digits # read the result message #OCR.setParameter("tessedit_char_whitelist", chars) #OCR.setParameter("tessedit_char_whitelist", all) print foot1.left(150).text() OCR.setParameter("tessedit_char_whitelist", digits) print "content of first row" uprint(grid.getRow(0).text())
grid.x += 3 grid.y += 2 lineCount = int(grid.h/lineHeight) grid.h = lineCount*lineHeight #grid.highlight(2) # step 3: walk through the lines grid.setRows(lineCount) for i in range(lineCount): grid.getRow(i).highlight(1) break # uncomment to be faster # read the textual content of the first 2 rows Settings.OcrTextRead=True import org.sikuli.natives.OCR as OCR import org.sikuli.script.TextRecognizer as TR TR.getInstance() digits = "0123456789" lower = "abcdefghijklmnopqrstuvwxyz" upper = lower.upper() chars = lower+upper all = chars+digits # read the result message #OCR.setParameter("tessedit_char_whitelist", chars) #OCR.setParameter("tessedit_char_whitelist", all) print foot1.left(150).text() OCR.setParameter("tessedit_char_whitelist", digits) print "content of first row" uprint(grid.getRow(0).text())