I want to resize an RGB image using Python 2.7. I tried using cv2.resize funcion, but it always returns a single channel image:
(Pdb) x = cv2.imread('image.jpg')
(Pdb) x.shape
(50, 50, 3)
(Pdb) x = cv2.resize(x, (40, 40))
(Pdb) x.shape
(40, 40)
I would like the end result of x.shape to be (40, 40, 3).
Is there a more pythonic way to resize an RGB image, except that it cycles through three channels and resizes each separately?
source
share