This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
def paddedzoom(img, zoomfactor=0.8): | |
''' | |
Zoom in/out an image while keeping the input image shape. | |
i.e., zero pad when factor<1, clip out when factor>1. | |
there is another version below (paddedzoom2) | |
''' |