import numpy as np
import cv2

cap = cv2.VideoCapture(0)

def rescale_frame(frame,percent):

    #height and width as per percentage of default height and width
    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)



while True:
    rect, frame = cap.read()

    cv2.imshow('Default', frame)
    
    #in  this  we  are scaling frame rather than the cap
    frame75= rescale_frame(frame, percent=30)
    cv2.imshow('frame75', frame75)
    
    frame150 = rescale_frame(frame, percent=70)
    cv2.imshow('frame150', frame150)

    
    if cv2.waitKey(20) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
