Skip to content

Commit

Permalink
Update docs for OCR implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
clanig committed May 30, 2023
1 parent abb46b7 commit 0f737df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
3 changes: 1 addition & 2 deletions docs/Contributing.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ Installation Guide.
In the case of os-autoinst, only a few http://www.cpan.org/[CPAN] modules are
required. Basically `Carp::Always`, `Data::Dump`. `JSON` and `YAML`. On the other
hand, several external tools are needed including
http://wiki.qemu.org/Main_Page[QEMU],
https://code.google.com/p/tesseract-ocr/[Tesseract] and
http://wiki.qemu.org/Main_Page[QEMU] and
http://optipng.sourceforge.net/[OptiPNG]. Last but not least, the
http://opencv.org/[OpenCV] library is the core of the openQA image matching
mechanism, so it must be available on the system.
Expand Down
23 changes: 12 additions & 11 deletions docs/GettingStarted.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ information and results (if any) are kept for future reference.

One of the main mechanisms for openQA to know the state of the virtual machine
is checking the presence of some elements in the machine's 'screen'.
This is performed using fuzzy image matching between the screen and the so
called 'needles'. A needle specifies both the elements to search for and a
This is performed matching a reference (so called 'needles') with the 'screen'.
A needle specifies both the elements to search for and a
list of tags used to decide which needles should be used at any moment.

A needle consists of a full screenshot in PNG format and a json file with
the same name (e.g. foo.png and foo.json) containing the associated data, like
which areas inside the full screenshot are relevant or the mentioned list of
tags.
A needle consists of at least a JSON file and, optionally, a full screenshot
in PNG format with the same name (e.g. foo.png and foo.json). The JSON file
contains the associated data, like which areas inside the full screenshot are
relevant and the mentioned list of tags.

[source,json]
-------------------------------------------------------------------
Expand All @@ -212,7 +212,8 @@ tags.
"width" : INTEGER,
"height" : INTEGER,
"type" : ( "match" | "ocr" | "exclude" ),
"match" : INTEGER, // 0-100. similarity percentage
"match" : INTEGER, // 0-100. similarity percentage,
"refstr": STRING,
},
...
],
Expand All @@ -229,11 +230,11 @@ There are three kinds of areas:
with at least the specified similarity percentage. Regular areas are
displayed as green boxes in the needle editor and as green or red frames
in the needle view (green for matching areas, red for non-matching ones).
* *OCR areas* also define relevant parts of the screenshot. However, an OCR
algorithm is used for matching. In the needle editor OCR areas are
* *OCR areas* also define relevant parts of the screenshot. They are
converted to text in order to be matched on an OCR reference text. The
reference text is stored in the needle. In the needle editor OCR areas are
displayed as orange boxes. To turn a regular area into an OCR area within
the needle editor, double click the concerning area twice. Note that such
needles are only rarely used.
the needle editor, double click the concerning area twice.
* *Exclude areas* can be used to ignore parts of the reference picture.
In the needle editor exclude areas are displayed as red boxes. To turn a
regular area into an exclude area within the needle editor, double click
Expand Down

0 comments on commit 0f737df

Please sign in to comment.