vision-camera-resize-plugin icon indicating copy to clipboard operation
vision-camera-resize-plugin copied to clipboard

feat: Preserve Aspect Ratio Option

Open thomas-coldwell opened this issue 1 year ago • 3 comments

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 avatar Aug 20 '24 13:08 thomas-coldwell

Heyo - this is still WIP?

mrousavy avatar Aug 20 '24 21:08 mrousavy

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

thomas-coldwell avatar Aug 21 '24 14:08 thomas-coldwell

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?

bglgwyng avatar Sep 26 '24 09:09 bglgwyng