Skip to content

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