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

Check how much of a specific area has been scratched #24

Closed
rubenaster opened this issue Mar 5, 2021 · 3 comments
Closed

Check how much of a specific area has been scratched #24

rubenaster opened this issue Mar 5, 2021 · 3 comments
Labels
question Further information is requested

Comments

@rubenaster
Copy link

Hey Kamil,

so far I can tell that your package is exactly what I've been looking for and it works great! Thank you so much!

Now I'm using this package to create a test for users that need to scratch free a picture above a picture. So far so good. But I need to check afterwards how much of a specific rectangular area on that picture a user has scratched free.

See this image for example: https://www.wiso.uni-hamburg.de/10054699/scraching1-7410709a6d0ee7f6066922f31886f2fc7ed065c1.png

All five displays would be a different Scratcher and I need to determine how much of those grey areas on those displays have been scratched free.

So it's like your current threshold but for several, rectangular areas instead of the full image. But it feels like that would need a completely different way of calculating those progress.

Do you have any ideas or suggestions?

@vintage
Copy link
Owner

vintage commented Mar 9, 2021

Hey @rubenaster

I didn't get it. The use case is too broad, mind to scope it to the simplest possible scenario?

@vintage vintage added the question Further information is requested label Mar 9, 2021
@rubenaster
Copy link
Author

Hey @vintage,

thanks for the response! I already posted the question more detailed on StackOverflow but unfortunately didn't get any feedback:
https://stackoverflow.com/questions/66504210/calculate-how-much-of-a-rectangular-area-is-covered-by-a-list-of-circles

I think I'll solve this problem using one of the following options:

  • Check every pixel of a rectangle if it's being covered by any circles/checkpoints
  • Render an image of the drawn path and compare it's pixels

Anyways, I'm to dumb for some cool calculations so I'll have to solve it programmatically :)

@vintage
Copy link
Owner

vintage commented Mar 10, 2021

Well, each separate scratcher knows the percentage of scratched area in own bounds. So if I would have 3 scratchers of the same size: ScratcherA, ScratcherB, ScratcherC where:

  • ScratcherA has 30% scratched
  • ScratcherB has 60% scratched
  • ScratcherC has 90% scratched

Then total scratch area is simply (0.3 + 0.6 + 0.9) / 3 = 60%. Where's the catch?

Check every pixel of a rectangle if it's being covered by any circles/checkpoints - that's the pattern used in the lib itself ;)

@vintage vintage closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants