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

Resize check #1738

Open
rcastill opened this issue Jun 30, 2022 · 1 comment
Open

Resize check #1738

rcastill opened this issue Jun 30, 2022 · 1 comment

Comments

@rcastill
Copy link

rcastill commented Jun 30, 2022

I would like to be able to resize to a target resolution and don't need to check if the target resolution is already the image's resolution.

My specific use case for this functionality is that I found this to be a huge bottleneck in a real time object detection application. Resize itself took some time, so I pre-processed the image so it came already resized from another thread. Performance improved, but profiling still showed that the guts of resize where being called (vertical/horizontal_sample). Checking if it was already resized, hugely improved my application's performance.

This is more generally applicable to people that could face the same problem. Maybe it's a better default to check first.

Draft

It's a simple check using GenericImageView::dimensions().


I also understand it may be a design decision to leave this check to the user. But I wanted to raise the question.

@fintelia
Copy link
Contributor

fintelia commented Jul 8, 2022

This seems like a reasonable feature addition to me. The cost of checking should be a tiny fraction of the total time spent resizing an image

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

2 participants