!752 concepts. !include #1005686 // PIF Classes v2 sS src1 = "#1005715", src2 = "#1005721"; static int maxTotal = 10; static Map, MultiSet> correlations = new HashMap; p { Concepts in1 = new Concepts(src1).load(); Concepts in2 = new Concepts(src2).load(); in1.deleteAll(Found); in2.deleteAll(Found); print("Loaded from:"); printIndent(joinLines(snippetsWithTitles(ll(src1, src2)))); print("Total concepts: " + in1.countConcepts() + ", " + in2.countConcepts()); L clips1 = goodClips(in1), clips2 = goodClips(in2); print("Good clips: " + l(clips1) + ", " + l(clips2)); while licensed { TransientScreenshot t = new TransientScreenshot(shootScreen2()); ImageFinder finder = new ImageFinder(t, concatLists(clips1, clips2)); finder.maxTotal = maxTotal; finder.run(); L found1 = findBackRefs(clips1, Found); L found2 = findBackRefs(clips2, Found); deleteAll(Found); print("#found = " + l(found1) + " / " + l(found2)); printFound(found1); print(); printFound(found2); print(); for (Found a : found1) for (Found b : found2) correlate(correlations, a, b); for (Pair key : correlations.keySet()) { print(key.a.id + " / " + key.b.id + " => " + struct(correlations.get(key))); } sleepSeconds(5); } } svoid correlate(Map, MultiSet> correlations, Found a, Found b) { Pair key = new Pair(a.clip!, b.clip!); Pt p = new Pt(b.fi.r.x-a.fi.r.x, b.fi.r.y-a.fi.r.y); MultiSet ms = correlations.get(key); if (ms == null) correlations.put(key, ms = new MultiSet); ms.add(p); } svoid printFound(L l) { for (Found f : l) print(f.fi.r + " " + f.clip->id); } static L goodClips(Concepts in) { ret [Clip c in in.list(Clip) | !swic(c.description, "bad")]; }