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

getAnnIds: areaRng not inclusive of limits #568

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ashnair1
Copy link

If you were to query annotations within a particular area range, via the getAnnIds function, it ignores those objects that have areas equal to the limits.

For example,

# Assuming objects areas only lie between 10^2 and 1e5^2 pixels

areaRng = [10,32,64,96]

small    = len(ann.getAnnIds(areaRng=[(areaRng[0]**2) , areaRng[1]**2]))
medium   = len(ann.getAnnIds(areaRng=[(areaRng[1]**2) , areaRng[2]**2]))
large    = len(ann.getAnnIds(areaRng=[(areaRng[2]**2) , areaRng[3]**2]))
total = len(ann.getAnnIds(areaRng=[(areaRng[0]**2), (areaRng[3]**2)]))

assert total = small + medium + large

The assertion would fail if there are objects that have area exactly equal to 10^2, 32^2, 64^2 or 96 ^2 pixels.

@ashnair1
Copy link
Author

Pinging @tylin

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

Successfully merging this pull request may close these issues.

1 participant