How to get X, Y of the face with open cv?

I am pretty new to programming in java and am looking for a way to get the x and y chords of a face detected with OpenCV. I then want to use these chords in another function. Is there documentation on the OpenCV for processing? Thank you for your time!


Welcome to the community! :wink:

Here is the GitHub repo for OpenCV for Processing and this is what you need :

I’m not sure what you mean by chords, but since you used the beginner’s tag maybe you only need to study the example file of the FaceDetection example file of the OpenCV for Processing library, where you can see that x and y are obtained in the faces array. (faces[i].x, faces[i].y).
However, if you mean by chords the individual facial features (mouth eyes etc.) this library can’t do that. But I’ve explained in this link, how Processing can use the latest OpenCV library. Then you need to study the Haar Cascade Classifiers in OpenCV and use them as explained in this tutorial.

1 Like

Thank you, sorry, I thought it as much and was trying to test it but when I was I used
println(faces[i].x, faces[i].y);
and it didn’t work. But now it is, thank you.