Bug 542481 - An OCRHelper class to read widget text
Summary: An OCRHelper class to read widget text
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2018-12-06 13:12 EST by Mickael Istria CLA
Modified: 2019-02-12 13:59 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2018-12-06 13:12:41 EST
The Test harness should provide an OCRHelper method that would delegate to software like `tesseract` to read the screen content. That would make it very handy to test some cases of rendering like code minings.
Command I tried successfully is `tesseract /path/to/screenshot.png stdout -psm 6` for a text editor; we can replace the path/to/screenshot by stdin and send the image of the widget to stdin stream.
Usage could look like
```
styledText.setText("class A {}");
assertEquals("0 references\nclass A {}", OCRHelper.read(styledText))
```
Comment 1 Alexander Kurtakov CLA 2019-02-12 13:59:28 EST
Remove target.