Warning: session_start(): open(/var/lib/php/sessions/sess_bct9aiqq75h034snpvkav6q8mg, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
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_quick(image, blobImage, similarityThreshold));
if (guess != null)
break;
}
if (guess == null)
for (RGBImage blobImage : images) {
guess = foundImgToRect(rgbRawImageSearch_searchHereOnly(image, blobImage, similarityThreshold, lastLocation));
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));
}
}
}