static RGB unixTerminalDollarFinder_destColor = rgb("#5650C3"); static L unixTerminalDollarFinder(BufferedImage screenshot) { int w = screenshot.getWidth(), h = screenshot.getHeight(); BWImage bw = new BWImage(w, h); int destColorInt = unixTerminalDollarFinder_destColor.getInt(); for y to h: for x to w: { float diff = rgbDiff(screenshot.getRGB(x, y), destColorInt); diff = (diff-0.2f)*10f; bw.setPixel(x, y, diff); } final L rects = sortRectsByMiddleY(autoSegment(bw, 2)); L l2 = rectsWithSize(rects, 10, 17); new L found; for (Rect r : l2) { Scored gi = simpleRecognizer().recognizeGlyph(bw.clip(r)); if (gi.has() && eq(gi->meaning, "$")) found.add(r); } ret found; }