AI > MemorizeArea2 { float similarityThreshold = 0.9f; int shrinkPixels = 1; new L images; static ImageSurface is; Pt lastLocation; void go { // guess Rect guess = null; if (lastLocation != null) for (RGBImage blobImage : images) { guess = foundImgToRect(rgbRawImageSearch_searchHereOnly(image, blobImage, similarityThreshold, lastLocation)); if (guess != null) break; } if (guess == null) for (RGBImage blobImage : images) { guess = foundImgToRect(rgbRawImageSearch_searchHereFirst(image, blobImage, similarityThreshold, null)); if (guess != null) { lastLocation = new Pt(guess.x, guess.y); break; } } // submit Rect solution = first(submit(guess)); // learn bool correct = solution == null ? guess == null : guess != null && solution.contains(centerOfRect(guess)); if (solution != null && !correct) { images.add(image.clip(growRect(solution, -shrinkPixels))); if (visualize) is = showZoomedImage(is, "Memorized Areas", mergeImagesHorizontally(images)); } } }