Skip to content

Instantly share code, notes, and snippets.

@juliussin
Created November 9, 2020 03:15
Show Gist options
  • Save juliussin/c441284e282c3a70d8415751132213b8 to your computer and use it in GitHub Desktop.
Save juliussin/c441284e282c3a70d8415751132213b8 to your computer and use it in GitHub Desktop.
Rescale frame OpenCV
import cv2
import numpy as np
def rescale_frame(frame, percent=75):
width = int(frame.shape[1] * percent / 100)
height = int(frame.shape[0] * percent / 100)
dim = (width, height)
return cv2.resize(frame, dim, interpolation=cv2.INTER_AREA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment