Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I reduce the window size? #10

Open
sagarnibandhe opened this issue Jul 30, 2020 · 8 comments
Open

How do I reduce the window size? #10

sagarnibandhe opened this issue Jul 30, 2020 · 8 comments

Comments

@sagarnibandhe
Copy link

Hello,

Hope you are doing well!

I have a question, how do we reduce the window size? when I run the script, the camera opens and takes the entire screen. How do I reduce that size?

@surya-veer
Copy link
Owner

surya-veer commented Jul 31, 2020

Add this after line 75:

height, width = img.shape[:2]
resize = .5 # lets say 50%
img = cv2.resize(img, (int(resize*width), int(resize *height)))

Hope it will help.

@sagarnibandhe

This comment has been minimized.

@surya-veer

This comment has been minimized.

@sagarnibandhe

This comment has been minimized.

@sagarnibandhe

This comment has been minimized.

@sagarnibandhe
Copy link
Author

This is how my code looks like:

while True:
# Reading image from video stream
_, img = video_capture.read()
img = cv2.flip(img, 1)
height, width = img.shape[:2]
resize = .5 # lets say 50%
img = cv2.resize(img, (resize * width, resize * height))

Error:
Traceback (most recent call last):
File "/Users/sagarnibandhe/PycharmProjects/movementTracking/trackmovement/move.py", line 87, in
img = cv2.resize(img, (resize * width, resize * height))
TypeError: integer argument expected, got float

@surya-veer
Copy link
Owner

@sagarnibandhe this is obuous, cv2.resize(img, (int(resize*width), int(resize *height)))

Repository owner deleted a comment from sagarnibandhe Jul 31, 2020
@sagarnibandhe
Copy link
Author

@surya-veer Yes I agree. I tried this before but it doesn't reduce the window size. I have one last question, how do we handle the delay? is there any way that we can reduce the delay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants