Skip to content

Commit

Permalink
annotations: fix center calculation for polygons
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Jul 3, 2019
1 parent e483d17 commit 67c5ab0
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 67c5ab0

Please sign in to comment.