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

18
LINES

< > BotCompany Repo | #1024820 // chessOCR_scorePieceRecognizer

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11282L/77K).

static double chessOCR_scorePieceRecognizer(ChessPieceRecognizer recognizer) {
  ret chessOCR_scorePieceRecognizer(chessOCR_squareImagesCollectorFromAGIBlue(), recognizer);
}
  
static double chessOCR_scorePieceRecognizer(ChessOCR_SquareImagesCollector squareImagesCollector, ChessPieceRecognizer recognizer) {
  LPair<S, BufferedImage> images = squareImagesCollector.allImages();
  try {
    new Scorer scorer;
    for (unpair S piece, BufferedImage img : images) {
      scorer.add(eqic(pairA(recognizer.recognize(img)), piece));
    }
  
    ret scorer.score();
  } catch print e {
    print("RECOGNIZER TOTAL FAIL");
    ret 0;
  }
}

Author comment

Began life as a copy of #1024760

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: #1024820
Snippet name: chessOCR_scorePieceRecognizer
Eternal ID of this version: #1024820/2
Text MD5: e631971668b892c6119d624bd06654f7
Transpilation MD5: b1562d867d80219e1325caa255cd812a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-26 13:58:30
Source code size: 654 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 192 / 288
Version history: 1 change(s)
Referenced in: [show references]