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

29
LINES

< > BotCompany Repo | #1024871 // Auto Chess Board Recognizer [dev.]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (19677L/111K).

!7

cmodule AutoChessBoardRecognizer > ChessOCR_DynChessBoardRecognizer {
  new L<ParameterizedSegmenter> seedSegmenters;
  new MRUAndAllTimeTop<ParameterizedSegmenter> chest;
  new Map<S, Result> bestSegmenterForImage; // key: image MD5
  new L<S> lastImagesLookedAt; // image MD5
  
  srecord Result(ParameterizedSegmenter segmenter, Rect boardPosition,
    double score, S fen) {}
  
  JComponent segmenterSection() {
    ret dm_calculatedCenteredLabel(() ->
      "Treasure chest size: " + l(chest)
      + ", " + n2(bestSegmenterForImage, "image result")
      + ", " + n2(lastImagesLookedAt, "last image"));
  }

  Iterator<ParameterizedSegmenter> makeSegmenters() {
    if (empty(seedSegmenters)) {
      print("Loading seed segmenters");
      Cl<S> presets = agiBlue_chessBoardSegmenterPresetNames();
      for ping (S preset : presets)
        seedSegmenters.add(parameterizedSegmenterFromAGIBlue(preset));
      chest.addAll(seedSegmenters);
    }
    ret chest.mixedIterator();
  }
}

Author comment

Began life as a copy of #1024674

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024871
Snippet name: Auto Chess Board Recognizer [dev.]
Eternal ID of this version: #1024871/5
Text MD5: 21bdf7644e9e4fd54733f7b2196876b7
Transpilation MD5: 8feebcedcf0b1037f9ef28641e60cc75
Author: stefan
Category: javax / image recognition
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-28 11:56:58
Source code size: 1023 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 219 / 1111
Version history: 4 change(s)
Referenced in: #1024881 - Auto Chess Board Recognizer v2 [dev.]