Skip to content

Commit

Permalink
Merge pull request #116 from bit-bots/polygons_center
Browse files Browse the repository at this point in the history
annotations: fix center calculation for polygons
  • Loading branch information
timonegk authored Jul 3, 2019
2 parents e483d17 + 67c5ab0 commit 216ac5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imagetagger/imagetagger/annotations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def center(self):
AnnotationType.VECTOR_TYPE.BOUNDING_BOX,
AnnotationType.VECTOR_TYPE.LINE,
AnnotationType.VECTOR_TYPE.POLYGON):
yc = self.vector['y1'] + (self.height / 2)
xc = self.vector['x1'] + (self.width / 2)
yc = self.min_y + (self.height / 2)
xc = self.min_x + (self.width / 2)
elif self.annotation_type.vector_type is AnnotationType.VECTOR_TYPE.POINT:
yc = self.vector['y1']
xc = self.vector['x1']
Expand Down

0 comments on commit 216ac5e

Please sign in to comment.