Learn Before
Concept
Resizing Images
Not all images are going to be available in the correct dimensions for easy usage. I.e. we may be given an image that is 1600x1600, which is far too big to display on a screen. We can resize the image as needed using the cv2.resize() method.
img = cv2.resize(img, (0,0), fx = 0.5, fy = 0.5)
fx would change the horizontal width by a factor of 0.5 and fy would affect the vertical length.
You can also manually indicate the specific dimensions of the image that you want to resize to. Both methods will achieve the same effect if you know exactly how big or small the resulting image should be.
0
1
Updated 2021-06-11
Tags
Python Programming Language
Data Science