Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert relative face bounding box location to absolute coordinates #2829

Closed
sainisanjay opened this issue Nov 29, 2021 · 7 comments
Closed
Assignees
Labels
legacy:face detection Issues related to Face Detection platform:c++ Issues specific to C++ framework in mediapipe type:support General questions

Comments

@sainisanjay
Copy link

sainisanjay commented Nov 29, 2021

Any one can help me to convert relative face bounding box location to absolute coordinates.

const float scale_x = float(frameSize.width) / float(inputSize.width);
const float scale_y = float(frameSize.height) / float(inputSize.height);
float x0 = rects[i * ow] * scale_x; // left
float w = rects[(i * ow) + 1] * scale_x; // width 
float y0 = rects[(i * ow) + 2] * scale_y; // top
float h = rects[(i * ow) + 3] * scale_y; // height             
mRects.push_back(cv::Rect(x0, y0, w, h));

Based on my implementation my detected face BBox is overlapping other place in the image then the actual face (Attached image)
test

@sainisanjay sainisanjay added the type:support General questions label Nov 29, 2021
@sgowroji sgowroji added legacy:face detection Issues related to Face Detection stat:awaiting response Waiting for user response stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response labels Nov 29, 2021
@sgowroji sgowroji assigned hadon and unassigned sgowroji Dec 1, 2021
@sgowroji sgowroji added the platform:c++ Issues specific to C++ framework in mediapipe label Dec 1, 2021
@sgowroji
Copy link

Hi @sainisanjay, Are you testing the above on a cropped image or scaled image in c++. ?. Try checking the same with other platforms python and java implementation.

@sgowroji sgowroji added stat:awaiting response Waiting for user response and removed stat:awaiting googler Waiting for Google Engineer's Response labels Dec 16, 2021
@sainisanjay
Copy link
Author

@sgowroji I am testing on cropped image.

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@sgowroji sgowroji reopened this Jan 3, 2022
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@sgowroji sgowroji removed stat:awaiting response Waiting for user response stale labels Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:face detection Issues related to Face Detection platform:c++ Issues specific to C++ framework in mediapipe type:support General questions
Projects
None yet
Development

No branches or pull requests

3 participants