!7 static OCRRecognizeAndTeach ocr; // contrast & brightness, roughly static float scaleFactor = 1.5f, offset = -0.5f; p-subst-autorestart { doIt(); showButton("Again", r-thread { doIt() }); } svoid doIt { cleanUp(ocr); ocr = null; print("Shooting & inverting"); BufferedImage img = shootScreenHidingConsole(); invertImage(img); bufferedImageContrastAndBrightness(img, scaleFactor, offset); //saveJPG(img, getProgramFile("inverted.jpg")); ocr = new OCRRecognizeAndTeach(img); }