Libraryless. Click here for Pure Java version (5218L/33K).
static ItIt<ParameterizedSegmenter> chessOCR_adaptSegmenterToMainImageColors(BufferedImage img, ParameterizedSegmenter baseSegmenter, O... _) { optPar int maxColors = 10; // try 10 top colors MultiSet<S> histogram = histogram332(img); ret takeFirstI(maxColors, mapI(histogram.highestFirst(), color -> { ParameterizedSegmenter seg = shallowNonTransientClone(baseSegmenter); seg.distanceFromColor(color332toRGB(color)); ret seg; })); }
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: | 527 / 668 |
| Version history: | 6 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1024818 - chessOCR_varySegmenterGain |