# How to maximize frame captured by video\_capture.read()

**URL:** https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039
**Category:** Python
**Created:** [November 19, 2022, 10:39am UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039 "2022-11-19T10:39:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sabayke\_bremso](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sabayke_bremso/32/6552_2.png) [@sabayke\_bremso](https://forum.opencv.org/u/sabayke_bremso)
#### Post date: [November 19, 2022, 10:39am UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/1 "2022-11-19T10:39:34Z")

</div>

Hello, I want to resize the video image to 1/1 size instead of 1/4 to display the result on a screen.  
attached part of my code

```auto

import face_recognition
import cv2

video_capture = cv2.VideoCapture(0)
frame = video_capture.read()
    # Resize frame of video to 1/1 size
    width = 500
    height = 700
    dsize = (height, width)
    small_frame = cv2.resize(frame, dsize, fx=0.25, fy=0.25)
    # Display the results
    for (top, right, bottom, left), name in zip(face_locations, face_names):
        # Scale back up face locations since the frame we detected in was scaled to 1/4 size
        top *= 4
        right *= 4
        bottom *= 4
        left *= 4
        # Draw a box around the face
        cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)
        # Draw a label with a name below the face
        cv2.rectangle(frame, (left, bottom - 35), (right, bottom), (0, 0, 255), cv2.FILLED)
        font = cv2.FONT_HERSHEY_DUPLEX
        cv2.putText(frame, name, (left + 6, bottom - 6), font, 1.0, (255, 255, 255), 1)
    # Display the resulting image
    cv2.imshow('Video', frame)
    # Hit 'q' on the keyboard to quit!
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

```

how to make the frame take the whole window of my pc? thank you

the following screenshot explains my problem

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/6/657950bac962920d14bc56519bd6fafec33395ec.jpeg)

---

<div class="post-metadata">

### Author: ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)
#### Post date: [November 19, 2022, 1:32pm UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/2 "2022-11-19T13:32:53Z")

</div>

your code is incomplete / broken , cant be reproduced, please fix !

apart from that, you probably should NOT try to resize the image, but make imshow() show it “full screen”:  
add a

```
cv2.namedWindow("Video", cv2.WINDOW_NORMAL)

```

and it will resize the image automatically, once you click the full-screen button

---

<div class="post-metadata">

### Author: ![sabayke\_bremso](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sabayke_bremso/32/6552_2.png) [@sabayke\_bremso](https://forum.opencv.org/u/sabayke_bremso)
#### Post date: [November 19, 2022, 4:07pm UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/3 "2022-11-19T16:07:10Z")

</div>

Hello berack,  
I added the line you suggested but my problem is not solved yet.

I still have the same frame size

---

<div class="post-metadata">

### Author: ![sabayke\_bremso](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sabayke_bremso/32/6552_2.png) [@sabayke\_bremso](https://forum.opencv.org/u/sabayke_bremso)
#### Post date: [November 19, 2022, 4:23pm UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/4 "2022-11-19T16:23:52Z")

</div>

I was able to solve the problem thanks to God I would like to share the solution with everyone

```auto
# Display the resulting image
    cv2.namedWindow("Video", cv2.WND_PROP_FULLSCREEN)
    cv2.setWindowProperty('Video', cv2.WND_PROP_FULLSCREEN, 0)
    cv2.imshow('Video', frame)

```

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [November 19, 2022, 5:23pm UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/5 "2022-11-19T17:23:26Z")

</div>

> [@sabayke\_bremso](#):
>
> I added the line you suggested but my problem is not solved yet.

then you didn’t add the line in the right place.

> [@sabayke\_bremso](#):
>
> ```auto
> cv2.namedWindow("Video", cv2.WND_PROP_FULLSCREEN)
> 
> ```

that is wrong. it only “works” because `cv.WND_PROP_FULLSCREEN == 0 == cv.WINDOW_NORMAL` you should have used the `WINDOW_NORMAL` creation flag there, as you were suggested to do. the other named constant is for setting window properties, not creation flags.

---

<div class="post-metadata">

### Author: ![sabayke\_bremso](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sabayke_bremso/32/6552_2.png) [@sabayke\_bremso](https://forum.opencv.org/u/sabayke_bremso)
#### Post date: [November 19, 2022, 9:08pm UTC](https://forum.opencv.org/t/how-to-maximize-frame-captured-by-video-capture-read/11039/6 "2022-11-19T21:08:00Z")

</div>

> [@crackwitz](#):
>
> then you didn’t add the line in the right place.

```auto
# Display the resulting image
cv2.namedWindow("Video", cv2.WINDOW_NORMAL)
cv2.imshow('Video', frame)

```

You were right I was tired that’s why I didn’t pay attention to the location of the line but it works perfectly thank you again
