1

I have a video containing frames that are 20x50 pixels. When I run the following code, I can barely see anything:

enter image description here

cap = cv2.VideoCapture("video20x50.avi")
while(cap.isOpened()):
        ret, frame = cap.read()
        if ret == True: 
            cv2.imshow("Video", frame)
            if cv2.waitKey(27) & 0xFF == ord('q'):
                break
        else:
            break

cap.release()
cv2.destroyAllWindows()

Maximizing the window doesn't enlarge the image. I want to know how I can enlarge it. On windows if I double click the video file, it opens full screen and I can see the video (it is heavily pixelated/blurry, but at least I can actually see the video and that is what I want with opencv). Is there a way to make it fullscreen with opencv as well?

lionheart
  • 333
  • 2
  • 11

1 Answers1

0

You can use OpenCV's resize function to resize each frame, here's the documentation on that:

https://pythonexamples.org/python-opencv-cv2-resize-image/

Michael
  • 2,344
  • 6
  • 12