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
Fix for min face area not being proportional. #1374
Conversation
CGFloat imageArea = image.size.width * image.size.height; | ||
CGFloat faceProportionOfImage = faceArea / MAX(imageArea, 0.0000001); | ||
// Reminder: "0.0178" of the area of a 640x640 image would be roughly an 85x85 area. | ||
BOOL faceIsBigEnough = (faceProportionOfImage >= 0.0178); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new proportional value of 0.0178
was chosen by simply increasing it until the test passed.
679e4a7
to
20589d1
Compare
20589d1
to
0679d8c
Compare
CGFloat imageArea = image.size.width * image.size.height; | ||
CGFloat faceProportionOfImage = faceArea / MAX(imageArea, 0.0000001); | ||
// Reminder: "0.0178" of the area of a 640x640 image would be roughly 85x85. | ||
isFaceBigEnough = (faceProportionOfImage >= 0.0178); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.0178
was roughly the smallest value at which our minimum size face test passed. Proportionally it seemed about right.
The face area check was a bit off. The face bounds are unit values which need to be denormalized to image size to get the face's actual area in terms of the image's area. Then we can divide the actual face area by the image area to get a resolution-independent proportion.
Before
After