Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Conversation

khaong
Copy link
Contributor

@khaong khaong commented Jan 5, 2021

Hi,

For my appium use case, there may be multiple places on the screen which has the same image and I'd like to find them all.

I am not a javascript dev by trade, so would definitely welcome any comments on this!

Thanks

Alex

@khaong khaong changed the title Implement multiple image detection feat: implement multiple image detection Jan 5, 2021
khaong added 2 commits January 6, 2021 11:13
Performance enhancement - use Mat.at() instead of unnecessary array conversion
@mykola-mokhnach
Copy link
Contributor

mykola-mokhnach commented Jan 6, 2021

Could you please attach a visualized example with multiple matches highlighted?

feat: Add match_neighbour_threshold as option
refactor: make nonzero match loop more succinct
@khaong
Copy link
Contributor Author

khaong commented Jan 6, 2021

Reply: #212 (comment)

I've got a local spec to generate the images

all:
full-highlights

individual:
highlight-0
highlight-1
highlight-2

fix: return all matches visualisation at the top level; multiple is now just an array of occurrences
refactor: filterNearMatches to a more elegant reduce function
* on the full image
* @property {?Buffer} visualization The visualization of the matching result
* represented as PNG image buffer. On this image the matching
* region is highlighted with a rectangle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should mention that this is going to have all matches highlighted when multiple is enabled

@mykola-mokhnach mykola-mokhnach merged commit 49e4ae2 into appium:master Jan 10, 2021
@mykola-mokhnach
Copy link
Contributor

Thanks @khaong , this was a long journey.

Please don't forget to update https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md after the whole implementation is completed

@mykola-mokhnach
Copy link
Contributor

Published in 2.50.0

@khaong
Copy link
Contributor Author

khaong commented Jan 10, 2021

Thank you @mykola-mokhnach for your guidance and your patience with me! I have learnt a lot through the process 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants