Uses 108K of libraries. Click here for Pure Java version (15241L/108K).
1 | static Pair<Rect, S> chessOCR_demoTwoStageRecognizer(BufferedImage img) { |
2 | replace PS with ParameterizedSegmenter. |
3 | |
4 | ImageSurface is = showImage(img); |
5 | |
6 | PS seg1 = parameterizedSegmenterFromAGIBlue("find chess board #4 #1"); |
7 | Iterator<PS> seg2 = chessOCR_varySegmenterGain(seg1); |
8 | Iterator<PS> seg3 = nestedIterator(seg2, func(PS seg) -> Iterator<PS> { |
9 | chessOCR_adaptSegmenterToMainImageColors(img, seg, maxColors := 4) |
10 | }); |
11 | |
12 | ChessOCR_TwoStageRecognizer rec = new(chessOCR_pieceRecognizer(), img, seg3); |
13 | rec.verbose(true); |
14 | |
15 | new Var<Rect> last; |
16 | while ping (rec.step()) |
17 | if (setVar_trueIfChanged(last, rec.bestBoardLocation())) |
18 | overlaySelectionsOnImageSurface(is, ll(last!)); |
19 | print(rec.best); |
20 | ret rec!; |
21 | } |
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: | #1024819 |
Snippet name: | chessOCR_demoTwoStageRecognizer |
Eternal ID of this version: | #1024819/2 |
Text MD5: | f04e54e4c0816e82ee96d1e55fea11db |
Transpilation MD5: | e8da95c3e623946dc0d547b2200e2d89 |
Author: | stefan |
Category: | javax / chess ocr |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-26 13:35:45 |
Source code size: | 756 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 189 / 265 |
Version history: | 1 change(s) |
Referenced in: | [show references] |