在 Google Cloud Vision 中将规范化顶点转换为顶点

Converting Normalized Vertex to Vertex in Google Cloud Vision

知道如何将规范化顶点转换为顶点吗? Normalized Vertex 给出图像上的相对位置,而 Vertex returns 坐标基于图像的比例。我有一组规范化顶点,我想将其转换为常规顶点。

https://cloud.google.com/vision/docs/reference/rest/v1p2beta1/images/annotate#normalizedvertex

如果您知道图像的大小(宽度和高度),您可以简单地将它与 NorrmalizedVertex 相乘。 您应该将 NormalizedVertex 的 x 字段乘以图片的宽度以获得 Vertex 的 x 字段,并将 NormalizedVertex 的 y 字段乘以图像的高度以获得 Vertex 的 y。