Learn Before
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
Tags
Python Programming Language
Data Science
Related
Installing and Importing OpenCV
Loading in Assets in OpenCV
Displaying Images
Resizing Images
Rotating Images
Conceptual Breakdown of OpenCV Image Storage
Slicing / Copying Portions of the Image
Creating Text
Project Directory Structure for OpenCV
Shape Creation in OpenCV
Writing Images (OpenCV)
Live Video Feed Processing in OpenCV