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
[Question] Ability to recognize on scaling? #135
Comments
Image search is carried out over multiple scales, so nut.js is able to cope with changes in resolution automatically. |
@s1hofmann afaik currently search is performed on array of scaled images at
another option would be using feature points and ORB descriptors instead of comparing each pixel from (potentially scaled) template, this is currently not implemented but might be a good addition |
@sidorares Correct, current search uses a cascade of scaled images. A while ago I started some experiments using feature descriptors + sliding windows, but never finished it. Would be interesting to see a comparison in terms of accuracy and performance, though. EDIT: As a sidenote, the prebuilt package of OpenCV currently used by nut.js does not include any features2d package, all my experiments have been carried out with a custom build of opencv4nodejs |
on a big template on my examples feature descriptors performance was much better but for good accuracy you'd need to do pixel image matching / diffing once again after points transform matrix is calculated |
actually i did tried with multiple resolution but it was not detecting the save button. its chrome print button in darkmode osx. Example. both image looks nearly same but when i try it doesn't work till it matches same size of chrome window from where i took screenshot Is it due to 99% confidence required ( Sorry i have no idea how opencv works) |
99% seems like a way too accurate for your example. Also note that border image is different ( 100% of template pixels contribute to match score ) |
@shirshak55 try to use just inner part of a button without a border as a template: |
it only compares short number of scale steps ( Try to set match accuracy to some low value ( 50% ? ) and check what is lowest one you still have correct find |
@shirshak55 Which version of nut.js are you using? As a side note to the described matching problems: |
@s1hofmann yep keyboard input would be great if there was a good way to switch to browser automatically because i execute script from terminal? browser resizing scales will definitely not be one of these I don't know what is best way to accomplish it but i just want to do this. I think i should look on how robotjs works internally which might give idea of switching to chrome automatically. |
In case you want to perform both browser and desktop automation, you might want to take a look at Sakuli, which combines both browser automation and desktop automation in a single framework. I do have plans on functionality for working with other processes / applications, but nothing is implemented so far. |
Sometime resolution changes (Like adjusting browser) but still structure usually remain same so big button can become small button. For small difference it shouldn't matter too much right?
Is there anyway we can get finder to work so small changes don't matter. so we can
So sometime lets say u are searching printButton.png in browser but the size has changed slightly . Is there easy way to find location?
Thanks
The text was updated successfully, but these errors were encountered: