Answers for "how to scale down numpy array"

3

resize numpy array image

import cv2
import numpy as np

img = cv2.imread('your_image.jpg')
res = cv2.resize(img, dsize=(54, 140), interpolation=cv2.INTER_CUBIC)
Posted by: Guest on December-13-2020
0

scale in numpy

abs_max = np.amax(np.abs(unnormalized_array))
normalized_array = unnormalized_array * (4.0 / abs_max)
Posted by: Guest on March-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language