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

35
LINES

< > BotCompany Repo | #1015266 // Recognize text on current screen - old

JavaX source code (desktop) [tags: archive use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (12763L/94K).

1  
!7
2  
3  
!include once #1015415 // GrabbedImage
4  
5  
static BufferedImage img;
6  
static L<RecognizedText> texts;
7  
static ImageSurface is;
8  
static ReliableSingleThread rst;
9  
10  
p-subst-autorestart {
11  
  doIt();
12  
  showButton("Again", r-thread { doIt() });
13  
}
14  
15  
svoid doIt {
16  
  if (rst != null) rst.cancel();
17  
  disposeWindow(is);
18  
  is = null;
19  
  print("Shooting");
20  
  img = shootScreenHidingConsole();
21  
  print("Recognizing");
22  
  texts = ocr_recognizeMultiLine_scored(img);
23  
  is = showImageWithRecognizedTexts(img, null, texts);
24  
  rst = new ReliableSingleThread(f reRecognize);
25  
  showImageWithRecognizedTexts_makeTeachable2(img, is, texts,
26  
    filledSimpleRecognizer_cached(), r { rst.trigger() });
27  
}
28  
29  
svoid reRecognize {
30  
  print("Re-recognizing...");
31  
  temp tempDisposeWindow(smallLoadingAnim());
32  
  replaceCollection(texts, ocr_recognizeMultiLine_scored(img));
33  
  is.repaint();
34  
  print("Done");
35  
}

Author comment

Began life as a copy of #1006334

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, onxytkatvevr, tvejysmllsmz

No comments. add comment

Snippet ID: #1015266
Snippet name: Recognize text on current screen - old
Eternal ID of this version: #1015266/20
Text MD5: dde2661afaa4c961a038bfe59e3feaf8
Transpilation MD5: 0d8ebd3bc5541df2b01cc1bf7b529928
Author: stefan
Category: javax / ocr
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): Yes
Created/modified: 2018-05-23 12:38:56
Source code size: 902 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 459 / 1342
Version history: 19 change(s)
Referenced in: [show references]