!7 // approximate size: 10,17 // approximate y distance: 615-593 static RGB destColor = rgb("#5650C3"); static float contrast = 5f; static float gamma = 0.5f; static int g = 2; p-experiment { //RGBImage img = shootScreen(); RGBImage img = loadRGBImage(/*#1101257*/#1101258); int w = img.getWidth(), h = img.getHeight(); BWImage bw = new BWImage(w, h); int destColorInt = destColor.getInt(); for y to h: for x to w: { float diff = rgbDiff(img.getInt(x, y), destColorInt); //diff = pow(diff, gamma); //diff *= contrast; diff = (diff-0.2f)*20f; bw.setPixel(x, y, diff); } //showBWImage(bw); //showAutoSegmentedImage(bw); final L rects = sortRectsByMiddleY(autoSegment(bw, g)); pnl(rects); final ImageSurface is1 = showImageWithSelections(bw, rects); onClick(is1, voidfunc(MouseEvent e) { Pt p = is1.pointFromEvent(e); pnl(rectsContaining(p, rects)); }); L l2 = rectsWithSize(rects, 10, 17); for (Rect r : l2) print(simpleRecognizer().recognizeGlyph(bw.clip(r))); BufferedImage bi = bw.getBufferedImage(); L texts = ocr_recognizeMultiLine_scored(bw, simpleRecognizer(), l2); ImageSurface is = showImageWithRecognizedTexts(bi, null, texts); showImageWithRecognizedTexts_makeTeachable2(bi, is, texts, filledSimpleRecognizer_cached(), null); }