OPENCV — resize an image

Powerful learning
1 min readJul 6, 2022

I am a Youtuber. My channel name is Powerful Learning. I post free certifications, free internships and free webinars.

Opencv is a python library mainly used in artificial intelligence domain. It is used to deal with images and video. I have explained a very easy yet important basic concepts of opencv function in my video. To watch the process — CLICK HERE

I have already posted the video on how to read, write and show an image in just 5 lines of code. To see the code click here. To convert color image to grayscale image and to print image property click here. To resize an image click here for video

TO RESIZE AN IMAGE

import cv2

import imutils

# basic image processing functions such as translation, rotation, resizing

from google.colab.patches import cv2_imshow

#since google colab doesnt support cv2.imshow() function you have to import its own cv2_imshow() package

image= cv2.imread(“powerful learning (5).png”)

#upload an sample image in colab. I have uploaded an image name “powerful learning (5).png”.

resize= imutils.resize(image,width=100)

cv2.imwrite(“resize.png”,resize)

#to save the file in local system

cv2_imshow(image)

#displaying normal image

cv2_imshow(resize)

#displaying resized image

--

--

Powerful learning

Mini blog on Free certifications, internships and webinars