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

15
LINES

< > BotCompany Repo | #1015442 // ocr_slimFullSearchMap

JavaX fragment (include)

static int ocr_slimFullSearchMap_maxPixels = 1000;

static Map<BWImage, S> ocr_slimFullSearchMap(Map<BWImage, S> map) {
  if (ocr_slimFullSearchMap_maxPixels <= 0) ret map;
  for (BWImage img : cloneKeys(map)) {
    int pix = bwImagePixels(img);
    continue if pix <= ocr_slimFullSearchMap_maxPixels;
    BWImage img2 = new BWImage(scaleBufferedImageToMaxPixels(ocr_slimFullSearchMap_maxPixels, img.getBufferedImage()));
    //print("Shrunk image to " + img2.getWidth() + "*" + img2.getHeight());
    S md5 = map.get(img);
    map.remove(img);
    map.put(img2, md5);
  }
  ret map;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015442
Snippet name: ocr_slimFullSearchMap
Eternal ID of this version: #1015442/7
Text MD5: 2149468817b61ef6a419d070987cd9cc
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-15 00:47:58
Source code size: 599 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 357 / 377
Version history: 6 change(s)
Referenced in: [show references]