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

Animation with big images #163

Open
Bergschaf opened this issue Jan 8, 2022 · 0 comments
Open

Animation with big images #163

Bergschaf opened this issue Jan 8, 2022 · 0 comments

Comments

@Bergschaf
Copy link

Bergschaf commented Jan 8, 2022

When the animation is displayed with very big images (higher resolution than the screen) only a fraction of the image is shown. I would suggest resizeing the image before it is displayed.

img = ResizeWithAspectRatio(img,height=1000)  # there are Libarys that can figure out the screensize
cv2.imshow("Animation", img)´´´

(line 662 - 663)



def ResizeWithAspectRatio(image, width=None, height=None, inter=cv2.INTER_AREA):
    dim = None
    (h, w) = image.shape[:2]
if width is None and height is None:
    return image
if width is None:
    r = height / float(h)
    dim = (int(w * r), height)
else:
    r = width / float(w)
    dim = (width, int(h * r))

return cv2.resize(image, dim, interpolation=inter)

https://stackoverflow.com/questions/35180764/opencv-python-image-too-big-to-display

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

1 participant