From d21a008de446e2bae4453059647fbc24c17a8cfa Mon Sep 17 00:00:00 2001 From: Sam Nosenzo Date: Tue, 21 May 2024 18:31:18 +0200 Subject: [PATCH] Update image annotations to specify origin and coordinate space of position --- schemas/typescript/CircleAnnotation.ts | 5 ++++- schemas/typescript/PointsAnnotation.ts | 5 ++++- schemas/typescript/TextAnnotation.ts | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/schemas/typescript/CircleAnnotation.ts b/schemas/typescript/CircleAnnotation.ts index 128c996..481b5e9 100644 --- a/schemas/typescript/CircleAnnotation.ts +++ b/schemas/typescript/CircleAnnotation.ts @@ -10,7 +10,10 @@ export type CircleAnnotation = { /** Timestamp of circle */ timestamp: Time; - /** Center of the circle in 2D image coordinates (pixels) */ + /** Center of the circle in 2D image coordinates (pixels) + * The coordinate uses the top-left corner of the image as the origin. + * It is not centered on the pixel, but on the top-left corner of the pixel. + */ position: Point2; /** Circle diameter in pixels */ diff --git a/schemas/typescript/PointsAnnotation.ts b/schemas/typescript/PointsAnnotation.ts index 03fa1d7..75eb974 100644 --- a/schemas/typescript/PointsAnnotation.ts +++ b/schemas/typescript/PointsAnnotation.ts @@ -14,7 +14,10 @@ export type PointsAnnotation = { /** Type of points annotation to draw */ type: PointsAnnotationType; - /** Points in 2D image coordinates (pixels) */ + /** Points in 2D image coordinates (pixels) + * The coordinate uses the top-left corner of the image as the origin. + * It is not centered on the pixel, but on the top-left corner of the pixel. + */ points: Point2[]; /** Outline color */ diff --git a/schemas/typescript/TextAnnotation.ts b/schemas/typescript/TextAnnotation.ts index d5dc6bd..cb665e6 100644 --- a/schemas/typescript/TextAnnotation.ts +++ b/schemas/typescript/TextAnnotation.ts @@ -10,7 +10,10 @@ export type TextAnnotation = { /** Timestamp of annotation */ timestamp: Time; - /** Bottom-left origin of the text label in 2D image coordinates (pixels) */ + /** Bottom-left origin of the text label in 2D image coordinates (pixels) + * The coordinate uses the top-left corner of the image as the origin. + * It is not centered on the pixel, but on the top-left corner of the pixel. + */ position: Point2; /** Text to display */