Libraryless. Click here for Pure Java version (5218L/33K).
1 | static ItIt<ParameterizedSegmenter> chessOCR_adaptSegmenterToMainImageColors(BufferedImage img, ParameterizedSegmenter baseSegmenter, O... _) { |
2 | optPar int maxColors = 10; // try 10 top colors |
3 | MultiSet<S> histogram = histogram332(img); |
4 | ret takeFirstI(maxColors, mapI(histogram.highestFirst(), |
5 | color -> { |
6 | ParameterizedSegmenter seg = shallowNonTransientClone(baseSegmenter); |
7 | seg.distanceFromColor(color332toRGB(color)); |
8 | ret seg; |
9 | })); |
10 | } |
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: | #1024803 |
Snippet name: | chessOCR_adaptSegmenterToMainImageColors |
Eternal ID of this version: | #1024803/7 |
Text MD5: | 6127154ec2f3a7ddbe5202b4f2f414e8 |
Transpilation MD5: | f10b93e1ec776f5b7bc587f73710c3a8 |
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:09:51 |
Source code size: | 474 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 283 / 389 |
Version history: | 6 change(s) |
Referenced in: | [show references] |