Skip to content

Conversation

@thomas-coldwell
Copy link

@thomas-coldwell thomas-coldwell commented Aug 20, 2024

Context: Many computer vision algorithms and ML models require an input in which the aspect ratio of the original image is preserved by scaling the image down equally along both axis and then pad the rest of the input space with black or white pixels. A good example of this is the image resize method in the Tensorflow framework https://www.tensorflow.org/api_docs/python/tf/image/resize

This adds an option called preserveAspectRatio to the resize method which when set to true applies this resizing for the input instead of performing any kind of cropping. Mirror and rotation operations still apply afterwards though

@thomas-coldwell thomas-coldwell marked this pull request as draft August 20, 2024 13:12
@mrousavy
Copy link
Owner

Heyo - this is still WIP?

@thomas-coldwell
Copy link
Author

Hey @mrousavy yes - still a WIP as I need to fix this on Android but need the modular pipeline from #72 to be able to do this - on Android I need to correct for sensor rotation first and then apply the resize op here otherwise the image would be distorted

@bglgwyng
Copy link
Contributor

Hello, I think that I made a PR with the same purpose as yours. See #77.
I'm struggling to implement the Android part, as the color channel doesn't work as I expected on Galaxy.
Your PR neither doesn't include Android implementation. Did you have the same problem with me?

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

Successfully merging this pull request may close these issues.

3 participants