Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1007106 // MemorizeBrightBLOB3 (AI) - multiple images

JavaX fragment (include)

AI > MemorizeBrightBLOB3 {
  float similarityThreshold = 0.9f;
  new L<RGBImage> images;
  static ImageSurface is;

  static L<Rect> segment(RGBImage img) {
    ret autoSegment_blackBG(new BWImage(img), 3); // 2 is too small
  }

  void go {
    // guess
    
    L<Rect> myRects = segment(image);
    Rect guess = rgbFindMostSimilarClip_multi(image, images, myRects, similarityThreshold);
      
    // submit
    
    Rect solution = first(submit(guess));
    
    // learn
    
    bool correct = solution == null ? guess == null : guess != null && solution.contains(centerOfRect(guess));
    if (solution != null && !correct) {
      solution = autoCropOfRGBImage_blackBG(image, solution);
      Rect mine = smallestRectContaining(myRects, centerOfRect(solution));
      if (mine != null) {
        images.add(image.clip(mine));
        is = showZoomedImage(is, "Memorized BLOBs", mergeImagesHorizontally(images));
      }
    }
  }
}

Author comment

Began life as a copy of #1006905

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007106
Snippet name: MemorizeBrightBLOB3 (AI) - multiple images
Eternal ID of this version: #1007106/1
Text MD5: 98e16891e6df346b6018d40c91e5c7f3
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-03 02:03:14
Source code size: 971 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 542 / 705
Referenced in: #1007103 - A. I. Game 3.6 / Start The Audio Mixer In The Popup [solving]