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

Detect if the resize operation would deform an image with human faces. #67

Closed
esimov opened this issue Jun 16, 2021 · 1 comment
Closed

Comments

@esimov
Copy link
Owner

esimov commented Jun 16, 2021

Is your feature request related to a problem? Please describe.

Let's suppose that an image is bigger vertically than horizontally, but also contains sensible information like a person face. If we wish to reduce the image vertically by a high order of magnitude this will results in a condensed, ugly and almost unrecognizable person face. We wish to avoid this, so in some way we need to detect if an image contains a person face and the applied resize would deform the resulted image.

Here is an example:

Original image Resulted image
winking-teenage-girl-life-in-viewscience-photo-library winking-teenage-girl-life-in-viewscience-photo-library

Describe the solution you'd like

Since we already using Pigo for face detection we can detect if an image contains human faces prior resizing but also we can analyze if the resize operation could be performed without distorting the generated image. In the other cases we can either skip the image resize operation and leave the image unaltered showing a warning message or we can scale the image to the most appropriate dimension.

@esimov
Copy link
Owner Author

esimov commented Oct 23, 2022

Finally had some time, to implement this annoying situation. The resolution I opted for in case the face detection option is used and the resulted image would deform a persons face, is to halt the process and alert the end user. In this case the user can opt in to still resize the image, but he needs eventually to disable the face detection activation flag.

@esimov esimov closed this as completed Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant