Hugo Alves Hugo Alves - 7 months ago 62
Android Question

Camera face detection coords to screen coords

i've recently started playing with Android's camera api. And i'm using face detection and it's callback

. I'm having trouble trying to understand how to convert the
to something i can use on screen like move a image around the face centered on that point.

can anyone help me understand how to convert from the coord system given by the camera to something i can use to set elements on my activity.


From docs

(-1000, -1000) represents the top-left of the camera field of view, and (1000, 1000) represents the bottom-right of the field of view.

So to put in to screen coords (pseudocode):

screenX = (coord.x +1000) * screen.width / 2000
screenY = (coord.y +1000) * screen.height / 2000