robotframework-imagehorizonlibrary icon indicating copy to clipboard operation
robotframework-imagehorizonlibrary copied to clipboard

New feature: image detection strategy "edge"

Open simonmeggle opened this issue 3 years ago • 10 comments

Hi, with this pull request I want to share the work of my valued colleague @gautamilango and me.

It introduces another strategy edgeto detect images in situations when too much pixels are different and further loweringconfidence would lead to false (or no) results.

The key here is to pre-process both images (reference image and screenshot) with canny edge detection (https://scikit-image.org/).

This reduces the images to the most relevant parts before they are compared.

It makes image detection extremely rebust against

  • inpredictable colour nuances (example: "hover"-colors for buttons)
  • compression artifacts (e.g. when testing over RDP/Citrix, which compress screen information depending on the available bandwidth)
  • pixel deviations of dynamic image sources (e.g. map from 3rd party providers)
  • ...

Debug Image is a helper keyword and starts a UI (written by Gautam) which gives worthful insights about

  • the best strategy (default oder edge),
  • its parameters (confidence, egde detection params),
  • the number of matches (unknown so far)
  • the match score of the best match (also unknown, done with try&error).

image

There is also a detailled debugger. It shows the edge detection results in oder to fine-tune the parameters.

image

We are already using the edge strategy successfully in production (synthetic e2e monitoring with Checkmk/Robotmk) and it works pretty well.

To make this strategy as integrated as possible, we have put a lot of effort into this, without breaking any existing functionality.

Thanks to ABRAXAS Informatik AG in Switzerland, which spent the ressources to make this possible at all! 👍

That's all for now - we are looking forward to hearing from you. Any suggestion is highly appreciated! :-)

Best regards, Simon (simon.meggle at elabit.de)

PS: See also https://blog.robotmk.org/

simonmeggle avatar Feb 24 '22 12:02 simonmeggle

Hi @simonmeggle,

This on the first glance seems an awesome addtition to the library!

I need to check this thoroughly which I haven't had time yet. I hope to check this in the coming weeks.

Tattoo avatar Feb 25 '22 18:02 Tattoo

Hi Tattoo, glad to hear that you find this useful. I understand that this is a big commit which needs to be carefully reviewed. Take your time, I can provide you any assistance you need!

simonmeggle avatar Feb 25 '22 18:02 simonmeggle

Hi Tattoo, I just want to ask if I can be of any help? Regards, Simon

simonmeggle avatar Mar 31 '22 06:03 simonmeggle

It would be awesome to have the edge strategy included in the imagehorzizonlibrary to avoid the problems of compression artifacts while trying to test through RDP environments.

kleinski avatar May 10 '22 15:05 kleinski

I I am already looking for such a feature, as I often struggle with (nested) remote desktop connections.

PhilippLemke avatar May 18 '22 06:05 PhilippLemke

This function is very good~ I look forward to its appearance

a9038889 avatar Jun 14 '22 08:06 a9038889

I also took a look at @simonmeggle new features to the Library. We could really improve our testcases and developing process with the implemented debugger and the edge detection. Definitely looking forward to use them as a Component of the ImageHorizonLibrary in the future.

maxiking203 avatar Jun 20 '22 16:06 maxiking203

This would be very useful in our environment. Hope it gets implemented soon.

roland-gsell avatar Jul 18 '22 07:07 roland-gsell

Happy new year! Is there already a timeline to implement this. This function would be very helpful for my use cases. Many thanks.

7meis avatar Jan 05 '23 16:01 7meis

Is there already a timeline to implement this.

It will be implemented soon, but obviously not in this library (the pr still hangs, no one has ever reviewed it).

simonmeggle avatar Jan 06 '23 06:01 simonmeggle