Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Region.find_all(Image(...)) with contour finder returns negative Y #50

Open
jirutka opened this issue Oct 15, 2023 · 2 comments
Open

Region.find_all(Image(...)) with contour finder returns negative Y #50

jirutka opened this issue Oct 15, 2023 · 2 comments
Assignees

Comments

@jirutka
Copy link

jirutka commented Oct 15, 2023

GlobalConfig.display_control_backend = 'vncdotool'
GlobalConfig.find_backend = 'contour'

guibot = GuiBot()

for match in guibot.find_all(Image('button-contour.png')):
   print(match.target)
(524.0, -363.0)
(624.0, -328.0)
(1493.0, -605.0)

Generated match file:

# IMAGE MATCH DATA
[type]
backend = cv

[find]
backend = contour
similarity = <value='0.8' min='0.0' max='1.0' delta='10.0' tolerance='1.0' fixed='True' enumerated='False'>

[contour]
backend = mixed
retrievalMode = <value='2' min='1' max='4' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>
approxMethod = <value='2' min='1' max='4' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>
minArea = <value='0' min='0' max='None' delta='100.0' tolerance='1.0' fixed='True' enumerated='False'>
contoursMatch = <value='1' min='1' max='3' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>

[threshold]
backend = adaptive
blurType = <value='4' min='1' max='4' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>
blurKernelSize = <value='5' min='1' max='None' delta='100.0' tolerance='1.0' fixed='True' enumerated='False'>
blurKernelSigma = <value='0' min='0' max='None' delta='100.0' tolerance='1.0' fixed='True' enumerated='False'>
thresholdMax = <value='255' min='0' max='255' delta='20.0' tolerance='1.0' fixed='True' enumerated='False'>
adaptiveMethod = <value='1' min='0' max='1' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>
thresholdType = <value='1' min='0' max='1' delta='10.0' tolerance='1.0' fixed='True' enumerated='True'>
blockSize = <value='11' min='3' max='None' delta='200.0' tolerance='2.0' fixed='True' enumerated='False'>
constant = <value='2' min='-255' max='255' delta='1.0' tolerance='1.0' fixed='True' enumerated='False'>

Am I doing something wrong or is it a bug?

@pevogam
Copy link
Member

pevogam commented Oct 17, 2023

Hi @jirutka, I think part of your reproducer is missing here. In particular VNCDoTool requires additional setup like VNC ports and such. Would you mind sharing the complete code so that I can try to reproduce your case? Also have you taken a look at the VNCDoTool version we support (in the pip requirements) and try exactly that one? This is also the version we test with and use in production.

@pevogam pevogam self-assigned this Oct 17, 2023
@pevogam
Copy link
Member

pevogam commented Oct 17, 2023

One more thing, could you try to run the test_contour_same and test_contour_nomatch unit tests in your environment? Do these tests pass or do they reveal something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants