Does OpenCV Image Resize Resize?

I am trying to scale an image using OpenCV Python bindings (CV2, new bindings):

ret, frame = cap.read()
print frame.shape
# prints (720, 1280, 3)
smallsize = (146,260)

smallframe = cv2.resize(frame, smallsize)
print smallframe.shape
# prints (260, 146, 3)

As you can see, the dimensions somehow end up flipping on the thumbnail. Instead of returning an image with dimensions (WxH) of 146x260 , I get 260x146 .

What gives?

+4
source share
2 answers

, . , . , python OpenCV numpy. , .. (, ) , .. (, ). .

:

  • cv2.anything()(width, height)
  • image.anything()(height, width)
  • numpy.anything()(height, width)
+7

, . .

+1

All Articles