-
Notifications
You must be signed in to change notification settings - Fork 1k
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
height argument ignored in imutils.resize() when width argument is set #286
Comments
I think this is the intended behavior of the resize function of imutils, to maintain the original aspect ratio of the image while resizing. We can either suggest this as a feature or close the issue. |
Even if this behavior is intended, right now this is just not obvious. I would at least add a docstring to the resize function, adding a note that the aspect ratio is maintained as well as a hint to the Maybe I can make a small PR for this later. Though I would argue that if I as a user wanted the aspect ratio to be kept, I simply wouldn't specify a width and height that would break it. But if I wanted the aspect ratio to change, shouldn't I be able to use imutil's resize function as well rather than having to find one from a different library that allows me to do that? So yeah, I would be in favor of a feature request. Maybe we could introduce a new optional argument to the resize function |
Sounds good. Maybe I can work on it once the PR is done. Currently users have to switch between OpenCV and Imutils for different types of resizing. I liked the idea of using a parameter like "keep-aspect" |
However I am not sure is the project is still active, the last commit seems to be made two years ago. |
Steps to reproduce:
resized_image = imutils.resize(image, width=400, height=300)
Expected Behavior:
resized_image
should have a resolution of 400 by 300 pixelsActual Behavior:
resized_image
has a resolution of 400 by 255 pixelsThe text was updated successfully, but these errors were encountered: