title: How to detect the Corners / Center X, Y Coordinates Using Google's Face API?
body: <p>Good day all, I am using Google's new Face API (<a href="https://developers.google.com/android/reference/com/google/android/gms/vision/face/Face" rel="nofollow noreferrer">Link here</a>) 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. </p>
  
  <p>With these coordinates, I am trying to figure out the center of the picture, but figuring out the correct numbers is proving difficult. </p>
  
  <p>Here is what I know so far:</p>
  
  <p>1) <a href="https://stackoverflow.com/a/22103103/2480714">Unlike in the old ways</a>, it is no longer 1000, 1000 by -1000, -1000</p>
  
  <p>2) <a href="https://developer.android.com/reference/android/graphics/PointF.html" rel="nofollow noreferrer">The coordinates that are returned</a> 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." (<a href="https://developers.google.com/android/reference/com/google/android/gms/vision/face/Landmark.html#getPosition()" rel="nofollow noreferrer">Source</a>)</p>
  
  <p>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:</p>
  
  <ul>
  <li>464.90558,1112.7573</li>
  <li>-19.159714,218.88104</li>
  <li>28.383072,196.1712</li>
  <li>-130.06908,1071.8779</li>
  </ul>
  
  <p>Which makes no sense since I don't understand how coordinates can be negative if the top left is (0,0). </p>
  
  <p>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?</p>
  
  <p>Thanks all,</p>
  
  <p>PGMac</p>