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

runelite_cv.py -> extract_objects() deduplication #177

Open
Tyrannosaurus1234 opened this issue Aug 8, 2023 · 0 comments
Open

runelite_cv.py -> extract_objects() deduplication #177

Tyrannosaurus1234 opened this issue Aug 8, 2023 · 0 comments

Comments

@Tyrannosaurus1234
Copy link

Is your feature request related to a problem? Please describe.
In my using of this function, I've encountered the problem of it detecting a single RuneLiteObject as being multiple, i.e. it spits out a List with duplicates in it.

Describe the solution you'd like
deduplication.

Describe alternatives you've considered
In my local copy I've patched the function like so:
before creating the RuneLiteObject and added it to the List objs, I run a check comparing its euclidean distance (np.linalg.norm is very fast) between centers to every other RLO in objs currently. If it's less than 10 pixels, I chuck it instead of appending.

My setup is a bit different to yours, I just snagged this function, so this isn't a direct drag-and-drop patch, but here's the code I have in my local copy to explain the idea. This has totally eradicated my duplicate problem.

if len([o for o in objs if o.distanceToPoint(Point(center[0],center[1])) < 10]) == 0:
    objs.append(RuneLiteObject(x_min, x_max, y_min, y_max, width, height, center, axis, self.client))
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

No branches or pull requests

1 participant