如何使用Google的Face API检测角/中心X,Y坐标? [英] How to detect the Corners / Center X, Y Coordinates Using Google's Face API?

查看:145
本文介绍了如何使用Google的Face API检测角/中心X,Y坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在使用Google的新Face API(链接此处),该功能与改进的FaceDetection一起使用。您得到的一件事是Landmark对象列表,每个对象都有一个X和Y坐标要使用。

Good day all, I am using Google's new Face API (Link here) which works with improved FaceDetection. One of the things you get back is a List of Landmark objects, each of which has an X and Y coordinate to use.

利用这些坐标,我试图找出图片的中心,但要弄清楚正确的数字却很困难。

With these coordinates, I am trying to figure out the center of the picture, but figuring out the correct numbers is proving difficult.

这是我到目前为止所知道的:

Here is what I know so far:

1)不同于以前的方式,它不再是1000、1000 x -1000,-1000

1) Unlike in the old ways, it is no longer 1000, 1000 by -1000, -1000

2) 返回的坐标为浮点格式,为。 ..界标的(x,y)位置,其中(0,0)是图像的左上角。保证该点在图像的边界内。 (来源

2) The coordinates that are returned are in float format and are, "...the (x, y) position of the landmark where (0, 0) is the upper-left corner of the image. The point is guaranteed to be within the bounds of the image." (Source)

3)当我在日志中打印出这些坐标时,我得到的数字似乎与以像素为单位的屏幕尺寸不匹配(1440w,2368h) 。我打印出来的职位的一些例子是:

3) When I print out those coordinates in the log, I get numbers that don't seem to match my screen size in pixels (1440w,2368h). Some examples of the positions I am getting when I print them out are:


  • 464.90558,1112.7573

  • -19.159714,218.88104

  • 28.383072,196.1712

  • -130.06908,1071.8779

  • 464.90558,1112.7573
  • -19.159714,218.88104
  • 28.383072,196.1712
  • -130.06908,1071.8779

这毫无意义,因为如果左上角为(0,0),我不知道坐标如何为负。

Which makes no sense since I don't understand how coordinates can be negative if the top left is (0,0).

所以问题是,如何确定这些坐标?是关于屏幕尺寸的吗?是否正在使用DP以某种方式进行转换?

So the question is, How are these coordinates being determined? Is it with respect to the size of the screen somehow? Are they being converted using DP in some way? Do they have a static cap?

谢谢,

PGMac

推荐答案

坐标是图像的像素坐标。

Coordinates are pixel coordinates of the image.

如果脸部超出了范围,这些坐标可以为负。图像的顶部和/或左侧。即使头部可能不完全在照片中,面部检测器也会根据可见的图像来估计超出图像范围的面部边界框。

These coordinates can be negative if the face extends beyond the top and/or the left edges of the image. Even though the head may not be entirely within the photo, the face detector will estimate the bounding box of the face beyond the image bounds based upon what is visible.

这篇关于如何使用Google的Face API检测角/中心X,Y坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆