From 67c5ab0abea1bc5aa0cd3415151954fe01155f0d Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Wed, 3 Jul 2019 10:43:02 +1000 Subject: [PATCH] annotations: fix center calculation for polygons --- imagetagger/imagetagger/annotations/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagetagger/imagetagger/annotations/models.py b/imagetagger/imagetagger/annotations/models.py index d1b2421c..20ae86a9 100644 --- a/imagetagger/imagetagger/annotations/models.py +++ b/imagetagger/imagetagger/annotations/models.py @@ -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']