Post

Resizing And Cropping - opencv cv2 tutorial chapter3

chapter3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import cv2


img = cv2.imread('Resources/lambo.PNG')
print(img.shape)

img_resize = cv2.resize(img, (200, 300))
print(img_resize.shape)

img_crop = img[0:200, 200:500]

cv2.imshow('img', img)
cv2.imshow('resize', img_resize)
cv2.imshow('crop', img_crop)

cv2.waitKey(0)
This post is licensed under CC BY 4.0 by the author.