Open hady13 opened 7 years ago
I don't think that you have the scale right. See this example:
Yes, as I said, I already referred that example. But that is for bitmap image, so I change the code like that... So How I chage this code..?
@hady13 Did you ever figure out how to get the scale to properly place the landmarks in real time video? I am also having the same issue and have tried multiple things but no luck.
Just got my landmarks to line up as they should by using the translate functions. The translate functions get the scale by subtracting the mOverlay width (or height) from the scaleFactor of the landmarks position. Posting this solution just in case someone else comes along.
for (Landmark landmark : face.getLandmarks()) {
int cx = (int) translateX(landmark.getPosition().x);
int cy = (int) translateY(landmark.getPosition().y);
canvas.drawCircle(cx, cy, 10, mBoxPaint);
}
I already referred this issue. https://github.com/googlesamples/android-vision/issues/197
But I'm trying to draw landmark in real time video, not bitmap, so I have wrote like this.
But I still have wrong positions... From where do landmarks detect the position in this API? Please help me.