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

Add OpenCV Confidence level #43

Merged
merged 13 commits into from
Apr 15, 2020
Merged

Conversation

JonKoser
Copy link
Contributor

@JonKoser JonKoser commented Apr 8, 2020

Adds in a Set Confidence keyword. This confidence level is used internally when the library locates images on screen. Only applies when OpenCV is installed and can be turned off.

@matejc
Copy link
Contributor

matejc commented Apr 15, 2020

Thank you for the pull request!

@matejc matejc merged commit 04d3ebd into eficode:master Apr 15, 2020
@matejc
Copy link
Contributor

matejc commented Apr 15, 2020

@JonKoser
Just one question, why did you decided to not to implement it also on per keyword basis? Like you did on the start, but then you removed it, why?
Example:

    ${loc}=  Wait For  image.png  confidence=0.5

@JonKoser
Copy link
Contributor Author

@matejc That's actually a pretty good question, haha. It's been a while since I did that; I kind of wondered the thing when I created the pull request. After playing with it again though, I'm pretty sure my reason was because I found that if I had to set the confidence to something for one keyword, I was usually setting it to the same value on all subsequent keywords in the same script. So, instead of having the confidence set to something on every keyword, I went for the global solution.

That being said, it really wouldn't hurt to have it implemented on a per keyword basis either. I did the global setting of it because it was better for my usecase at the time, but I can totally see how having it per keyword would also be really handy. Now that it's already in there, it should be a little easier to to do that, too.

matejc pushed a commit that referenced this pull request May 4, 2020
* Updated _recognize_images to use confidence

* updated gitignore

* Making confidence part of initialization

* Default confidence

* Added set confidence keyword

* Tests and bounds checkijng

* Had error

* Allow for not using confidence at all

* Unit test for confidence

* warning message if a user sets confidence but doesn't have opencv

* Added test for not having OpenCV

Co-authored-by: Jon Koser <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants