AI > MemorizeArea3 { float similarityThreshold = 0.9f; int shrinkPixels = 1; RGBImage blobImage; static ImageSurface is; Pt lastLocation; void go { // guess Rect guess = null; if (blobImage != null) { guess = foundImgToRect(rgbRawImageSearch_searchHereFirst(image, blobImage, similarityThreshold, lastLocation)); if (guess != null) lastLocation = new Pt(guess.x, guess.y); } // submit Rect solution = first(submit(guess)); // learn bool correct = solution == null ? guess == null : guess != null && solution.contains(centerOfRect(guess)); if (blobImage != null && !correct && similarityThreshold > 0.01f) { similarityThreshold -= 0.01f; print("Lowering similarity threshold to " + similarityThreshold); } if (blobImage == null && solution != null) { blobImage = image.clip(growRect(solution, -shrinkPixels)); if (visualize) is = showZoomedImage(is, "Memorized Area", blobImage); } } }