Issues matching screenshots between 2 computers.

73 views
Skip to first unread message

JB

unread,
Oct 4, 2017, 1:10:23 PM10/4/17
to stb-tester
Hi guys,

Its my first time posting here. 

I'm having problems with matching screenshots between two PC's.

I'm using one machine to write and capture images for multiple test specs. While the other older PC is used by another tester to run my automation scripts.

The capture card in my machine is a Black Magic Design intensity Pro 4K while the other PC is using an old intensity Pro.

When my tests are run on the older PC, it can never seem to match any of the images that I created. When new images are captured from the older PC they appear to work.

Would the older capture card be causing these discrepancies? 

I've also seen one instance of the older machine not matching static images that were captured form the very same machine.


Any help would be appreciated. 

Thanks.  








.






 

David Röthlisberger

unread,
Oct 5, 2017, 4:21:19 AM10/5/17
to JB, stb-t...@googlegroups.com
Hi JB

I don't know about the capture quality from Black Magic cards but are you at least capturing at the same resolution on both PCs?

Also check your match parameters -- see https://github.com/stb-tester/stb-tester/pull/434

If you need to debug matching issues see https://stb-tester.com/tutorials/looking-for-inexact-matches

Kind regards,

David Röthlisberger
Stb-tester.com Ltd.

--
Stb-tester.com Ltd is a company registered in England and Wales.
Registered number: 08800454. Registered office: 33b Aliwal Road,
Battersea, London, SW11 1RB.
--
You received this message because you are subscribed to the Google Groups "stb-tester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stb-tester+...@googlegroups.com.
To post to this group, send email to stb-t...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JB

unread,
Oct 5, 2017, 9:48:07 AM10/5/17
to stb-tester
Hi David, 

Thanks for the reply, it was really helpful.

After a bit of investigation I noticed that using the "stbt.wait_for_match" expression was causing the problem. 

I quickly edited my tests to use "stbt.match" and noticed that every single image referenced in my test scrip matched when run.

Would you know why this would be happening? 

I can't seem to find where the parameters are for the wait_for_match expression. 

Thanks again for the help.

Regards,
John. 

Lewis Haley

unread,
Oct 6, 2017, 4:40:02 AM10/6/17
to stb-tester
It would be useful to post the debug logs of the two runs (stbt run -v) to see the `MatchResults` coming out of both `wait_for_match` and `match`.

JB

unread,
Oct 6, 2017, 8:13:50 AM10/6/17
to stb-tester
I've attached some debug. One with the match expression and the other using wait for match. 
match debug.txt
wait for match debug.txt

Lewis Haley

unread,
Oct 6, 2017, 11:05:00 AM10/6/17
to stb-tester
Both logs show the exception coming from `wait_for_match`? Also the template being looked for in `wait for match debug.txt` is not present in `match debug.txt`.

JB

unread,
Oct 10, 2017, 8:51:09 AM10/10/17
to stb-tester
Hi Lewis, 

Sorry I mistakenly attached the wrong files. 

I've attached new ones. 
stbt-match.txt
stbt-wait-for-match.txt

Lewis Haley

unread,
Oct 10, 2017, 10:19:49 AM10/10/17
to stb-tester
The `stbt.match` version *doesn't* find the match

stbt-run: No match found. Closest match: MatchResult(time=1507637459.6844716, match=False, region=Region(x=0, y=0, right=611, bottom=720), first_pass_result=0.0, frame=<1280x720x3>, image='Search_Menu.png')

The important bit is "match=False". The reason the test gets to the end is that `stbt.match`:
- only compares the template to one frame from the video
- doesn't raise an exception if the match is not found.

If you prefix your `stbt.match` line with `assert`, you'll see that that version fails as well.

As for the original problem of why the match works on one PC but not on the other, you can
use the `stbt match -v` commandline tool which will produce an HTML page of debug images
for each stage of the match algorithm. You might even be able to see the difference by manually
inspecting screenshots from each of the PCs.

JB

unread,
Oct 12, 2017, 4:44:20 AM10/12/17
to stb-tester
Hi Lewis,

Thanks again for the reply. I placed an assert before stbt.match and you were right, it failed.

I have run stbt match -v and I have noticed that text and icons do not match the positions in the screenshots. These differences are hard to see when comparing whats on screen to the image I am referencing.

The confusing part is that these screenshots were captured on my machine and they all match when they are run but when I copy and place them on the second machine the images can't be matched.



Lewis Haley

unread,
Oct 13, 2017, 8:56:33 AM10/13/17
to stb-tester
Have modified the match parameters in stbt.conf on one machine but not the other?

JB

unread,
Oct 17, 2017, 10:31:54 AM10/17/17
to stb-tester
Hi Lewis,

They are both exactly the same, line for line. 

Lewis Haley

unread,
Oct 18, 2017, 6:02:37 AM10/18/17
to stb-tester
Are both PCs using the same version of OpenCV?
Reply all
Reply to author
Forward
0 new messages