Repository navigation
[utils] Return the corners of bbox_to_polygon in order around the box - #2188
Merged
felixdittrich92 merged 2 commits intoOct 30, 2026
Merged
Conversation
felixdittrich92
requested changes
Oct 29, 2026
felixdittrich92
left a comment
Collaborator
There was a problem hiding this comment.
Hi @RavSinghChandan thanks for the PR 👍
One small update afterwards can be merged
felixdittrich92
approved these changes
Oct 29, 2026
Contributor
Author
|
Thanks! Updated the input polygon to the same corner order (top left, top right, bottom right, bottom left). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bbox_to_polygon(((0, 0), (1, 1)))returned((0, 0), (1, 0), (0, 1), (1, 1)): top left, top right, bottom left, bottom right. Read as a polygon, those corners cross over each other, socv2.contourAreaof the converted 10x10 box is 0 instead of 100, and drawing it gives a bow tie.It now returns top left, top right, bottom right, bottom left, the order the dataset loaders use for their polygons. Nothing inside doctr calls it, and
polygon_to_bboxtakes the min/max, so a round trip gives the same box as before