Libraryless. Click here for Pure Java version (16043L/112K).
!7 module CachedTilesToBuckets > DynPrintLogAndEnabled { int tileWidth = 16, tileHeight = 16; float threshold = 0.98f; transient new ImageBuckets buckets; start { thread "Calc" { calc(); } } void calc enter { buckets.similarityThreshold = threshold; L<File> files = listImageFiles(imageSnippetsCacheDir()); int count = 0; for (File f : files) pcall { ++count; if (!licensed()) ret; if (!enabled) continue with sleepSeconds(1); RGBImage rgb = loadImage(f); L<RGBImage> tiles = rgbImageToFixedSizeTiles(rgb, tileWidth, tileHeight); for (RGBImage tile : tiles) buckets.addImage(tile); print("Files processed: " + count + "/" + l(files) + ". Buckets: " + l(buckets.buckets) + ", images: " + buckets.images + ", duplicates: " + buckets.totalDuplicates); } } }
Began life as a copy of #1020130
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1020190 |
| Snippet name: | All Cached Image Tiles To Buckets [dev.] |
| Eternal ID of this version: | #1020190/3 |
| Text MD5: | 255d007e05fedcf345d0412c338c2e84 |
| Transpilation MD5: | 8849d127926a43c5cd4b1dab7eff4183 |
| 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: | 2018-12-09 21:57:34 |
| Source code size: | 864 bytes / 26 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 589 / 725 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |