python - Template matching results when the template is not on the original image -


for testing purposes i'm building bot clicks on buttons in screen. have folder possible buttons needs pressed , application being tested has 1 button shown @ time. there no situations 2 or more buttons appear on screen.

my approach take screenshot every few seconds , loop through possible buttons , try find them on screenshot. if button found bot clicks center of button.

my issue if button not present on screenshot template algorithm i'm using returns false positive somewhere in screen. there way make sure no false positives returned unless button exists on image?

i'm using python numpy , skimage. template matching i'm using skimage.feature.match_template.

i tried opencv using sift , things not success , lot of issues opencv itself.

p.s.: if think there better way solve problem (testing app pressing buttons) welcome too.

cheers

edit 1:

these images:

screenshot button

edit 2:

the output of script (false positive) enter image description here

as realised later on, way make sure detected image indeed 1 searching compute difference between detected 1 , template , use threshold allow imperfections.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -