Wednesday , October 30 2024

Resizing the Image in Python using OpenCV

5 Resizing the Image

Resizing the Image in Python using OpenCV

In [2]:
import cv2
img = cv2.imread('machinelearning.png',cv2.IMREAD_COLOR)
cv2.imshow('Machine Learning',img)
cv2.waitKey(0)
cv2.destroyAllWindows()

Resize image to 200px 180px ( Width Height )

In [3]:
import cv2
img = cv2.imread('machinelearning.png',cv2.IMREAD_COLOR)
resize = cv2.resize(img, (200, 180)) 
cv2.imshow('Machine Learning',resize)
cv2.waitKey(0)
cv2.destroyAllWindows()

About Machine Learning

Check Also

Record Video From a Webcam using OpenCV

12 Record Video using OpenCV Record Video From a Webcam using OpenCV¶ cv2.VideoWriter( filename, fourcc, …

Leave a Reply

Your email address will not be published. Required fields are marked *