How to batch resize images to fixed dimension and rename using python | opencv

preview_player
Показать описание
In this video i have shown how to resize batch images to a fixed dimension and also to rename them using python!
This script can be used to resize any dataset of images for various purpose.

***Things i forgot to mention***

**cv2.IMREAD_UNCHANGED**
since, opencv loads an image as BGR, so avoid any transparency and also to load it as such(RGB), the unchange method is used.

**INTERPOLATION**
used for resampling the pixel area relation, i.e. if you are upscaling then use INTER_LINEAR or INTER_CUBIC, but If you are shrinking the image, you should prefer to use INTER_AREA interpolation.

**print statement**
if you prefer to have a print statement while resizing, you can do so by giving a print statement in the for loop.

**************************************
Github :-

Thank you for watching the video!
do, like,comment and subscribe to the channel.
Рекомендации по теме
Комментарии
Автор

***Things i forgot to mention***

**cv2.IMREAD_UNCHANGED**
since, opencv loads an image as BGR, so avoid any transparency and also to load it as such(RGB), the unchange method is used.

**INTERPOLATION**
used for resampling the pixel area relation, i.e. if you are upscaling then use INTER_LINEAR or INTER_CUBIC, but If you are shrinking the image, you should prefer to use INTER_AREA interpolation.

**print statement**
if you prefer to have a print statement while resizing, you can do so by giving a print statement in the for loop.



Thank you for watching the video!
do, like, comment and subscribe to the channel.

dynamiccodes