Complete support for exclude areas in needles
As a test writer I want to mark areas to exclude on match so that I do not need to be super creative with needling around parts I want to ignore.
- AC1: exclude areas are shown in needle views
- AC2: exclude areas are taken over in needle editor
- needle exclude areas are neither displayed in needle views nor taken over in editor, fix that
- add tests
- add documentation
- optional: find the other hidden spots where exclude areas are not properly supported
the backend supports exclude areas near even and they work just fine but they are neither shown in the needle preview nor taken over
#6 Updated by StefanBruens about 5 years ago
As a side note, the excludes are currently wrong from a algorithm perspective:
The excluded area is overdrawn with a fill color in both the needle and on the screen.
As long as the needle matches at its original location, this works as intended (although
the MSE/similarity value is biased, as the mean value is calculated for the whole area,
not the relevant area).
If the needle is shifted, excluded areas in the scene and the needle no longer line up, and
the result is wrong.
Currently, the tests having exclude areas only match the needle in the original
location, so this misbehaviour is not detected.
Fixing this is actually not to hard:
As the error metric is the (mean of) squared difference, which is linear, first the error
for the whole needle area has to be calculated (which typically gives us a 101x101 size
error matrix), next the same has to be done for every excluded area of the needle (each
resulting in another 101x101 size error matrix). The correct error matrix can be calculated
by subtracting the latter ones from the first matrix, the minimum is the best match as before.
#9 Updated by mkittler almost 5 years ago
- Status changed from In Progress to Resolved
Seems to be working in production: https://github.com/os-autoinst/openQA/pull/1377#issuecomment-313605061
(The PR caused an regression, but it is tracked in another ticket so I mark this one as resolved.)